Workflow tutorial

Overview:

This workflow tutorial will illustrate how to create or define a new workflow from scratch including attributes, notifications, messages, roles or users, functions, processes and last but not the least, how to launch a workflow from PL/SQL. The workflow concepts are better explained using an example.

Business Requirement:

When an item is created in inventory, workflow needs to be launched and it should collect the details of the item created and sends a notification to group of users along with the details and link to master item form.

Process flow:

When an item is created it will create/insert a record in MTL_SYSTEM_ITEMS_B so create a database trigger on the table and launch workflow from that trigger. All you need to do is create the workflow, create the trigger, pl/sql package, roles and finally create an item in inventory.


1) Open WFSTD and save as new workflow:

alt

Navigation: File >> Open

alt

Click Browse then navigate to Workflow installation directory

Navigation: Workflow Installation Directory WFDATAUSWFSTD

Now Click File > Save as, Enter “ErpSchools Demo” and click OK

Right click on WFSTD and select New Item type

alt

Enter the fields as shown in below image

alt

Now you will see ErpSchools Demo icon in the Navigator

alt

Expand the node to see attributes, processes, notifications, functions, Events, Messages and lookup types.

alt


2) Create Process

Double click on Process to open up the properties window as shown below

alt

Enter the fields as shown in below image

alt

Click OK

alt

Double click ErpSchools Process Icon to open process window where we can draw our workflow diagram.

alt

Right click on process window and then click on New Function.

alt

Properties window will open as shown below

alt

Change/Enter the fields as shown in below image

Change Item Type to Standard. This is important as we are using START and END functions which came from WFSTD (Standard item type).

Select Internal Name as Start

Remaining fields will be populated automatically.

Go to Node tab and select “Start” from the drop down. This is mandatory and can’t be ignored.

alt

Click Apply then OK

alt

Again Right click on white space and click New Function

alt

Change the properties as below

Item Type: Standard

Internal Name: END

alt

Go to Node tab and select “End” from the drop down. This is mandatory and can’t be ignored.

Click Apply and then OK

alt

We will come back to this process window later after we have all components / activities ready to link. for now just close process window and go to navigator


3) Create Workflow Function:

Right click on white space  in the process window and then click New Function. Alternatively you can select Functions in Navigator and right click to get “New Function” option

alt

Enter the fields as shown in below image

alt

Click Apply and then OK

alt

We will join these activities later after we have our notification ready.


4) Create Workflow Attributes:

Navigation: Window menu > Navigator

alt

Right click on Attributes and click New Attribute

alt

Enter the fields as shown in below image

alt

Click Apply and then OK

Create one more attribute

Right click on Attributes and click New Attribute

alt

Enter the fields as shown in below image

alt

Click Apply and then OK.

Here INVIDITM form belongs to “Master Item” for from inventory module.

Now we have two attributes ready to use.


5) Create Workflow Messages:

click on Message and click New

alt

Properties window will pop up as show below

alt

Enter the fields

Internal Name: ERP_SEND_ITEM_DET_MSG

Display Name: Send Item Details Message

Description: Send Item Details Message

alt

Go to Body Tab and enter as shown below

alt

Click Apply and then OK

Navigation: Window Menu > Navigator

Select Item Form Link Attribute

alt

Drag and drop both attributes to “Send Item Details Message”. If you miss this step you will not be able to see the attribute values with in email.


6) Create Workflow Notifications:

Right click on white space in process window and then click New Notification

alt

Enter fields as shown in the below image

Message: Sned Item Details Message

alt

Click Apply and then OK


7) Create Roles and assign it to notification: 

Adhoc roles can be created through PL/SQL API’s from database or they can be created from Applications using User Management Responsibility. If you use PL/SQL to create roles make sure you give all user names and role names in UPPER case to avoid some problems

Alternatively you can use USERNAME directly with in the notification.

If you wish to create User Roles manually then follow the below articles

User Role Creation through API: WF_DIRECTORY API

User Role Creation from "User Management" Responsibility: Role Creation

Using Adhoc roles in workflow notifications:

Navigation: File > Load Roles from Database

Select roles you want to use and then click OK.

Open the notification properties and then navigate to node tab, select performer as the role you just created and loaded from database.

8)Link all activities with in process

Open Process window and join all the activities we created so far. To join one activity to other you need to first select the source activity , right click and drag a line to destination activity.

041711_1245_Workflowtut38

9)Save workflow to database

There are three different methods to upload a workflow into database. The simple one is from workflow builder tool itself.

Go to File > Save as and choose the option “database”.

Provide your apps user login credentials and click OK.

To understand how to save workflow from a file (.wft) to database and vice versa you can read the below article.

Workflow Migration

 

10)Launching workflow from PL/SQL:

 Make sure to run "Workflow background process" after item is created. 
Workflow will get into defered status initially and after workflow background process program is completed it should be in running mode.

Compile the PL/SQL code in database.
First create a database trigger as below to call a PL/SQL procedure from which you kick off the workflow.

–Create Database Trigger


–Create PL/SQL Package to kickoff workflow


 
Create Inventory Item
Go to Inventory module and create inventory item from master org form.


Run “Workflow Background Process” concurrent program
 
Go to System administrator responsibility and launch concurrent program “Workflow background process” and choose Yes to the parameter process deferred.

