Install the composer
module with npm:
$ npm -g install @ibm-functions/composer@index
Create actions named condition
, success
, and failure
as described in
bootcamp/README.md#your-first-composition.
Create a file named demo_if.js
:
composer.if('condition', 'success', 'failure')
Deploy the composition:
$ compose demo_if demo_if.js
Invoke the composition:
$ bx wsk app invoke demo_if
{
message: "Failure"
}
$ bx wsk app invoke demo_if -p password andreas
{
message: "Success"
}