Top Banner
Workflow Training INDEX 1. Overview of workflow 2. Workflow Process Components Item Types Lookup Types Messages/Notifications Attributes 3. Workflow process Diagram Process Window Transitions Start and end activities Initiating a process 4. Procedures and Functions 5. Application Navigation 6. Access/protection/ customisation 7. WFLOAD command
45
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Workflow Training

Workflow Training

INDEX

1. Overview of workflow2. Workflow Process Components

Item Types Lookup Types Messages/Notifications Attributes

3. Workflow process Diagram Process Window Transitions Start and end activities Initiating a process

4. Procedures and Functions 5. Application Navigation6. Access/protection/customisation7. WFLOAD command

Page 2: Workflow Training

Overview of workflow

Why we need workflow?

Business process today involves getting many types of information to multiple people as per business rules that are constantly changing.

Workflow is just a mean to automate business process as per business rules.

Workflow Process Components

Depending on a workflow you create, you need to define some or all of the following types of components to make a process:

Item Types Lookup Types Messages Attributes

Item Types Suppose we have some processes related to Purchase Order like PO approval, notify approver etc.We will include these processes under the item type PO as they are helping in managing Purchase Order.

Following figures depicts how to create new item type:

Open workflow builder, click on file menu then new to create new data store.

Page 3: Workflow Training

Data store is nothing but a file that stores your WF definition. Save it with a name you desire.

Right Click on data store created and select new item type

Item Type window pops-up, provide information for following:Internal Name: XXXWFDisplay Name: Training WorkflowDescription: Training WorkflowPersistence: TemporaryNumber of days: 0

Page 4: Workflow Training

Now item type is created. Click on expand beneath item type in navigation tree to see components attached with item type.

Attributes

Attributes are like a global variable which are required to store information necessary to complete wf process.For example, PO Number, PO description, send to role etc. which will be required by an activity in a process like PO Validation.

Following figures depict how to create attributes:

Page 5: Workflow Training

Right click on attributes node beneath item type Training Workflow.Attribute definition window pops up; provide information for the following fields:Internal Name: PO_IDDisplay Name: PO IDDescription: Unique identifierType : text

Like this you can create as many attributes as needed.

Page 6: Workflow Training

Look Types It is just a static list of values which can be referenced by activities, notifications etc.

Messages The messages branch lists all the available WF messages for the current item type. A message is what a notification activity sends to role or a user. A message can prompt a user for an action to take that determines what the next activity in a process should be.

First you need to define message by right clicking on the messages branch in the navigation tree. Provide the following information:Internal Name: PO_INFODisplay Name: PO InformationDescription: Information related to POPriority: normal/high/low

Click on Body tab to define body of a message.

Page 7: Workflow Training

Suppose we want to give the description of the PO also along with the message, then copy the attribute with ‘&’ as a prefix . To have PO description in a message simply drag an item attributes PO_DESCRIPTION number and drop under current message.

Workflow process Diagram

To create a process diagram, open a process window by double click or right click and select new process. It prompts for the following information:

Internal Name: PO_APPROVAL_PROCESSDisplay Name: PO Approval ProcessResult type : NoneRunnable : checked

Page 8: Workflow Training

After providing values for the above mentioned fields, double click on the process you have just created. A process window opens.

This is a workspace where you will define business process.To add standard activities provided by Oracle workflow copy an item type standard to your current item type.After doing so, you navigator tree will look as depict below :

Directory Service and Standard types will be added automatically.

Page 9: Workflow Training

Start and end activitiesEvery WF process starts with the start activity and ends with the end activity. To add start and end activities you need to simply drag start and end function from a standard item type like depict below:

Select Start function under function branch in the standard item type and drag it to your process window.After doing so, process window look like as shown below:

Page 10: Workflow Training

Same needs to be done for adding end activity.

Transitions It just represents a flow between activities. For example, we have an activity in a process which selects an approver and depending on the result it decides whether to end the process or send a notification to approver for his approval.

