Skip to content

Instantly share code, notes, and snippets.

@tardieu
Last active February 19, 2018 19:55
Show Gist options
  • Save tardieu/f5e0ad8d8a68c2a5201d49f53264fc66 to your computer and use it in GitHub Desktop.
Save tardieu/f5e0ad8d8a68c2a5201d49f53264fc66 to your computer and use it in GitHub Desktop.
Composer v2

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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment