Previous  Next          Contents  Index  Glossary  Library

StartProcess

Syntax

procedure StartProcess

    (itemtype in varchar2,
     itemkey in varchar2);

Description

Begins execution of the specified process. The engine locates the activity marked as START and then executes it. CreateProcess( ) must first be called to define the itemtype and itemkey before calling StartProcess( ).

Arguments (input)

itemtypeA valid item type.
itemkey A string derived 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. See: CreateProcess.

Caution: Although you can make a call to CreateProcess( ) and StartProcess( ) from a trigger to initiate a workflow process, you should avoid doing so in certain circumstances. For example, if a database entity has headers, lines and details, and you initiate a workflow process from an AFTER INSERT trigger at the header-level of that entity, your workflow process may fail because some subsequent activity in the process may require information from the entity's lines or details level that is not yet populated.

Caution: The Workflow Engine always issues a savepoint before executing each activity so that it can rollback to the previous activity in case an error occurs. Because of this feature, you should avoid initiating a workflow process from a database trigger because savepoints and rollbacks are not allowed in a database trigger.

If you must initiate a workflow process from a database trigger, you must immediately defer the initial start activities to a background engine, so that they are no longer executing from a database trigger. To accomplish this:

or

				begin
					WF_ENGINE.threshold := -1;
					WF_ENGINE.CreateProcess(...);
					WF_ENGINE.StartProcess(...);
				end


         Previous  Next          Contents  Index  Glossary  Library