Parameter Mapping in Workflows

A parameter is a named variable of a specific type that is associated with a Job or Workflow. You can use parameters to map values from one Job call or Workflow call to another.

Assume you've created a Workflow with a first Step that contains a System_Sleep Job call. By default, when you first create that Job call, RunMyJobs shows a red circle to indicate that you need to supply a parameter value.

If you click this Job call, a configuration overlay displays, and if you scroll to the Parameters section, you'll see a prompt asking you to supply a value for Time to sleep (in milliseconds).

Assume you'd like to be able to supply this value when you run the Workflow. To do so, click the Workflow's name to display the Edit Workflow overlay. In the Parameters tab of the overlay, create a Number parameter named Milliseconds for that Job. Make it an In parameter, with a Default Default Expression of 1000.

Now, all you need to do is map the Workflow's Milliseconds parameter to the Time to sleep (in milliseconds) field on the System_Sleep Job call. To do so, reopen the System_Sleep Job call's configuration overlay and click the red Enter Value button for its Time to sleep (in milliseconds) field. A Time to sleep (in milliseconds) overlay displays.

RunMyJobs lets you choose from four options:

  • None: Do not supply a value. This will not work in this case, because this is a required field.

  • Expression: Lets you directly enter a value or specify a REL expression that resolves to the value you want to use.

  • Workflow Parameter: Because this field requires a number, and the parent Workflow has a Number parameter, RunMyJobs automatically displays the Milliseconds parameter in this field. Click this parameter to select it and it will become highlighted.

  • Job Parameter: This Job does not have any parameters, but if it had any compatible parameters, they would be listed here.

If you select Workflow Parameter > Milliseconds and save the Workflow, the user will be able to supply a Milliseconds value when they run the Workflow, and that value will be mapped to the Time to sleep (in milliseconds) field in the System_Sleep Job call.

Using this technique, you can map parameters within Workflows in a variety of ways:

  • Workflow to Job call, as described in this topic.

  • Workflow to sub-Workflow call.

  • Job call to sub-Workflow call.

  • Job call to Job call.