Page 11: Workflow Training

We have already added the start activity, now right on the process diagram and select new function and provide the following in the pop up window:Item Type: RequisitiontestInternal Name: SELECTAPPROVERDisplay Name: SELECT APPROVERDescription: Select the appropriate approver from the employee approval hierarchyIcon: FNDUSER.ICOFunction Name: WF_REQDEMO.SELECTAPPROVERFunction Type: PL/SQLResult Type: Boolean

After providing values in the abovementioned fields, process window look like this :

Page 12: Workflow Training

To represent a flow fro, the start activity to select approver, right click on start activity and drag till select approver activity. Your process window will look like as shown below:

Page 13: Workflow Training

Now depending on the result of this activity, we will decide what will be the next activity should be. If the PO is being validated then we can decide what will be the next step, we can set the role whosoever is validating the PO.If the PO is being validated then the status of the flag will be changed to VALIDATED and notification will be send to the user.

This is been depict in the following figures:

Page 14: Workflow Training

Right click on process window and select new function. It pops up a window requiring following information:Item Type: Training WorkflowInternal Name: SET_ROLEDisplay Name: Set RoleIcon: LOCK_KEY.ICOFunction Name: xxx_po_wf_training_pkg.set_wf_approve_roleFunction Type: PL/SQLResult Type: None

Page 15: Workflow Training
Page 16: Workflow Training

In same way, add all the functions needed to complete the workflow.

Page 17: Workflow Training

Add notification activity and provide following information in the fields of the pop up window:Item Type: Training WorkflowInternal Name: PO NOTIF INFODisplay Name: PO NOTIF INFOIcon: NOTIFY.ICOMessage: PO Information

Page 18: Workflow Training
Page 19: Workflow Training

Now right click on validate PO and drag till end activity, it will prompt for a result Yes/. Same needs to be done for other functions as well. After completing all the validations, it will look like as shown below:

Initiating a process To initiate a process, first we need to call the set of APIs for initiating a WF. For reference, code is given below:

PROCEDURE start_training_wf(p_po_id IN INTEGER) IS l_itemtype VARCHAR2(30) := 'XXXWF'; l_itemkey VARCHAR2(300) := 'TRAINING-' || p_po_id; CURSOR c_get IS SELECT * FROM xxxx_po_headers

Page 20: Workflow Training

WHERE po_id = p_po_id; p_get c_get%ROWTYPE; BEGIN OPEN c_get; FETCH c_get INTO p_get; CLOSE c_get;

