Previous  Next          Contents  Index  Glossary  Library

Master/Detail Coordination Activities

The Master/Detail coordination activities let you coordinate the flow of master and detail processes. For example, a master process may spawn detail processes that need to be coordinated such that the master process continues only when each detail process reaches a certain point in its flow or vice versa.

When you spawn a detail process from a master process in Oracle Workflow, you need to define the master/detail relationship between the two processes by making a call to the workflow Engine SetItemParent API when you create the detail process. See: SetItemParent.

You can then use the two activities described below to coordinate the flow in the master and detail processes. One activity lets you pause a process and the other signals the halted process to continue. To use these activities, you place one activity in the master process and the other in each detail process.

Both activities contain two activity attributes that you use to identify the coordinating activity in the other process(es).

Wait for Flow Activity

Place this activity in a master or detail process to pause the flow until the other corresponding detail or master process completes a specified activity. This activity calls a PL/SQL procedure named WF_STANDARD.WAITFORFLOW.

Activity Attributes

Use the "Continuation Flow" activity attribute to specify whether this activity is waiting for a corresponding "Master" or "Detail" process to complete. Use the "Continuation Activity" activity attribute to specify the label of the activity node that must complete in the corresponding process before the current process continues. The default value for the "Continuation Activity" activity attribute is CONTINUEFLOW. You can specify the value of the activity attribute in the Process window. See: To Define Activity Attribute Values.

Continue Flow

Use this activity to mark the position in the corresponding detail or master process where, upon completion, you want the halted process to continue. This activity calls a PL/SQL procedure named WF_STANDARD.CONTINUEFLOW.

Activity Attributes

Use the "Waiting Flow" activity attribute to specify whether the halted process that is waiting for this activity to complete is a "Master" or "Detail" flow. Use the "Waiting Activity" activity attribute to specify the label of the activity node in the halted process that is waiting for this activity to complete. You can specify the value of the activity attribute in the Process window. See: To Define Activity Attribute Values.

Example

The following figures show an example of how these coordination activities can be used. In the master process below, the Start Detail Flows activity initiates several detail processes. The master process then completes Activity 1 before it pauses at the Wait For Flow activity. Wait For Flow is defined to wait for all its detail processes to complete a Continue Flow activity before allowing the master process to transition to Activity 2. An example of one of the detail processes below shows that when the detail process begins, it completes Activity A. When it reaches the Continue Flow activity, it signals to the Workflow Engine that the master process can now continue from the Wait For Flow activity. The detail process itself then transitions to Activity B.

Master Process

Detail Process

Note: You can include a Wait for Flow activity in a master process without using a Continue Flow activity in one or more of its corresponding detail process. The Workflow Engine simply continues the master process as soon as all the other detail processes that do contain a Continue Flow activity complete the Continue Flow activity.

If it does not matter when any of the detail processes complete before a master process continues (or when a master process completes before all the detail processes continue), then you simply omit both of the coordination activities from your master/detail processes.

Attention: If you include a Continue Flow activity in a process, you must also include a Wait for Flow activity in its corresponding master or detail process as defined by the activity attributes in the Continue Flow activity.


         Previous  Next          Contents  Index  Glossary  Library