The Block activity lets you pause a process until some external program or manual step completes and makes a call to the CompleteActivity Workflow Engine API. Use the Block activity to delay a process until some condition is met, such as the completion of a concurrent program.
Make sure your program issues a CompleteActivity call when it completes to resume the process at the Block activity.
CompleteActivity() does not execute the activity with which it is called; it simply marks the activity as complete. StartProcess() does execute the ‘Start’ activities with which it starts a process.
Call the CompleteActivity once the external activity get complted.
The following code could be used for it.
Note : Remember to Commit after the call to CompleteActivity.
‘TEST:BLOCK’ is the label of the block
itemtype A valid item type
itemkey A string generated from the application object’s primary key. The string uniquely identifies the item within an item type. The item type and key together identify the process
activity The name of the activity node that is completed. Provide the activity node’s label name. If the activity node label name does not uniquely identify the subprocess you can precede the label name with the internal name of its parent process. For example, <parent_process_internal_name>:<label_name>. This activity node must be marked as a ‘Start’ activity.
result_code An optional activity completion result. Possible values are determined by the process activity’s Result Type, or one of the engine standard results.
/*Complete the 'LEGAL REVIEW' activity with status 'APPROVED'. The item must already exist.*/
wf_engine.CompleteActivity('ORDER', '1003', 'LEGAL_REVIEW', 'APPROVED');
/*Complete the BLOCK activity which is used in multiple subprocesses in parallel splits.*/
Note : Do not try to re run the pl/sql block for the smae workflow item key. It might raise the following error.
ORA-20002: 3133: Activity instance ‘TEST:BLOCK’ is not a notified activity for item ‘TEST/8’.
ORA-06512: at “APPS.WF_ENGINE”, line 5702
ORA-06512: at line 2