Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Configuring steps in an activity

Updated on January 14, 2022

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.

Consider a scenario in which a customer service department wants to make available the content of their support requests through a REST service. To fulfill this requirement, you can configure an activity to validate the service parameters, gather the appropriate data, and construct a JSON response.
Before you begin:
Note: Limit each activity to 25 or fewer steps. To promote modularity and maintainability, use 15 or fewer steps and set the activity to complete one task.
  1. In the navigation pane of Dev Studio, click Records.
  2. Expand the Technical category, and then click Activity.
  3. Open the activity that you want to configure.
  4. 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.
  5. 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.
  6. 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.
  7. Optional: To complete a step only if specific parameters fulfill conditions that you define, click When, and then define the preconditions for the step.
  8. 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.
  9. 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:
    1. 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.
    2. 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.
  10. Click Expand to see method parameters.
  11. 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.
    Result: 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.
  12. 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.
  13. Click Save.
  14. 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.
  15. Optional: To configure another step in the activity, click Add a step, and then repeat steps 4 through 14.
What to do next:
  • 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 or Out 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.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us