Configuring steps in an activity
After you create an activity, define a sequential set of instructions, or
steps,
that the activity completes automatically. Each step calls a method or
supported rule type to perform the required processing.
- Create an activity. For more information, see Creating an activity. Determine whether and how other rules can reference this activity by selecting an appropriate activity type on the Security tab. For more information, see Security tab on the Activity form.
- In the navigation pane of Dev Studio, click Records.
- Expand the Technical category, and then click Activity.
- Open the activity that you want to configure.
- Optional: To temporarily exclude a step from running by commenting that step out, on the
Steps tab, in the Label field, enter
//.
Note: An excluded loop step excludes all child steps from running. - Optional: To allow other steps to reference this step in their When or Jump criteria, on the
Steps tab, in the Label field, enter a
short string.
For example: For a step that sets an error code, enter error. - Optional: To repeat a step or a contiguous sequence of steps a number of times, click
Loop, and then define a loop.The most common way to loop is to iterate over a Page List property, such as pxResults, by using the For each embedded page option. For more information, see Repeating steps in an activity.
For example: Delete each embedded page by using the Page-Remove method. - Optional: To complete a step only if specific parameters fulfill conditions that you define,
click When, and then define the preconditions for the step.For more information, see Activity form - Completing the Steps tab - Entering preconditions.
- Click the Method field, press the Down arrow key, and then
select a method or instruction that you want to complete.
For example: To retrieve a list of data instances that match a specific set of parameters, enter Obj-Browse. To set the value of a specified property, enter Property-Set. - Optional: To set a context for the step that is different than the primary page of the activity,
specify the name of the page or property that you want to use as the context.By default, an activity runs within the context that calls that activity. For example, an activity that a Utility shape calls during case processing runs within the context of pyWorkPage, which is the page that is assigned to the case type. Complete the following steps only if you want to change the default context:
- On the Pages & Classes tab, add the page or property
that you want the system to use at run time.For more information, see Defining the pages and classes of a rule.
- In the Step Page field, enter the name of the property that
you want the step to use as context.Depending on the scenario, you can use additional syntax. For example, if you select the For each embedded page loop in step 6, enter a full property reference to a Page List property, such as pagename.pxResults.
For example: To copy a specific order from a list of previous orders in memory, set the step page to the appropriate page in the page list of results. - On the Pages & Classes tab, add the page or property
that you want the system to use at run time.
- Click Expand to see method parameters.
- In the Method Parameters section, configure how your application
applies the method or instruction that you selected in step 8:
- For methods, enter parameters specific to a particular method.
For example, if you selected the Obj-Browse method, in the PageName field, enter the name of the page on which you want to store the results, and then in the ObjClass field, enter the name of the class that you want the method to browse.
- For instructions, such as Call, Branch, Collect, or Queue, enter parameters specific to the rule that is associated with the instruction.
- If you selected Java, in the Java Source field, enter Java source code that you want the activity to run.
For more information, see Activity form - Completing the Steps tab - Entering Method parametersResult: At run time, the system passes the values that you specify to the method or instruction. The system holds the parameter names for a step on a special clipboard page that is called the parameter page, which is visible during tracing, but not with the Clipboard tool. - For methods, enter parameters specific to a particular method.
- Optional: To specify conditions to evaluate after the method in a step runs but before the
activity moves to the next step, click the Jump link, and then
define a transition.For more information, see Defining step transitions in an activity.
- Click Save.
- If your activity contains Java steps, ensure that the activity causes no security
issues by running the Rule Security Analyzer tool before locking a ruleset version.For more information, see Implementing security guidelines for custom HTML.
- Optional: To configure another step in the activity, click Add a step, and then repeat steps 4 through 14.
- Define input parameters for the activity. For more information, see Defining the input parameters of a rule.
Tip: When you define the input parameters, select In
orOut
to indicate whether the parameter is used for input to the called activity, or output from the activity. Using input parameters can make activities easier to understand, call, and test.Caution: The system does not prevent you from setting the value of an input parameter. A called activity can access and change both input and output parameters on the parameter page. - Create scalar variables that you can use to pass information between the steps of an activity. For more information, see Defining the local variables for an activity.
Previous topic Creating an activity Next topic Activity form - Completing the Steps tab - Entering Method parameters