wf_engine.createprocess(l_itemtype, l_itemkey, 'TRAINING_WORKFLOW); wf_engine.setitemuserkey(itemtype => l_itemtype ,itemkey => l_itemkey ,userkey => 'USERKEY: ' || l_itemkey); wf_engine.setitemowner(itemtype => l_itemtype ,itemkey => l_itemkey ,owner => 'SYSADMIN'); wf_engine.setitemattrnumber(itemtype => l_itemtype ,itemkey => l_itemkey ,aname => 'PO_ID' ,avalue => p_po_id);

wf_engine.setitemattrtext(itemtype => l_itemtype ,itemkey => l_itemkey ,aname => 'SEND_TO_EMAIL' ,avalue => p_get.send_email_to); wf_engine.setitemattrtext(itemtype => l_itemtype ,itemkey => l_itemkey ,aname => 'PO_DESCRIPTION' ,avalue => p_get.po_description); wf_engine.startprocess(l_itemtype, l_itemkey); END start_training_wf;

Procedures and Functions Oracle workflow lets you integrate your own custom PL/SQL procedures and functions in your workflow procedures.

Page 21: Workflow Training

All PL/SQL stored procedures that are called by function or notification activities in an oracle workflow should follow standard API format.

procedure <procedure name> (itemtype in varchar2, itemkey in varchar2, actid in number, funcmode in varchar2, resultout out varchar2) is

Itemtype -> It is an internal name of your workflow process.

Itemkey -> It is a unique key generated for each instance of your WF process.

Actid -> It is an id number of the activity fro, which this procedure is called.

Funcmode -> It is an execution mode of an activity. If the activity is function then funcmode will be run or cancel.

Resultout -> If a result type is specified in the Activities properties page for the activity in the Oracle Workflow Builder, this parameter represents theexpected result that is returned when the procedure completes.

resultout := ’COMPLETE:<result>’;resultout := ’COMPLETE’;resultout := wf_engine.eng_timedout;resultout := WAITING

Application Navigation:-

Page 22: Workflow Training

Go to Workflow Administrator Responsibility - Status Monitor Open the form.Enter the workflow type Training Workflow in our case. Then press GO button.

All the processes which we run will be displayed with the unique item key as shown in the below mentioned picture.

Page 23: Workflow Training

Select one of the process and click on Active History. The details will be seen which we have filled in the API at the time of insertion in the table. As you can see the performer in the below attached screenshot, the mail will go the mentioned ID.

Page 24: Workflow Training

Now go back and click on the status diagram, the latest workflow process will be displayed as.

Click on each function to know the definition, Usage, Status and Notification.

Page 25: Workflow Training

Go Back and click on Workflow Details:-You will able to see the Workflow Attributes and Workflow Definition as shown below.

Page 26: Workflow Training

Pls Note:-

Mailer Notifications should be ON, incase you want to receive mails , in above case the mailer notification is DOWN, hence not able to receive mails.

Please follow the below navigation to know whether mailer is ON/OFF.

Go to Workflow Administrator Web Applications -Workflow Manager.Check the Notification mailer as shown below.

Page 27: Workflow Training

Access/protection/customisation

Oracle protects some key business critical activities from being modified using this concept.We can preserve customizations using this concept.

The access levels are defined as follows:

0 - 9 Reserved for Oracle Workflow.10 - 19 Reserved for Oracle Application Object Library20 - 99 Reserved for Oracle E-Business Suite.100-999 Reserved for customer organizations1000 Public

So Oracle Corp. developer will always work at access level of 20.He created an activity and doesn’t want customer to change as it is critical activity of the flow.

Page 28: Workflow Training

First he set access level at 20.

Properties of validate po activity

Page 29: Workflow Training

To prevent from modification he will lock at this level.

Now at customer site, developer will work at access 100.

Page 30: Workflow Training

Properties of po validity activity.

Page 31: Workflow Training

Access 100 is not between 0 to 20.so he will not be able to modify this activity.

Now Oracle Corp. developer works at an access level 20 and change the lock property so a developer at customer site can customize the activity.

Page 32: Workflow Training

Now protection is 1000 means it is public.

At customer site, developer can modify this activity if he works at an aceess level between 0-1000.

Page 33: Workflow Training

Now developer at customer site customize the activity and want to preserve customization been done.

Page 34: Workflow Training

Now lock at this level.

Now, Oracle corp. developer can’t modify this activity since it is been locked at 100. and 20 is not between 100-100 or 100-1000.Hence oracle patch can’t modify this activity.

Page 35: Workflow Training
Page 36: Workflow Training

However by checking allow modifications of customized objects .They can customize these activities as well.

Page 37: Workflow Training
Page 38: Workflow Training

WFLOAD COMMAND

Oracle delivers workflows via patches which use WFLOAD command to load their definitions to the database.

Syntax:

WFLOAD apps/apps_pwd 0 Y < UPLOAD_MODE> WFDEMO.wft

Different upload modes are:

UPGRADE - Honours both protection and customization levels of dataUPLOAD - Honours only protection levels of data

FORCE - Force upload regardless of protection and customization levels.

To download, issue a command

WFLOAD apps/apps_pwd 0 Y DOWNLOAD WFDEMO.wft XXXXPTR

Page 39: Workflow Training

THANK YOU!!!!

Prepared by:-

Anoop Jain