34 Comments

  1. thirupathi
    Jul 22, 2011 @ 16:33:40

    this is vary use full material

    thank u

    Reply

  2. shantanu jain
    Aug 02, 2011 @ 07:27:12

    this is the best website for study ………….

    Reply

    • Core Tamil
      Nov 25, 2011 @ 16:47:00

      Ammmaa Apdiya..

      Reply

  3. kartheeka
    Aug 10, 2011 @ 13:59:59

    good for beginners

    Reply

  4. abhi karthi
    Aug 10, 2011 @ 14:01:14

    very good material to easy learn

    Reply

  5. sudhakar
    Aug 10, 2011 @ 16:43:56

    Excellent for beginners

    Reply

  6. Aparna
    Aug 18, 2011 @ 14:03:51

    Can you please post such screenshots for discoverer tutorial for beginner like where to write the query and all

    Reply

  7. javed khan
    Aug 23, 2011 @ 17:06:23

    Can you please post such screenshots for discoverer plus tutorial for beginner like how to edit the query and how to create new worksheet and how to define the LOV for the parameter like wise……All related informatin.

    Reply

  8. sreenivas
    Sep 29, 2011 @ 11:35:40

    Its good but but you missed the connectivity between start, function, notification and end.
    Its more usefull when yo provide such sreen shots for who ever wants to do sample workflow development.
    and its more usefull when you provide issues where you mostly will struck up while developing workflow.

    you site is very usefull for techical consultant.Keep it up our job my friend.

    Thanks
    Sreenivas

    Reply

  9. RAKESH KUMAR KAR
    Oct 13, 2011 @ 15:01:48

    this is vary use full material

    thank u. It help me a lot.

    Reply

  10. MILAN
    Oct 14, 2011 @ 14:22:21

    plz give me me a solution— When an item is created it will create/insert a record in MTL_SYSTEM_ITEMS_B ,the notification goes to the creator.
    Workflow will launched from concuurent program not from the database trigger.

    will u plz help me out?

    Reply

  11. Waqas Hassan
    Oct 23, 2011 @ 15:52:04

    Hi,

    I want to download “Oracle Workflow Builder”. How can i download this software?

    Regards.

    Reply

  12. Mahendar
    Dec 08, 2011 @ 15:32:12

    Use ful…

    but need brief intruduction about the used proces,,,,,

    Reply

  13. mahesh
    Dec 20, 2011 @ 15:43:30

    hi,
    how to add request date date column in order workflow first table and this column extracts information from order line request date..

    PLZ help me

    Reply

  14. sreekanth
    Dec 21, 2011 @ 09:48:42

    Excellent material for the beginners. Thk you erp schools.

    Reply

  15. shishu paul
    Feb 07, 2012 @ 14:53:44

    Very good material and definitions and like as an live demonstrations. Shishu Paul Chandigarh

    Reply

  16. Raman
    May 03, 2012 @ 12:26:14

    Dear Sir,

    Very good material, but small issue while saving the workflow, can you help me out. Please find the error given below

    382: Design Validation generated 1 warning(s). You may save invalid definitions but they should not be used in running process.

    354: ‘SAVE’ validation failed for activity ‘ERP_DEMO/ERP_ITEM_PROCESS’.
    352: Process must contain a start activity with no ‘in’ transitions.

    Raman

    Reply

  17. Jack
    Jun 08, 2012 @ 00:51:38

    Good effort, but alot of gaps.. it need more clarifications..anyway thanks !

    Reply

  18. aithya
    Aug 22, 2012 @ 15:46:10

    hi
    good material oracle workflow

    Reply

  19. Nageswara Rao
    Aug 27, 2012 @ 12:39:53

    Hi Sir

    This Example is very good.please tell me out deploy oracla apps.

    Reply

  20. sasha
    Oct 02, 2012 @ 23:22:18

    Thank u sir. God bless u

    Reply

  21. Sunil Mane
    Feb 22, 2013 @ 12:26:54

    I have tried this example. When I saved in data base and checked from tables, get data from item_types,messages,attributes,processes. But i cant get value for notification from ‘WF_NOTIFICATIONS’ table. I have created item in master organization and again checked but still not getting value for notification and also from front end on workflow screen. Can u help me to resolve it.

    Reply

  22. Puspendu Das
    Apr 10, 2013 @ 18:24:00

    I am also facing the same problem as Sunil Mane

    Reply

  23. abhi
    May 21, 2013 @ 21:47:26

    Great …. document

    Regards
    Abhi

    Reply

  24. Subhan
    Aug 26, 2013 @ 15:01:51

    This is very use full material and very easy for beginner.

    Reply

  25. Jagadekara Reddy
    Sep 25, 2013 @ 15:06:11

    HI RAMAN,
    DOUBLE CLICK ON START ICON NODE TAB GIVE START/END AS START
    AND END FOR END ICON THEN IT WILL VALIDATE

    Reply

  26. Abid
    Oct 04, 2013 @ 17:39:46

    workflow can’t be initialize from database trigger.
    see note 603595.1

    Reply

  27. Abid
    Oct 04, 2013 @ 18:22:17

    Sorry for previous comments
    Workflow can’t trigger from database trigger unless you run
    Workflow Background Engine concurrent request

    Reply

  28. Mahtab
    Oct 12, 2013 @ 11:25:46

    Excellent study material

    Reply

  29. chandu
    Jun 11, 2014 @ 14:20:08

    This is good for beginers.

    Thanks for you effort!!!

    Reply

  30. chandu
    Jun 11, 2014 @ 14:22:00

    Good material for beginers.

    Thanks for your effort

    Reply

  31. Priya MP
    Jun 26, 2014 @ 14:01:31

    This tutorial is really helpful. Is it possible to query the WS_NOTIFICATIONS table?

    Reply

  32. venkat
    Jul 02, 2014 @ 13:27:28

    Hi Sir,

    Thanks for your effort

    Reply

  33. vedashruti
    Oct 14, 2014 @ 03:39:23

    very simple and detailed explanation… best site for beginners

    Reply

Leave a Reply