SDA - Prompting for Process properties - the nice way!

0 Likes

When a User requests a process in SDA you can optionally ask them to select or enter inputs properties. These properties are typically passed down from the application process to the invoked component processes. In this post I will look at how to pass application process property values down to component processes and use a couple of tricks to ensure that they are requested in as user friendly way as possible.

 

In an SDA component processes it is often desirable to branch the workflow based on some input property as illustrated in the "Run Tests" step in the screenshot below:

This input property can come from the environment context, but also from the user when the Application process (that triggers the component process) is initiated. In order to do this we need to pass properties down from the Application process to Component process - and there a couple of little tricks to ensure that the user is prompted properly (particularly for boolean checkbox properties).

As an example lets assume we want the user to click in a checkbox to determine whether tests are run as in the following screenshot with the "Run Tests" option:

To do this, we first need a Component process property (lets call in "run.tests") but the trick is not to make this a Checkbox property but a normal Test property as in the following screenshot:

In your Component process you can now use the value "true" for "run.tests" in the Switch step to execute your "Tests" as in the first screenshot above.

To pass this value down from the Application process, we then need to create an Application process property (call it "run.tests" again) - but this time it should be a proper  Checkbox property as this is what the user sees.

To pass the value the user selects (effectively true or false) down to the Component process you should set the value of the Component process property to the value of the Application process property. Sounds confusing - but drag the Install Component process step onto your Application process and then for the property to be passed down, click "Set a value here" under it. In this box type in a reference to the value of the Application process property, i.e. "${p:run.tests}" as in the screenshot below:

Make sure you map all Component process properties to Application process properties or the user will be prompted to enter them at runtime (and the they will be prompted with "component name/property name" which just looks plain bad).

Tags:

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended