Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tutorial tests your understanding of the previous one (Tutorial 3 - Defining Workflows in YAML workflow definitions) by asking you to modify a workflow to incorporate additional functionality.  The goal will be update hello.yaml to make the emphasis in the greeting (the exclamation point in the output of hello.yaml) configurable by the user of the workflow.

...

Kurator-Akka includes a StringAppender actor that adds a configurable suffix to each string it receives and outputs the modified strings. Add a new component to your workflow file (it may be easiest to copy and paste the GreetingSource component).  It doesn't matter where you add the component, as long as it is somewhere in the components section of the file.  Give the new component an id of GreetingEmphasizer and a type of StringAppenderStringAppender actors take a parameter called suffix.  Edit your GreetingEmphasizer component to make a single exclamation point the default suffix (enclose the exclamation point in single quotes).  Finally, add a listensTo property to GreetingPrinter and configure the component to receive its input from GreetingSource.

...

$ kurator-akka -f hello_emphasized.yaml -p greeting=Goodbye -p emphasis=.
GoodybeGoodbye.
$

Note that the values assigned to parameters often need to be quoted to prevent shell expansion.  Because Kurator-Akka interprets parameter values as YAML (or JSON) strings, so that lists and mappings may be provided as parameter values, quotes can be required to prevent interpretation as YAML as well.  Using a pair of double quotes nested within a pair of single quotes can be the safest approach.  For example, to use a question mark as the emphasis you will get an error unless you quote the ? in this manner (? surrounded by both double and single quotes):

$ kurator-akka -f hello_emphasized.yaml -p greeting=Goodbye -p emphasis='"?"'
GoodybeGoodbye?
$

8. Check your work

If your workflow does not behave as expected, compare it to the workflow below.  Differences between hello_emphasized.yaml and hello.yaml are in bold.

...