Skip to main content


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

Launching background processes with the Hand Off shape

Updated on September 15, 2022

Use the Hand Off shape to launch other processes (in the background) from the Flow. This serves as a launching point for external processes which can be triggered at the appropriate time in the action execution. For example, use the Hand Off shape to initiate a Fulfillment process when a customer accepts an action.

Pega Customer Decision Hub
Note: Initial processing of the handed-off work object is sequential with the Flow execution until the new work object reaches a stopping point (such as an Assignment). At this point, Flow execution resumes and the handed-off work object lives and executes separately on its own. To avoid performance issues, put the Assignment in a subflow.

The following Configuration options are available for the Hand Off shape:

NamePurpose
Work Class NameName of the class which contains the process (Work Object flow) to be started.
Work Flow NameName of the process (flow) to be started.
Work Status(Status section)Status of the action after the new process has been initiated.

As part of the Hand Off shape, the entire contents of the action work object (including action details) are initially made available to the newly created work object. This information is stored in the top level OfferWorkPage clipboard page. This information is available whilst the new work object shares the execution with the action work object (see Note at the beginning of this section). If the new work object requires any of this data for its processing, it is recommended to copy relevant data from the OfferWorkPage onto appropriate locations on the new work object. This could be done via the use of the default Data Transform rule (pyDefault) or by other mechanisms in the work process flow before it enters a waiting point (such as an Assignment).

In a similar vein, a reference to the newly handed-off work object is stored on the original action work object. This is made available under the pyReferencedInsKeys construct. This information can be used to provide a reference code to the customer in an email or for any other cross-referencing purposes, as deemed fit by the user.

Note: In order for the system to successfully create and launch the handed-off work object, all necessary rules (such as Flow, Data Transform, Work Parties, etc.) should be properly configured for the desired work object.

Hand Off Example

Some of the salient pieces involved in a handed-off work object are demonstrated in the following OfferFulfillment example:

  • Data Transform:
    • pyDefault
  • Properties:
    • Channel
    • CustomerID
    • OfferName
  • Flow:
    • FulfillOffer
  • Work Parties:
    • Default
  • Flow Action:
    • Approve
  • Section:
    • FulfillOffer

This work object involves a minimal process flow where the object is placed in a workbasket and is resolved upon approval. The FulfillOffer Flow rule is shown below:

The above flow is configured to create a new work object since we expect it to have its own lifecycle and want it to be actionable after it is stored in the workbasket. For simpler flows with straight through processing (no assignment shapes), the flow can be configured with the temporary object setting in the Process tab.

As mentioned previously, both customer and action data are available to this flow until it hits the first assignment. After this assignment, only data that has been saved onto the work object will be available.

The following (pyDefault) Data Transform demonstrates the copying of (both action and customer) data from the action page onto the work object, upon its initial creation:

In the above Data Transform, the Customer object is added as the Customer work party on the new object.

A sample Work Parties rule for this work object is shown below:

The sample Flow Action and Section use basic PRPC concepts to display some of the copied over data and present an action to resolve the work object. This is demonstrated by the following instance of a handed-off Offer Fulfillment work object:

  • Previous topic Specifying the status of an action with the Update Status shape
  • Next topic Branching the action flow with the Decision shape

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