7

Boundary events in Referenced Subflow

 2 years ago
source link: https://blogs.sap.com/2021/08/28/boundary-events-in-referenced-subflow/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Boundary events in Referenced Subflow

Overview

In my previous blog I have explained referenced subflow  feature in SAP Workflow Management. SAP has enhanced referenced subflow feature with boundary events. Boundary events enable developers to manage exceptions or delays in a reference subflow and manage it accordingly.

There are two types of boundary events in SAP Workflow Management. A boundary event based on a predefined time period or based on a specific event from the child workflow. These events are captured in the parent workflow and it can be processed accordingly.

Boundary Timer Event

A boundary timer event is directly assigned to the referenced subflow. A timer event has a Duration property based on a time stamp or a fixed period of time. The timer will be triggered after completion of the time period if the referenced subflow has not yet completed. It is possible to cancel the referenced subflow and execute the next activity. In the below workflow model a boundary timer event is added to Cost Center Approval referenced subflow , configured and assigned a duration of 1 day. Cancel Subflow check box is checked to cancel the referenced subflow instance and continue to execute the Group Head Approval.

boundaryTimerEvent.png

Boundary Escalation Event

A boundary escalation event listens to an intermediate escalation event from the child workflow. The child workflow raises this event and assign an escalation code to this event. An escalation event may terminate the referenced subflow instances and continue to execute the next set of activities.

Intermediate Escalation Event – Referenced / Child Workflow

The below workflow model is used as a referenced subflow from a parent workflow. It has two intermediate escalation events to update the parent workflow. When the approver request for a rework, the escalation event update the status to the parent workflow and use the escalation code Rework. If the approver rejects the request, the escalation event update the status to the parent workflow using the escalation code Reject.

boundaryEscalationChildWorkflow.png

Parent Workflow

The parent workflow has two Boundary Events to manage the status from the child workflow. The child  workflow is configured as a referenced subflow. The intermediate escalation events from the child workflow are captured and managed in the parent workflow. If the cost center owner approval is send to rework, the parent workflow notifies the requestor. But this event is not configured to cancel the referenced subflow. If the cost center owner rejects the request, the parent workflow notify the requestor, cancel the referenced subflow and terminate the parent workflow.

As you can see the boundary escalation event is consuming the escalation code from the child workflow. If the parent is not catching the intermediate event from the child workflow, it will be propagated to the next parent if there is one.

boundaryEscalationParentWorkflow.png

Summary

Boundary events enable developers to raise intermediate escalation events from a workflow and it can be consumed from the parent workflow. A key capability to make referenced subflow feature more powerful and solve various business problems.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK