Apr 172011
 

Overview:

This article will illustrate how to create or define workflow 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.

  • Open WFSTD and save as new workflow
  • Create Attributes
  • Create Functions
  • Create Notification
  • Create Messages
  • Create Roles
  • Create database trigger
  • Create PL/SQL Package

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\ WF\DATA\US\WFSTD

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 below

Internal Name: ERP_DEMO

Display Name: ErpSchools Demo

Description: ErpSchools Demo

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

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

alt

Enter the fields

Internal Name: ERPSCHOOLS_PROCESS

Display Name: ErpSchools Process

Description: ErpSchools Process

alt

alt

Double click ErpSchools Process Icon

alt

2) Create Workflow Attributes:

Navigation: Window menu > Navigator

alt

Right click on Attributes and click New Attribute

alt

Enter the fields

Internal Name: ERP_ITEM_NUMBER

Display Name: Item Number

Description: Item Number

Type: Text

Default Value: Value Not Assigned

alt

Click Apply and then OK

Create one more attribute

Right click on Attributes and click New Attribute

alt

Enter the attribute fields

Internal Name: ERP_SEND_ITEM_FORM_LINK

Display Name: Send Item Form Link

Description: Send Item Form Link

Type: Form

Value: INVIDITM

alt

Click Apply and then OK

 

3) Create Workflow Function:

Right click and then click on New Function

alt

Properties window will open as shown below

alt

Change/Enter the fields as below

Change Item Type to Standard from ErpSchools Demo

Select Internal Name as Start

Remaining fields will be populated automatically

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

Click Apply and then OK

alt

Right click on white space and then click New Function

alt

Enter the fields

Internal Name: ERP_GET_DETAILS

Display Name: Get New Inventory Item Details

Description: Get New Inventory Item Details

Function Name: erpschools_demo_pkg.get_item_details

alt

Click Apply and then OK

alt

 

4) Create Workflow Notifications:

Right click on white space and then click New Notification

alt

Enter fields

Internal Name: ERP_SEND_ITEM_DET

Display  Name: Send Item Detials

Description: Send Item Detials

Message: Sned Item Details Message

alt

Click Apply and then OK

 

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”

6) Create Roles: 

Adhoc roles can be created through PL/SQL 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

 Script to Create a Adhoc Role

 Script to Add user to existing Adhoc Role

 Script to Remove user from existing Adhoc Role

 Using Adhoc roles in workflow notifications

 Adhoc Roles Tables

Script to Create a Adhoc Role

Script to Add user to already existing Adhoc Role

Script to Remove user from existing Adhoc Role

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.

Tables:

WF_ROLES

WF_USER_ROLES

WF_LOCAL_ROLES

WF_USER_ROLE_ASSIGNMENTS

7)Launching workflow from PL/SQL:

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

  29 Responses to “Workflow tutorial”

  1. Excellent study material

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

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

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

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

  6. Great …. document

    Regards
    Abhi

  7. I am also facing the same problem as Sunil Mane

  8. 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.

  9. Thank u sir. God bless u

  10. Hi Sir

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

  11. hi
    good material oracle workflow

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

  13. 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

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

  15. Excellent material for the beginners. Thk you erp schools.

  16. 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

  17. Use ful…

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

  18. Ammmaa Apdiya..

  19. Hi,

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

    Regards.

  20. 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?

  21. this is vary use full material

    thank u. It help me a lot.

  22. 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

  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.

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

  25. Excellent for beginners

  26. very good material to easy learn

  27. good for beginners

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

  29. this is vary use full material

    thank u

 Leave a Reply

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">