Skip to main content


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

Activity form - how to create activities for flows

Updated on January 14, 2022

Use these instructions to create activities that can be called directly in flows.

Flow processing automatically controls locking and transaction boundaries for work items. Do not use the Commit method (or the Obj-Save method with the WriteNow parameter selected) in any custom activity called by a flow.

Activity Type

The value of the Activity Type field on the Security tab determines which flow shapes accept this activity. To create an activity for a flow, set the Activity Type field to Utility, Rule Connect, Assign, Notify, or Router as appropriate.

First, explore the standard activities of the type you need, as examples and as starting points for your activity.

In all but rare situations, choose a class derived from the Work- base class for the Applies To key part of your activity. This makes your activity available to flows in that class plus all subclasses of the class (subject to security restrictions, rule resolution restrictions and so on).

Guidelines for Utility activities

Utility Utility

Follow these guidelines to create a Utility activity, one that can be referenced in a utility shape:
  • Select Utility as the Activity Type.
  • In the activity, do not use the Show-HTML method or interact with a user.
  • The activity can save a new or updated object with the Obj-Save method.
  • Optionally, this activity can use the TaskStatus-Set method to return a text value in the pxTaskStatus property to the flow as a basis for decisions. Connectors leading from the activity can be based on this status value. Using this method can simplify flow diagrams by eliminating fork or decision shapes that follow a utility shape.

Guidelines for Assign activities

Assign Assignment

Follow these guidelines and constraints to create an activity of type Assign, one that you can reference in an assignment shape:
  • In the activity, do not use the Show-HTML method or other means to interact with human users.
  • Create and save an instance of a concrete class derived from the Assign- base class. Typically, a new assignment is an instance of the Assign-Workbasket or Assign-Worklist standard class.

Guidelines for Integrator activities

Integrator Integrator shape

Use an Activity Type value of Rule Connect to make the activity available to an Integrator shape. Generally, use this for activities in a Work- class that call a rule to start a connector interface to an external system.

This activity type (and the corresponding Integrator shape) is a reminder that this shape depends on an external system. Response time, availability, and performance may be affected by outside factors.

Like the Utility activity type, a Connect activity type cannot include HTML displays.

Guidelines for Notify activities

NotifySelect an Activity Typeof Notify to identify activities in a Work- class that generate correspondence.

Correspondence generation can occur without any user interaction, or can capture user input in a simple HTML form, or may start Microsoft Word on the user desktop.

Guidelines for Route activities

RouteFollow these guidelines to create an activity with Activity Type of Route, one that can be referenced in a router shape:
  • The results of the activity are a work queue name, an Operator ID (for the worklist) or an agent name.
  • The activity does not display HTML forms or interact with a user.
  • The activity returns its results in an output parameter named AssignTo. This parameter is an output only, and does not need to be declared on the Parameters tab.

Many routing activities accept these Boolean input parameters:

ParameterDescription
CheckForAvailabilityIf this parameter is true, the activity is to check Operator ID instances for availability, and follow the rules to obtain a substitute if the operator is not available. (Standard routing activities support this parameter.)
SwitchToWorkbasketAllows an assignment to be routed to either a work queue or worklist. Use this Boolean output parameter in a router activity that is referenced in assignment shapes where the Rule field on the Assignment Parameters panel is set to Worklist.

When SwitchToWorkbasket is set to false, the AssignTo parameter identifies an Operator ID for a worklist; when set to true, the AssignTo parameter is to identify a work queue name.

PassthroughAssignmentAllows creation of an assignment instance to be bypassed, with the flow execution continuing with a default flow action — the most likely flow action — that requires no user input.

Set this Boolean output parameter to false in the normal case, or true to skip the assignment and continue flow execution as if the user chose the highest-likelihood flow action.

UsesSkillsInfluences the Properties panel to allow the entry of one or more skill names (literal values or property references) and skill levels (integers).

A check box for each skill can mark the skill as required to perform an assignment, or (if not selected) desirable to perform the assignment. The activity can call standard functions to test whether a specific operator possesses the required skills, or possesses the desired skills, at the indicated level of proficiency.

The standard Routing library (in the Pega-ProCom RuleSet) contains several functions useful in router activities.

Available parameters

When a flow calls an Integrator, Utility, Notify, or Assign activity, or another flow, it provides twelve parameters to the activity beyond those declared in the Parameters tab. Click the Show System Parameters button on the Parameters tab to review the names and purpose of the six parameters most often used.

ParameterDescription
flowNameThe subscript of this flow in the work page pxFlow property, a Page Group.
TaskNameThe shape name of the shape that this activity or flow was called from, such as SendResolutionEmail or SplitForEach999.
pyDraftModeTrue if the flow is in draft mode.
ReferenceInsKeypzInsKey of the work item page.
ReferenceClassClass of the work item page (the work type ).
ReferenceInsNamepxInsName of the work item page.
ReferencePageNameClipboard page name of the work item page.
TimeFlowStartedDate and time that the flow execution began.
InterestPageProperty reference to the embedded page of the work item that is the primary page of the flow. (This is null if the flow's primary page contains the work item.)

For example, a flow executing on the Customer work party has an interest page of .pyWorkParty(Customer).

InterestPageClassClass of the interest page, for example Data-Party. This is an empty string if the flow's primary page is the work item itself.
FlowHasEndedA Boolean used by internal flow processing to control whether one flow calling another is to wait or to continue.
flowTypeSecond key part of the flow.
  • Intelligent routing

    Intelligent routing is the process of comparing the characteristics of a new assignment with the characteristics of the workforce to route the assignment to the most appropriate operator. Like a supervisor who thoughtfully distributes work to her team, intelligent routing in your application can significantly affect the productivity and throughput of a team.

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