Skip Headers

Oracle Workflow Developer's Guide
Release 2.6.3.5

Part Number B12161-02
Previous Next       Contents Index Glossary
         Previous  Next          Contents  Index  Glossary

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 every detail process has reached a certain point in its flow or vice versa.

When you spawn a detail process from a master process in Oracle Workflow, you are in effect creating a separate process with its own unique item type and item key. You define the master/detail relationship between the two processes by making a call to the Workflow Engine SetItemParent API after you call the CreateProcess API and before you call the StartProcess API when you create the detail process. See: SetItemParent, Oracle Workflow API Reference.

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.

You can use multiple Wait for Flow activities in the same workflow process. For example, if a master process launches two different sets of detail processes at different stages, the master process should include a separate Wait for Flow activity node for each set of detail processes. In this case, when you call the WF_ENGINE.SetItemParent API to associate a detail process with the master process, you must specify the parent context as the activity label name for the Wait for Flow activity node that corresponds to this detail process.

If the parent process contains only one Wait for Flow activity, however, you can leave the parent context parameter null when calling WF_ENGINE.SetItemParent.

Activity Attributes

The Wait for Flow activity contains two activity attributes:

Continue Flow Activity

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.

When a Continue Flow activity is executed, the WF_STANDARD.CONTINUEFLOW procedure checks whether the corresponding Wait for Flow activity is associated with any other processes that have not yet completed their Continue Flow activities. If so, the waiting process keeps waiting for those other processes. If the Wait for Flow activity is not waiting for any other processes, then the WF_STANDARD.CONTINUEFLOW procedure completes the Wait for Flow activity so that the process that was waiting now continues to the next activity.

Activity Attributes

The Continue Flow activity contains two activity attributes:

Example

The following figures show an example of how these coordination activities can be used. In the master process example, after the process begins with the Start activity, 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 and finally end. An example of one of the detail processes below shows that after the detail process begins with the Start activity, 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 and finally ends.

Master Process image described in text

Detail Process image described in text

Note: You can include a Wait for Flow activity in a master process without including a Continue Flow activity in one or more of its corresponding detail processes. However, in this case you must ensure that all detail processes without a Continue Flow activity are entirely completed before the Workflow Engine attempts to continue the master process based on the coordination activities that you do include. That is, at least one of the following must occur after the detail processes without a Continue Flow activity are completed:

Otherwise, the Workflow Engine cannot properly coordinate the continuation of the master process.

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



Oracle Logo
Copyright © 2003, 2004, Oracle. All rights reserved.