in effect creating a separate process with its own unique item type and item key. Oracle Workflow engine has provided an API “SetItemParent API” to define a master/detail relationship between the two processess. This API should be called after we called the CreateProcess API for the DETAIL process, BUT before a call has made to Startprocess API for detail process.
In the workflow we have two activities (one will be define in master and other in detail) to coordinate flow between master and detail process. As explained below,
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.
These activities are
- Wait for Flow Activity
- Continue Flow Activity
activity in the other process(es).
Wait for Flow Activity – This activity can be in master /Detail and will pause the flow until the corresponding detail/master process completes for this activity. pl/sql procedure for Wait for Flow activity is WF_STANDARD.WAITFORFLOW.
Based on our business requirements we can have any number of Wait for Flow activities in the same workflow process.One very Important thing that should be keep in consideration when we design Mater /Detail relationship, If we have ONE master and ONE detail process, but MASTER process wait for the DETAIL process at multiple stages of its (master) flow, in that case master process should have separate Wait for Flow activity node for each time it wait for detail process. Similarly DETAIL process should have separate Continue Flow Activity corresponding to each Wait for Flow activity in Master process.
Wait for Flow activity contains 2 activity level attributes
"Master" or "Detail" process to complete.
the corresponding process before the current process continues. The default value isCONTINUEFLOW.
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.
The Continue Flow activity contains two activity attributes:
- Waiting Flow - specify whether the halted process that is waiting for this activity to
complete is a "Master" or "Detail" flow.
- Waiting Activity - specify the label of the activity node in the halted process that
is waiting for this activity to complete.
Master Workflow (Calling Detail Flow with "Waiting Activity Label = Name of Child Activity waiting for this master to complete)
Master Workflow (received call from Detail activity with Continutation Activity Label = Name of Child Activity, that this Master is waiting in Order to progress further.)
l_ckey varchar2(10) :='615';
l_pkey varchar2(10) :=l_key; --(can be any value)
l_ptype varchar2(10) :='SR_TYPE'; -- Parent type
l_ctype varchar2(10) :=’SR_INTER’; -- Child type
l_pprocess varchar2(100) := 'SR_PROCESS'; -- Parent process
l_cprocess varchar2(100) := 'SR_INT_PROCESS'; -- Child process
wf_engine.createprocess(l_ctype,l_pkey, , l_cprocess,NULL,NULL);