Oracle Applications Capability

India Delivery Center

Oracle Workflow Builder & API
By Gopinath Ganesan


• Workflow Builder • Workflow API’s

Workflow Builder
Oracle Workflow builder is a graphical tool for creating , viewing and modifying the workflow process definitions.

Workflow Navigator - Components

• Attributes
List the attributes for the current item type


• Processes
List the process activities or workflow process definitions.

• Functions
List the function activities of the item type . A function activity represents the PL/SQL stored procedure that the workflow engine executes automatically.

• Notifications
List the notification activities of the current item type . A notification activity sends a message to user / role.

• Messages
List the messages associated with the notification. A message can have message attributes associated with it.

Workflow Navigator - Components

• Events
List the event activities of the current item type .An event activity represents a business events that the process receives ,raises or sends.

• Look up types
List the look up types of the current item type .A look up type has one or more values called look up codes associated with it which can be referenced by a message / notification / function.

Sample Workflow Navigator

Creating a Workflow Process
• Drag and Drop Function, Notification, and Process Nodes into the Process Window • Create Transitions between the Nodes by Right Clicking on the First Node and Dragging the Mouse over the Second Node and Releasing the Mouse • Define Performers for all Notifications • Define the Start/End Nodes • Customize any Functions with Values • Save Workflow to Database to Run

Monitor Workflow Process

Find Process Level

Workflow API’s

Oracle Workflow supplies a set of built in PL/SQL procedures and functions which can be used to automate the workflow process. They are grouped with in the following packages:

Workflow API’s – Automating Workflow Engine Process

Workflow engine performs the following services for the client applications :
• Manages the state of all activities for an item and also ensures that which activity to transition when ever the previous activity has been completed. Automatically executes the function activities and sends the corresponding notifications. Maintains the history of all activity status. Detects error conditions and executes the error process.

• •

Workflow Custom API’s

Workflow custom API’s are the user defined PL/SQL procedures or functions which automates the workflow process. Mandatory parameters for custom PL/SQL API’s : Item Type  Workflow item type name. Item Key  Unique identifier for the workflow process. Process name  Process diagram name . Actions which can be performed through custom API’s : - Start the workflow process from DB without launching workflow manager. - Manipulate the table data in DB from the workflow process using custom functions i.e. Insert , Delete , Update table data. - Initiate an workflow process by giving the parameters from the Client GUI applications like Oracle Forms, JSP Page etc.

Sample Workflow Custom API
Sample API to initiate the particular workflow process from DB without launching workflow manager web interface.

create or replace procedure PR_INITIATE_WF_PROCESS ( par_itemkey in varchar2, ) as begin wf_engine.createprocess (itemType =>'VACAPPROVAL',itemkey => par_itemkey,process =>'VACATION'); wf_engine.startprocess (itemType =>'VACAPPROVAL',itemkey => par_itemkey); end PR_INITIATE_WF_PROCESS;

Sample Workflow Custom API

create or replace procedure PR_INSERT_DATA ( itemtype in varchar2, itemkey in varchar2, actid in number, funcmode in varchar2, resultout out varchar2 ) is begin if (funcmode = 'RUN') then INSERT INTO VAC_INSERT_17 ( REQUESTOR, APPROVER, FROM_DATE, TO_DATE ) VALUES ( 'BLEWIS', 'KWALKER', '15-JUN-04', '16-JUN-04' ); end if; if (funcmode ='CANCEL') then resultout :='COMPLETE'; return; end if; if (funcmode ='TIMEOUT') then resultout :='COMPLETE'; return; end if; exception when others then wf_core.context('WF_REQDEMO','VerifyAuthority',itemtype,itemkey,actid,funcmode); raise; end PR_INSERT_DATA;

How to Debug Workflow ?
• Open the WF from DB (OWF_MGR) to Local Machine • Start Icon in process diagram should be of property “ Start Activity “ • End Icon in process diagram should be of property End ( Approve / Reject ). • Performer  FWD_TO_USER_NAME ( Only for notification and not for function) • Result type of notification message  Approval. • A Notification should contain a message and same message can be mapped with multiple notification. • Function in WF process should contain a < PKG. PROC > format. • For FYI notification type should be “ Send “.

Information Source

Oracle Metalink

Sign up to vote on this title
UsefulNot useful