What is a Notification Wait Activity?

The Notification Wait Activity pauses a process until it receives a notification from another Activity or an external program.

The Notification Wait Activity waits for a response from one of the following:


Instances wait in a Notification Wait activity for a Process Notification activity or an external event to send a message to the Notification Wait activity before work flow continues. The exception to this rule is that due transitions can be added to a Notification Wait activity. This means that when the time for the due transition expires, the instance flows through the due transition path instead of continuing to wait for the message or event.

Any notification for an instance that has not reached the notification wait activity yet will wait there until the target instance arrives.

Using the Notification Wait Activity

The following table outlines some of the considerations when using the Notification Wait Activity within ALBPM Studio.

WorkSpace

The Notification Wait activity is not visible in WorkSpace.

Roles

Notification Wait activities can reside in user-defined and automatic role lanes.

Variables

The Notification Wait activity can define instance variables to determine the Argument Mapping.

The different argument mappings that can be defined are the incoming information from the Process Notification activity in another process or a notification from an external application using PAPI to communicate with the Notification Wait activity.

The chosen argument set (see Message Based transition.) can be the one that will decide the next activity for the notified instance.

Pre Conditions

An instance will wait at the Notification Wait activity until a subprocess' Process Notification activity sends a message back to the waiting instance or the Notification Wait activity's due transition logic expires. The subprocess' Process Notification activity should set the required arguments defined in the Argument Mapping as expected by the Notification Wait activity.

A Notification Wait activity can also wait for an external notification, which could be from either of the following:


  • Any activity in any process that uses the Notification component to send notification to the Notification Wait activity.

  • An external program that uses PAPI to notify the Notification Wait activity.

Post Conditions

When an instance leaves a Notification Wait activity, it continues on through one of the transitions leaving the Notification Wait activity following transition rules. (see Message Based transition)

Transitions

Notification Wait activities typically have one or more incoming transitions and one or more outgoing transitions. They may have an outgoing Due transition to allow instances to automatically transition out of the Notification Wait if it does not receive a notification within a specified time period.

If the Notification Wait activity has multiple sets of arguments, the Message based transitions are available. See Message based Transition.

If the Notification Wait allows interruptions, it will reside in its own flow and will not have an incoming transition.

Tasks  
Business Process Methods

No scripting is available. To pass arguments between processes, the Argument Mapping function is available.

Parent/Child Relationship

In a Parent/Child relationship, the parent process contains a Process Creation activity that calls the Child process.


  • The Process Notification activity always implicitly communicates with a Notification Wait activity in the calling process. It can only communicate back to the process that called it.

Child/parent relationship

This relationship is essentially the same as the Parent/child relationship with the exception that, by adding a new Notification Wait activity to the child process and a Process Notification activity to the Parent Process, the two processes can communicate with each other. This way, communication can be bidirectional between processes.

Note: As the Notification Wait will expect the notification from an instance in an activity in a child process, the Notification Wait activity should come after a Process Creation activity generating an instance in the child process.

External notification

In an external notification relationship, Notification Wait activities can wait for notification from the following:


  • An external program connecting through PAPI. PAPI is the Application Program Interface that allows external services to communicate with BPM processes. For further information, read the PAPI javadoc document distributed with the product.

  • An activity in a process that is not a subprocess (child process.) This activity does not need to be a Process Notification activity. Using the standard component Notification and its send method, you can send a notification to any process instance from any activity type.

In the external program scenario, a process includes a Notification Wait activity that has been created using the External event option on the Activity General Category.

In the Waits for: field, External event is selected to indicate that the activity is waiting for an event that is external to the process.

Note: A process that is not a subprocess (child) of the process which contains the Notification Wait activity is also considered an External event .

Allowing interruptions

A Notification Wait activity in your process indicates that all instances should wait in the activity for a specified time period only moving forward in the process if a notification is received or if due transition logic is enacted. This may not always be the best process design. What if you want to notify the process design only under certain conditions? For example, only in the event that customer has changed or cancelled an order? This kind of scenario does not require a Notification Wait directly in the main flow of the process design.

The Allows interruptions check box in the Activity General Category dialog box is used when you need to pull instances from a process flow at any time under certain conditions.

Note: If you are performing an external notification, you must indicate the instance Id you want to pull. If the notification is generated from a Process Notification, define the peerInstanceID with the Instance ID in the Argument Mapping.

Notification Wait activities that allow interruptions do not reside in the main process flow (between the Begin and End activities.) Instead, the activity resides in its own flow. The allows interruptions Notification Wait is shown with an interruption sign such as a small circle in its center in the Classic theme or a thunderbolt in the image (BPMN theme). .

When a notification is received by the Notification Wait activity, it is receiving all information about the instance that should be notified. The Engine finds the instance that matches the information received in the notification. The instance is then pulled from the main flow and routed to the Notification Wait flow.

Note: Remember to return the instance routed to the Notification Wait flow back to the main flow. In the last activity within this parallel flow use the BACK or SKIP actions in the BP-Method

Deleting a Notification Wait activity

If the Notification Wait activity's argument mapping uses correlations then you must not delete the activity. When you re-deploy the new process version without the Notification Wait activity, you loose the correlation and there might be instances waiting in that activity to be notified using this correlation.