How to use the @ibm-functions/composer.sequence function in @ibm-functions/composer

To help you get started, we’ve selected a few @ibm-functions/composer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ibm-functions / shell / app / plugins / modules / composer / lib / sequence.js View on Github external
})).then(componentEntities => {
                                //
                                // if an entity is an FSM, then use it, rather the elaboration rather than the invokeable entity
                                //
                                for (let idx = 0; idx < componentEntities.length; idx++) {
                                    const fsm = getFSM(componentEntities[idx])
                                    if (fsm) {
                                        components[idx] = fsm
                                    }
                                }

                                //
                                // now use the composer to construct the FSM
                                //
                                const fsm = composer.sequence(...components)

                                //
                                // finally, construct an invokeable entity around the FSM
                                //
                                return create({ name, fsm, annotations, parameters, wsk, commandTree, execOptions, type: badges.sequence })
                            })
                        }))
github ibm-functions / shell / tests / data / composer-source / path-rel-require / srijith.js View on Github external
function(args) {
    let metrics_aggregator = composer_utils.MetricsAggregator();
    return composer_utils.TimeOutPromise(
      Promise.resolve(
        composer.sequence(
          composer_utils.addMetricAggregator(metrics_aggregator, authentication),
          composer_utils.addMetricAggregator(metrics_aggregator, configuration),
          composer_utils.addMetricAggregator(metrics_aggregator, start_session),
          composer_utils.addMetricAggregator(metrics_aggregator, post_processing)
        ),
        args.origin,
        metrics_aggregator,
        args.max_seconds * 1000
      )
    );
  }
);