8/25/2014 oracle Workflow tutorial Prudhvi Avuthu Apr 17, 2011 A RT I C L E S / T O O L S / W O RK F L O W
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.
Open WFSTD and save as new workflow Create Process
Create Functions including START and END
Search
Apps Questions
Ask a Question
August 2014
M T W T F S S
The Best Dedicated Server
softlayer.com/dedicated-server
100,000+ Servers Already in Use. Order Yours & Start Work in Seconds
erpSchools
7,028 people like erpSchools.
Facebook social plugin
Like
Forms Migration
sibvisions.com
Tool-based Java migration - more efficient than Forms!
ARTICLES SCRIPTS TRAININGS CONTACT
8/25/2014 oracle Workflow tutorial
Run “Workflow Background Process” Concurrent Program
1) Open WFSTD and save as new workflow:
Navigation: File >> Open
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
« Jul
POPULAR QUESTIONS
→ Specify the steps that need to be done starting from creating an invoice until transferring it to GL in AP.
asked by → Prudhvi Avuthu
→ What table holds the link between OM and AR?
asked by → Prudhvi Avuthu
→ Can we create an Invoice without a PO in payables?
asked by → Prudhvi Avuthu
→ What does TCA stand for? What
is it used for ?
asked by → Prudhvi Avuthu
→ Name the standard Key Flexfields in AR.
asked by → Prudhvi Avuthu
→ What are Aging Periods used for in AP?
asked by → Prudhvi Avuthu
→ What is the name of the program used to import expense reports into AP? Name the tables that store the expense reports related date.
asked by haritha
→ What are Payment Terms?
asked by → Prudhvi Avuthu
→ Can you make a partial payment for an invoice in AP?
asked by haritha
→ What is the process/steps for Vendor Conversion?
asked by → Prudhvi Avuthu
8/25/2014 oracle Workflow tutorial
Enter the fields as shown in below image
8/25/2014 oracle Workflow tutorial
Expand the node to see attributes, processes, notifications, functions, Events, Messages and lookup types.
2) Create Process
8/25/2014 oracle Workflow tutorial
Enter the fields as shown in below image
8/25/2014 oracle Workflow tutorial
Double click ErpSchools Process Icon to open process window where we can draw our workflow diagram.
8/25/2014 oracle Workflow tutorial
Properties window will open as shown below
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.
8/25/2014 oracle Workflow tutorial
Click Apply then OK
8/25/2014 oracle Workflow tutorial
Change the properties as below Item Type: Standard
Internal Name: END
Go to Node tab and select “End” from the drop down. This is mandatory and can’t be ignored.
8/25/2014 oracle Workflow tutorial
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
8/25/2014 oracle Workflow tutorial
Click Apply and then OK
We will join these activities later after we have our notification ready.
4) Create Workflow Attributes: Navigation: Window menu > Navigator
8/25/2014 oracle Workflow tutorial
Right click on Attributes and click New Attribute
8/25/2014 oracle Workflow tutorial
Click Apply and then OK Create one more attribute
Right click on Attributes and click New Attribute
8/25/2014 oracle Workflow tutorial
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
8/25/2014 oracle Workflow tutorial
Enter the fields
Internal Name: ERP_SEND_ITEM_DET_MSG Display Name: Send Item Details Message Description: Send Item Details Message
8/25/2014 oracle Workflow tutorial
Click Apply and then OK
Navigation: Window Menu > Navigator Select Item Form Link Attribute
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:
8/25/2014 oracle Workflow tutorial
Enter fields as shown in the below image Message: Sned Item Details Message
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
8/25/2014 oracle Workflow tutorial
ion
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.
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
8/25/2014 oracle Workflow tutorial
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
CREATEORREPLACETRIGGER "ERP_SCHOOLS_DEMO_TRIGGER" AFTER INSERTON INV.MTL_SYSTEM_ITEMS_B REFERENCING DECLARE
lv_id NUMBER := :NEW.inventory_item_id; lv_item_segment1 VARCHAR2(100) := :NEW.segment1; lv_itemtype VARCHAR2(80) := :NEW.item_type; lv_user_id NUMBER := -1; lv_itemkey VARCHAR2(10); lv_orgid NUMBER :=2; error_msg VARCHAR2(2000); error_code NUMBER; BEGIN lv_user_id := fnd_global.user_id; lv_orgid := fnd_global.org_id;
lv_itemkey := 1132; -- This should be unique value
ERP_DEMO.LAUNCH_WORKFLOW('ERP_DEMO'
,lv_itemkey
,'ERPSCHOOLS_PROCESS'--process name
,lv_id ,lv_orgid ,lv_item_segment1 );
EXCEPTIONWHEN OTHERS THEN error_code := SQLCODE; error_msg := SQLERRM(SQLCODE);
RAISE_APPLICATION_ERROR(-20150,error_msg); END; 1 2 3 4
CREATEORREPLACEPACKAGE APPS.ERP_DEMO IS
PROCEDURE LAUNCH_WORKFLOW (
8/25/2014 oracle Workflow tutorial 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
CREATEORREPLACEPACKAGEBODY APPS.ERP_DEMO IS
PROCEDURE LAUNCH_WORKFLOW( itemtype INVARCHAR2, itemkey INVARCHAR2, process INVARCHAR2, item_id INNUMBER, org_id INNUMBER, item_segment1 INVARCHAR2 ) IS v_master_form_link varchar2(5000); v_item_number varchar2(100); v_add_item_id varchar2(5000); error_code varchar2(100); error_msg varchar2(5000); BEGIN
v_add_item_id := ' ITEM_ID="' || item_id || '"'; v_item_number := item_segment1;
v_master_form_link := v_master_form_link || v_add_item_id; WF_ENGINE.Threshold := -1;
WF_ENGINE.CREATEPROCESS(itemtype, itemkey, process);
-- Get the value of attribute assigned in workflow
v_master_form_link := wf_engine.getitemattrtext( itemtype => itemtype
,itemkey => itemkey
,aname => 'ERP_SEND_ITEM_FORM_LINK');
-- assign values to variables so that you can usethe attributes
v_master_form_link := v_master_form_link||':#RESP_KEY="INVENTORY" #APP_SHORT_NAME="INV" ORG_MODE="Y" '
v_master_form_link := v_master_form_link || v_add_item_id;
--set the attribute values in workflow so that you can use them in notifications
WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'MASTERFORM', v_master_form_link); WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'ERP_ITEM_NUMBER', item_segment1);
-- start the workflow process
WF_ENGINE.STARTPROCESS(itemtype, itemkey); EXCEPTIONWHEN OTHERS THEN
error_code := SQLCODE; error_msg := SQLERRM(SQLCODE);
-- add dbms or fnd_output messages as required
END LAUNCH_WORKFLOW;
8/25/2014 oracle Workflow tutorial
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.
RELATED POSTS
A RT I C L E S /Register PL SQL stored procedure in Oracle Apps
T O O L S / SQL Loader Part 2 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
resultout OUT NOCOPY VARCHAR2 )
IS
v_GET_ITEM_NUMBER VARCHAR2(1000); BEGIN
SELECT SEGMENT1 INTO V_GET_ITEM_NUMBER FROM MTL_SYSTEM_ITEMS_B WHEREROWNUM =1; WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'ERP_ITEM_NUMBER',v_GET_ITEM_NUMBER );
-- you can use the get function as below. --v_GET_ITEM_NUMBER := wf_engine.getitemattrtext(
-- itemtype => itemtype -- ,itemkey => itemkey -- ,aname => 'X_ATTRIBUTE');
resultout:='COMPLETE:'||'Y'; exceptionwhen others then
dbms_output.put_line('Entered Exception');
fnd_file.put_line(fnd_file.log,'Entered Exception'); END GET_ITEM_DETAILS;
END ERP_DEMO; /
8/25/2014 oracle Workflow tutorial A RT I C L E S /
Folders in Oracle Forms
T O O L S /
Forms Customization Steps and Registration Process
W O RK F L O W /
Workflow migration: WFLOAD | Workflow Definitions Loader
A RT I C L E S /
Responsibility in Oracle Apps
‹
Display and change images dynamically in XML publisher›
DataLoader Tutorial33 COMMENTS
thirupathi
JUL 22, 2011 @ 16:33:40this is vary use full material thank u
REPLY
shantanu jain
AUG 02, 2011 @ 07:27:12this is the best website for study ………….
REPLY
Core Tamil
NOV 25, 2011 @ 16:47:00 Ammmaa Apdiya.. REPLYkartheeka
AUG 10, 2011 @ 13:59:59good for beginners
REPLY
abhi karthi
AUG 10, 2011 @ 14:01:14very good material to easy learn
REPLY
sudhakar
AUG 10, 2011 @ 16:43:56
Excellent for beginners
REPLY
Aparna
AUG 18, 2011 @ 14:03:51
8/25/2014 oracle Workflow tutorial
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.
sreenivas
SEP 29, 2011 @ 11:35:40Its 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
RAKESH KUMAR KAR
OCT 13, 2011 @ 15:01:48this is vary use full material thank u. It help me a lot.
REPLY
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
Waqas Hassan
OCT 23, 2011 @ 15:52:04Hi,
I want to download “Oracle Workflow Builder”. How can i download this software? Regards. REPLY
Mahendar
DEC 08, 2011 @ 15:32:12 Use ful…but need brief intruduction about the used proces,,,,,
REPLY
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..
8/25/2014 oracle Workflow tutorial
Very good material and definitions and like as an live demonstrations. Shishu Paul Chandigarh
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
Jack
JUN 08, 2012 @ 00:51:38
Good effort, but alot of gaps.. it need more clarifications..anyway thanks ! REPLY
aithya
AUG 22, 2012 @ 15:46:10
hi
good material oracle workflow
REPLY
Nageswara Rao
AUG 27, 2012 @ 12:39:53Hi Sir
This Example is very good.please tell me out deploy oracla apps.
REPLY
sasha
OCT 02, 2012 @ 23:22:18
Thank u sir. God bless u
REPLY
Sunil Mane
FEB 22, 2013 @ 12:26:54I 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
Puspendu Das
APR 10, 2013 @ 18:24:00I am also facing the same problem as Sunil Mane
8/25/2014 oracle Workflow tutorial
Abhi
Subhan
AUG 26, 2013 @ 15:01:51
This is very use full material and very easy for beginner.
REPLY
Jagadekara Reddy
SEP 25, 2013 @ 15:06:11HI RAMAN,
DOUBLE CLICK ON START ICON NODE TAB GIVE START/END AS START AND END FOR END ICON THEN IT WILL VALIDATE
REPLY
Abid
OCT 04, 2013 @ 17:39:46
workflow can’t be initialize from database trigger. see note 603595.1
REPLY
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
Mahtab
OCT 12, 2013 @ 11:25:46
Excellent study material
REPLY
chandu
JUN 11, 2014 @ 14:20:08
This is good for beginers. Thanks for you effort!!!
REPLY
chandu
JUN 11, 2014 @ 14:22:00
Good material for beginers. Thanks for your effort
REPLY
Priya MP
JUN 26, 2014 @ 14:01:31
This tutorial is really helpful. Is it possible to query the WS_NOTIFICATIONS table?
REPLY
venkat
JUL 02, 2014 @ 13:27:28
8/25/2014 oracle Workflow tutorial
BACK TO TOP
TAGS
Add ADF AP
API
ar BI concurrent program Controller conversion email forms iexpense iexpenses interface internal requisition internalsales order inventory Invoices JAva o2c
OAF
OAF Pageom
Oracle
Oracle Apps
order to cashoutput payables payment batchpersonalization position heirarchyPrepayments process Publisher R12 REceivables Remove responsibilities responsibility
script
users UTL_MAILworkflow
xml XML PublisherCopyright erpSchools & Prudhvi Avuthu
Copying of content without written permission is not allowed. YOUR NAME
YOUR EMAIL YOUR WEBSITE