Oracle Workflow Basics



Pre-requisites:

Install Oracle Workflow Builder


Oracle Application Workflow Components

Number          :- The attribute value is a number.
Date                :- The attribute value is a date.
Lookup           :- The attribute value is one of the lookup code values in a specified lookup type.
Form               :- The attribute value is an Oracle Applications internal form function name and its                                   parameters.
URL                 :- The attribute value is a Universal Resource Locator (URL) to a network location.
Document        :- The attribute value is an attached document. You can specify the following types of
                             documents in the default value field.
                          * Can be used for Database Large Objects or OAF Regions
Role                :- The attribute value is the internal name of a role.
Attribute         :- The attribute value is the internal name of another existing item type attribute that
                           you want to maintain references to in a process.
Event             :-  The attribute value is a Business Event System event message in the standard
                          WF_EVENT_T structure.

Reference : https://docs.oracle.com

Steps :

Quick Start Workflow.

Go to file menu and quick start workflow creation, you can also take any existing custom workflow as template and then create a copy


Create new process , give suitable naming




Add Function to set any attributes or write any business logic


Add any message that can further be referred in Workflow Notification, you can also add any message level attribute for dynamic values in message
Create Notification and Add Message to it

Add any constant Approver email or mention attribute that you can set dynamically in workflow package


Add any workflow attribute you want use in notification 


Final diagram will look something like this
                          
Come back to main screen again and save workflow in database , also good to take backup on PC as .wft file




Create Workflow Package 


CREATE OR REPLACE PACKAGE BODY APPS.XXWF_PKG
AS
 
 
      PROCEDURE SUMBIT_WORKFLOW(
                                         REQUESTORUSERNAME IN VARCHAR2,
                                         PROCESSOWNER      IN VARCHAR2
                               )
     IS          
   
     V_FIND_RATE        NUMBER;
     V_TRANSACTION_ID   NUMBER;
     V_ITEMTYPE         VARCHAR2(30) := 'XXTEST'; -- Name with which workflow is saved
     V_ITEMKEY          VARCHAR2(30) ;
     V_PROCESS          VARCHAR2(30) := 'TEST_PROCESS';
     V_ITEMUSERKEY      VARCHAR2(80);
     V_ACTION_HIST_URL  VARCHAR2(180);
   
     BEGIN
   
        select xxseq.nextval into V_ITEMKEY from dual;
   
   
         WF_ENGINE.CREATEPROCESS(V_ITEMTYPE  ,V_ITEMKEY,V_PROCESS);
       
       
         WF_ENGINE.STARTPROCESS(V_ITEMTYPE  ,V_ITEMKEY);
       
         dbms_output.put_line('Success');
       
     
         commit;

   
       
     exception
            when others then
         
            dbms_output.put_line('Error in Execution');
            Wf_Core.context ('XXTEST','TEST_PROCESS','SYSADMIN','SYSADMIN');
            RAISE;

                 
     end APPS.XXWF_PKG;    

Launch workflow and monitor from Application   

Navigate to System  Administrator > Workflow > Administer Workflow > Status Monitor





Comments