Anda di halaman 1dari 16

Oracle Workflow

WORKFLOW

Oracle Workflow

PL/SQL APIs
(Unit 5)

Oracle Workflow Objectives


Various PL/SQL APIs exist for the working of Oracle Workflow. We discuss some of these.
WF_ENGINE WF_CORE WF_PURGE WF_MONITOR WF_QUEUE WF_NOTIFICATIONS

Oracle Workflow WF_ENGINE


The state of a workflow item is defined by the various states of all activities that are part of the process for that item. The engine changes activity states in response to an API call to update the activity family of calls. The Workflow Engine APIs can be called by an application program or a workflow function in the runtime phase to communicate with the engine and to change the status of each of the activities. These APIs are defined in a PL/SQL package called WF_ENGINE.

Oracle Workflow WF_ENGINE Procedures (1 of 3)


CreateProcess SetItemUserKey GetItemUserKey GetActivityLabel SetItemOwner StartProcess LaunchProcess

Oracle Workflow WF_ENGINE Procedures (2 of 3)


SuspendProcess ResumeProcess AbortProcess CreateForkProcess StartForkProcess Background AddItemAttr SetItemAttribute GetItemTypes GetItemAttribute GetItemAttrInfo

Oracle Workflow WF_ENGINE Procedures (3 of 3)


GetActivityAttrInfo GetActivityAttribute BeginActivity CompleteActivity AssignActivity HandleError SetItemParent ItemStatus

Oracle Workflow WF_CORE


PL/SQL procedures called by function activities can use a set of core Oracle Workflow APIs to raise and catch errors. When a PL/SQL procedure called by a function activity either raises an unhandled exception, or returns a result beginning with ERROR:, the Workflow Engine sets the function activitys status to ERROR and sets the columns ERROR_NAME, ERROR_MESSAGE, and ERROR_STACK in the table WF_ITEM_ACTIVITY_STATUSES to reflect the error. The columns ERROR_NAME and ERROR_MESSAGE get set to either the values returned by a call to WF_CORE.RAISE( ), or to the SQL error name and message if no call to RAISE( ) is found. The column ERROR_STACK gets set to the contents set by a call to WF_CORE.CONTEXT( ), regardless of the error source.

Oracle Workflow WF_CORE Procedures


CLEAR GET_ERROR TOKEN RAISE CONTEXT TRANSLATE

Oracle Workflow WF_PURGE


WF_PURGE can be used to purge obsolete runtime data for completed items and processes, and to purge information for obsolete activity versions that are no longer in use. One may want to periodically purge this obsolete data from your system to increase performance.

10

Oracle Workflow WF_PURGE Procedures


Items Activities Notifications Total TotalPERM

11

Oracle Workflow WF_MONITOR


The following APIs to generate a complete URL to access the various pages of the Workflow Monitor. The APIs are defined in the PL/SQL package called WF_MONITOR.
GetDiagramURL: page 8 102 GetEnvelopeURL: page 8 104 GetAdvancedEnvelopeURL: page 8 106

12

Oracle Workflow WF_QUEUE


Oracle Workflow queue APIs can be called by an application program or a workflow function in the runtime phase to handle workflow Advanced Queues processing. All Oracle Workflow queue APIs are defined in a PL/SQL package called WF_QUEUE. You must execute these queue APIs from the same Oracle Workflow account since the APIs are account dependent.

13

Oracle Workflow WF_QUEUE Procedures


EnqueueInbound DequeueOutbound DequeueEventDetail PurgeEvent PurgeItemtype ProcessInboundQueue GetMessageHandle Deferred_queue Inbound_queue Outbound_queue

14

Oracle Workflow WF_NOTIFICATIONS


A notification agent needs certain PL/SQL APIs to manage notifications for a notification activity. The APIs are stored in the PL./SQL package called WF_NOTIFICATION.

15

Oracle Workflow Re- Cap


We discussed the following packaged procedures which ensure the proper functionality of Oracle Workflow.
WF_ENGINE WF_CORE WF_PURGE WF_MONITOR WF_QUEUE WF_NOTIFICATIONS

16

Anda mungkin juga menyukai