{"id":1625,"date":"2011-04-17T12:47:08","date_gmt":"2011-04-17T07:17:08","guid":{"rendered":"http:\/\/sendyoursmiles.com\/articles\/workflow-tutorial"},"modified":"2011-04-17T12:47:08","modified_gmt":"2011-04-17T07:17:08","slug":"workflow-tutorial","status":"publish","type":"post","link":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial","title":{"rendered":"Workflow tutorial"},"content":{"rendered":"<p><span style=\"text-decoration: underline;\">Overview:<\/span><\/p>\n<p>This workflow tutorial\u00a0will 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.<\/p>\n<p><span style=\"text-decoration: underline;\">Business Requirement: <\/span><\/p>\n<p>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.<\/p>\n<p><span style=\"text-decoration: underline;\">Process flow: <\/span><\/p>\n<p>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.<\/p>\n<ul>\n<li><a href=\"#step1\">Open WFSTD and save as new workflow<\/a><\/li>\n<li><a href=\"#step2\">Create Process<\/a><\/li>\n<li><a href=\"#step3\">Create Functions including START and END<\/a><\/li>\n<li><a href=\"#step4\">Create Attributes<\/a><\/li>\n<li><a href=\"#step5\">Create Messages<\/a><\/li>\n<li><a href=\"#step6\">Create Notification<\/a><\/li>\n<li><a href=\"#step7\">Create Roles &amp; assign to notification<\/a><\/li>\n<li><a href=\"#step8\">Link all activities with in process<\/a><\/li>\n<li><a href=\"#step9\">Save workflow to database<\/a><\/li>\n<li><a href=\"#step10\">Create database trigger<\/a><\/li>\n<li><a href=\"#step11\">Create PL\/SQL Package<\/a><\/li>\n<li><a href=\"#step12\">Run &#8220;Workflow Background Process&#8221; Concurrent Program<\/a><\/li>\n<\/ul>\n<p><a name=\"step1\"><\/a><br \/>\n<strong>1)\u00a0<span style=\"line-height: 1.5em;\">Open WFSTD and save as new workflow:<\/span><\/strong><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut1.jpg\" alt=\"alt\" \/><\/p>\n<p>Navigation: File &gt;&gt; Open<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut2.jpg\" alt=\"alt\" \/><\/p>\n<p>Click Browse then navigate to Workflow installation directory<\/p>\n<p>Navigation: Workflow Installation Directory WFDATAUSWFSTD<\/p>\n<p>Now Click File &gt; Save as, Enter &#8220;ErpSchools Demo&#8221; and click OK<\/p>\n<p>Right click on WFSTD and select New Item type<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut3.jpg\" alt=\"alt\" \/><\/p>\n<p>Enter the fields as shown in below image<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut4.jpg\" alt=\"alt\" \/><\/p>\n<p>Now you will see ErpSchools Demo icon in the Navigator<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut5.jpg\" alt=\"alt\" \/><\/p>\n<p>Expand the node to see attributes, processes, notifications, functions, Events, Messages and lookup types.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut6.jpg\" alt=\"alt\" \/><\/p>\n<p><a name=\"step2\"><\/a><br \/>\n<strong>2) Create Process<\/strong><\/p>\n<p>Double click on Process to open up the properties window as shown below<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut7.jpg\" alt=\"alt\" \/><\/p>\n<p>Enter the fields as shown in below image<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut8.jpg\" alt=\"alt\" \/><\/p>\n<p>Click OK<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut9.jpg\" alt=\"alt\" \/><\/p>\n<p>Double click ErpSchools Process Icon to open process window where we can draw our workflow diagram.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut10.jpg\" alt=\"alt\" \/><\/p>\n<p>Right click on process window and then click on New Function.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut16.jpg\" alt=\"alt\" \/><\/p>\n<p>Properties window will open as shown below<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut17.jpg\" alt=\"alt\" \/><\/p>\n<p>Change\/Enter the fields as shown in below image<\/p>\n<p>Change Item Type to Standard. This is important as we are using START and END functions which came from WFSTD (Standard item type).<\/p>\n<p>Select Internal Name as Start<\/p>\n<p>Remaining fields will be populated automatically.<\/p>\n<p>Go to Node tab and select &#8220;Start&#8221; from the drop down. This is mandatory and can&#8217;t be ignored.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut18.jpg\" alt=\"alt\" \/><\/p>\n<p>Click Apply then OK<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut19.jpg\" alt=\"alt\" \/><\/p>\n<p>Again Right click on white space and click New Function<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut20.jpg\" alt=\"alt\" \/><\/p>\n<p>Change the properties as below<\/p>\n<p>Item Type: Standard<\/p>\n<p>Internal Name: END<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut21.jpg\" alt=\"alt\" \/><\/p>\n<p>Go to Node tab and select &#8220;End&#8221; from the drop down. This is mandatory and can&#8217;t be ignored.<\/p>\n<p>Click Apply and then OK<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut22.jpg\" alt=\"alt\" \/><\/p>\n<p>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<\/p>\n<p><a name=\"step3\"><\/a><br \/>\n<strong>3)\u00a0Create Workflow Function:<\/strong><\/p>\n<p>Right click on white space \u00a0in the process window and then click New Function. Alternatively you can select Functions in Navigator and right click to get &#8220;New Function&#8221; option<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut23.jpg\" alt=\"alt\" \/><\/p>\n<p>Enter the fields as shown in below image<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut24.jpg\" alt=\"alt\" \/><\/p>\n<p>Click Apply and then OK<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut25.jpg\" alt=\"alt\" \/><\/p>\n<p>We will join these activities later after we have our notification ready.<\/p>\n<p><a name=\"step4\"><\/a><br \/>\n<strong>4)\u00a0Create Workflow Attributes:<\/strong><\/p>\n<p>Navigation:\u00a0<span style=\"line-height: 1.5em;\">Window menu<\/span><span style=\"line-height: 1.5em;\"> &gt; Navigator<\/span><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut11.jpg\" alt=\"alt\" \/><\/p>\n<p>Right click on Attributes and click New Attribute<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut12.jpg\" alt=\"alt\" \/><\/p>\n<p>Enter the fields as shown in below image<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut13.jpg\" alt=\"alt\" \/><\/p>\n<p>Click Apply and then OK<\/p>\n<p>Create one more attribute<\/p>\n<p>Right click on Attributes and click New Attribute<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut14.jpg\" alt=\"alt\" \/><\/p>\n<p>Enter the fields as shown in below image<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut15.jpg\" alt=\"alt\" \/><\/p>\n<p>Click Apply and then OK.<\/p>\n<p>Here INVIDITM form belongs to &#8220;Master Item&#8221; for from inventory module.<\/p>\n<p>Now we have two attributes ready to use.<\/p>\n<p><a name=\"step5\"><\/a><br \/>\n<strong>5) Create Workflow Messages:<\/strong><\/p>\n<p>click on Message and click New<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut28.jpg\" alt=\"alt\" \/><\/p>\n<p>Properties window will pop up as show below<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut29.jpg\" alt=\"alt\" \/><\/p>\n<p>Enter the fields<\/p>\n<p>Internal Name: ERP_SEND_ITEM_DET_MSG<\/p>\n<p>Display Name: Send Item Details Message<\/p>\n<p>Description: Send Item Details Message<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut30.jpg\" alt=\"alt\" \/><\/p>\n<p>Go to Body Tab and enter as shown below<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut31.jpg\" alt=\"alt\" \/><\/p>\n<p>Click Apply and then OK<\/p>\n<p>Navigation: Window Menu &gt; Navigator<\/p>\n<p>Select Item Form Link Attribute<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut32.jpg\" alt=\"alt\" \/><\/p>\n<p>Drag and drop both attributes to &#8220;Send Item Details Message&#8221;. If you miss this step you will not be able to see the attribute values with in email.<\/p>\n<p><a name=\"step6\"><\/a><br \/>\n<strong>6) Create Workflow Notifications:<\/strong><\/p>\n<p>Right click on white space in process window and then click New Notification<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut26.jpg\" alt=\"alt\" \/><\/p>\n<p>Enter fields as shown in the below image<\/p>\n<p>Message: Sned Item Details Message<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut27.jpg\" alt=\"alt\" \/><\/p>\n<p>Click Apply and then OK<\/p>\n<p><a name=\"step7\"><\/a><br \/>\n<strong>7)\u00a0<span style=\"line-height: 1.5em;\">Create Roles and assign it to notification:\u00a0<\/span><\/strong><\/p>\n<p>Adhoc roles can be created through PL\/SQL API&#8217;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<\/p>\n<p>Alternatively you can use USERNAME directly with in the notification.<\/p>\n<p>If you wish to create User Roles manually then follow the below articles<\/p>\n<pre>User Role Creation through API: <a href=\"http:\/\/erpschools.com\/articles\/oracle-workflow-ad-hoc-roles\" target=\"_blank\">WF_DIRECTORY API<\/a>\n\nUser Role Creation from \"User Management\" Responsibility: <a title=\"USER Management| Roles\" href=\"http:\/\/erpschools.com\/articles\/sysadmin-and-aol\/user-management-role-categories-roles-indirect-responsibilities\" target=\"_blank\">Role Creation<\/a>\n<\/pre>\n<p>Using Adhoc roles in workflow notifications:<\/p>\n<p>Navigation: File &gt; Load Roles from Database<\/p>\n<p>Select roles you want to use and then click OK.<\/p>\n<p>Open the notification properties and then navigate to node tab, select performer as the role you just created and loaded from database.<\/p>\n<p><a name=\"step8\"><\/a><\/p>\n<p><strong> 8)Link all activities with in process<\/strong><\/p>\n<p>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.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4923\" src=\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut38.png\" alt=\"041711_1245_Workflowtut38\" width=\"638\" height=\"448\" \/> <\/strong><\/p>\n<p><a name=\"step9\"><\/a><\/p>\n<p><strong> 9)Save workflow to database<\/strong><\/p>\n<p>There are three different methods to upload a workflow into database. The simple one is from workflow builder tool itself.<\/p>\n<p>Go to File &gt; Save as and choose the option &#8220;database&#8221;.<\/p>\n<p>Provide your apps user login credentials and click OK.<\/p>\n<p>To understand how to save workflow from a file (.wft) to database and vice versa you can read the below article.<\/p>\n<p><a title=\"Workflow migration\" href=\"http:\/\/erpschools.com\/articles\/tools\/workflow-tools\/upload-workflow-oracle-apps-wfload-upload-workflow-oracle-workflow-definitions-loader\">Workflow Migration<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a name=\"step10\"><\/a><\/p>\n<p><strong> 10)Launching workflow from PL\/SQL: <\/strong><\/p>\n<pre> Make sure to run \"Workflow background process\" after item is created. \nWorkflow will get into defered status initially and after workflow background process program is completed it should be in running mode.<\/pre>\n<p>Compile the PL\/SQL code in database.<br \/>\nFirst create a database trigger as below to call a PL\/SQL procedure from which you kick off the workflow.<\/p>\n<p>&#8211;Create Database Trigger<br \/>\n<code><br \/>\nCREATE OR REPLACE TRIGGER \"ERP_SCHOOLS_DEMO_TRIGGER\" AFTER INSERT ON INV.MTL_SYSTEM_ITEMS_B REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW<br \/>\nDECLARE<br \/>\nlv_id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NUMBER\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 := :NEW.inventory_item_id;<br \/>\nlv_item_segment1\u00a0\u00a0\u00a0\u00a0\u00a0 VARCHAR2(100)\u00a0\u00a0 := :NEW.segment1;<br \/>\nlv_itemtype\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 VARCHAR2(80)\u00a0\u00a0\u00a0 := :NEW.item_type;<br \/>\nlv_user_id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NUMBER\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 := -1;<br \/>\nlv_itemkey\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 VARCHAR2(10);<br \/>\nlv_orgid\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NUMBER\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :=2;<br \/>\nerror_msg\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 VARCHAR2(2000);<br \/>\nerror_code\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NUMBER;<br \/>\nBEGIN<br \/>\nlv_user_id := fnd_global.user_id;<br \/>\nlv_orgid := fnd_global.org_id;<br \/>\nlv_itemkey := 1132; -- This should be unique value<br \/>\nERP_DEMO.LAUNCH_WORKFLOW('ERP_DEMO'<br \/>\n,lv_itemkey<br \/>\n,'ERPSCHOOLS_PROCESS' --process name<br \/>\n,lv_id<br \/>\n,lv_orgid<br \/>\n,lv_item_segment1<br \/>\n);<br \/>\nEXCEPTION WHEN OTHERS THEN<br \/>\nerror_code := SQLCODE;<br \/>\nerror_msg\u00a0 := SQLERRM(SQLCODE);<br \/>\nRAISE_APPLICATION_ERROR(-20150,error_msg);<br \/>\nEND;<br \/>\n<\/code><\/p>\n<p><a name=\"step11\"><\/a><br \/>\n<strong>&#8211;Create PL\/SQL Package to kickoff workflow<\/strong><\/p>\n<p><code><br \/>\nCREATE OR REPLACE PACKAGE APPS.ERP_DEMO IS<br \/>\nPROCEDURE LAUNCH_WORKFLOW<br \/>\n(<br \/>\nitemtype\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN VARCHAR2,<br \/>\nitemkey\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN VARCHAR2,<br \/>\nprocess\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN VARCHAR2,<br \/>\nitem_id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN NUMBER,<br \/>\norg_id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN NUMBER,<br \/>\nitem_segment1\u00a0\u00a0 IN VARCHAR2<br \/>\n);<br \/>\nEND ERP_DEMO;<br \/>\n<\/code><\/p>\n<p><code><br \/>\nCREATE OR REPLACE PACKAGE BODY APPS.ERP_DEMO IS<br \/>\nPROCEDURE LAUNCH_WORKFLOW(<br \/>\nitemtype\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN VARCHAR2,<br \/>\nitemkey\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN VARCHAR2,<br \/>\nprocess\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN VARCHAR2,<br \/>\nitem_id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN NUMBER,<br \/>\norg_id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN NUMBER,<br \/>\nitem_segment1\u00a0\u00a0\u00a0 IN VARCHAR2<br \/>\n)<br \/>\nIS<br \/>\nv_master_form_link varchar2(5000);<br \/>\nv_item_number varchar2(100);<br \/>\nv_add_item_id varchar2(5000);<br \/>\nerror_code varchar2(100);<br \/>\nerror_msg varchar2(5000);<br \/>\nBEGIN<br \/>\nv_add_item_id := ' ITEM_ID=\"' || item_id || '\"';<br \/>\nv_item_number := item_segment1;<br \/>\nv_master_form_link := v_master_form_link || v_add_item_id;<br \/>\nWF_ENGINE.Threshold := -1;<br \/>\nWF_ENGINE.CREATEPROCESS(itemtype, itemkey, process);<br \/>\n-- Get the value of attribute assigned in workflow<br \/>\nv_master_form_link := wf_engine.getitemattrtext(<br \/>\nitemtype =&gt; itemtype<br \/>\n,itemkey\u00a0 =&gt; itemkey<br \/>\n,aname\u00a0\u00a0\u00a0 =&gt; 'ERP_SEND_ITEM_FORM_LINK');<br \/>\n-- assign values to variables so that you can usethe attributes<br \/>\nv_master_form_link := v_master_form_link||':#RESP_KEY=\"INVENTORY\" #APP_SHORT_NAME=\"INV\" ORG_MODE=\"Y\" ';<br \/>\nv_master_form_link := v_master_form_link || v_add_item_id;<br \/>\n--set the attribute values in workflow so that you can use them in notifications<br \/>\nWF_ENGINE.SetItemAttrText(itemtype, itemkey, 'MASTERFORM', v_master_form_link);<br \/>\nWF_ENGINE.SetItemAttrText(itemtype, itemkey, 'ERP_ITEM_NUMBER', item_segment1);<br \/>\n-- start the workflow process<br \/>\nWF_ENGINE.STARTPROCESS(itemtype, itemkey);<br \/>\nEXCEPTION WHEN OTHERS THEN<br \/>\nerror_code := SQLCODE;<br \/>\nerror_msg\u00a0 := SQLERRM(SQLCODE);<br \/>\n-- add dbms or fnd_output messages as required<br \/>\nEND LAUNCH_WORKFLOW;<br \/>\n-- This procedure will just put the item number into workflow attribute ERP_ITEM_NUMBER<br \/>\nPROCEDURE GET_ITEM_DETAILS(<br \/>\nitemtype\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN VARCHAR2,<br \/>\nitemkey\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN VARCHAR2,<br \/>\nactid\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN NUMBER,<br \/>\nfuncmode\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN VARCHAR2,<br \/>\nresultout\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 OUT NOCOPY VARCHAR2<br \/>\n)<br \/>\nIS<br \/>\nv_GET_ITEM_NUMBER VARCHAR2(1000);<br \/>\nBEGIN<br \/>\nSELECT SEGMENT1 INTO V_GET_ITEM_NUMBER FROM MTL_SYSTEM_ITEMS_B WHERE ROWNUM =1;<br \/>\nWF_ENGINE.SetItemAttrText(itemtype, itemkey, 'ERP_ITEM_NUMBER',v_GET_ITEM_NUMBER );<br \/>\n-- you can use the get function as below.<br \/>\n--v_GET_ITEM_NUMBER := wf_engine.getitemattrtext(<br \/>\n--\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 itemtype =&gt; itemtype<br \/>\n--\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ,itemkey\u00a0 =&gt; itemkey<br \/>\n--\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ,aname\u00a0\u00a0\u00a0 =&gt; 'X_ATTRIBUTE');<br \/>\nresultout:='COMPLETE:'||'Y';<br \/>\nexception when others then<br \/>\ndbms_output.put_line('Entered Exception');<br \/>\nfnd_file.put_line(fnd_file.log,'Entered Exception');<br \/>\nEND GET_ITEM_DETAILS;<br \/>\nEND ERP_DEMO;<br \/>\n\/<br \/>\n<\/code><\/p>\n<p><a name=\"step12\"><\/a><br \/>\n&nbsp;<br \/>\n<strong>Create Inventory Item <\/strong><br \/>\nGo to Inventory module and create inventory item from master org form. <\/p>\n<p><a name=\"step13\"><\/a><br \/>\n<strong>Run &#8220;Workflow Background Process&#8221; concurrent program<\/strong><br \/>\n&nbsp;<br \/>\nGo to System administrator responsibility and launch concurrent program &#8220;Workflow background process&#8221; and choose Yes to the parameter process deferred.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview: This workflow tutorial\u00a0will 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, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,11,76],"tags":[],"class_list":["post-1625","post","type-post","status-publish","format-standard","hentry","category-articles","category-tools","category-workflow-tools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>oracle Workflow tutorial<\/title>\n<meta name=\"description\" content=\"oracle workflow tutorial to create new workflow with functions, notifications, messages\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prudhvi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#article\",\"isPartOf\":{\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial\"},\"author\":{\"name\":\"Prudhvi\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/person\/dbed9bb7fb66aa7a700fc565da024512\"},\"headline\":\"Workflow tutorial\",\"datePublished\":\"2011-04-17T07:17:08+00:00\",\"dateModified\":\"2011-04-17T07:17:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial\"},\"wordCount\":1041,\"commentCount\":40,\"publisher\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#organization\"},\"image\":{\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#primaryimage\"},\"thumbnailUrl\":\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut1.jpg\",\"articleSection\":[\"Articles\",\"Tools\",\"Workflow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial\",\"url\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial\",\"name\":\"oracle Workflow tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#primaryimage\"},\"image\":{\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#primaryimage\"},\"thumbnailUrl\":\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut1.jpg\",\"datePublished\":\"2011-04-17T07:17:08+00:00\",\"dateModified\":\"2011-04-17T07:17:08+00:00\",\"description\":\"oracle workflow tutorial to create new workflow with functions, notifications, messages\",\"breadcrumb\":{\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#primaryimage\",\"url\":\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut1.jpg\",\"contentUrl\":\"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut1.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/erpschools.com\/erps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Workflow tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/erpschools.com\/erps\/#website\",\"url\":\"https:\/\/erpschools.com\/erps\/\",\"name\":\"erpSchools\",\"description\":\"Oracle Apps\",\"publisher\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/erpschools.com\/erps\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/erpschools.com\/erps\/#organization\",\"name\":\"erpSchools\",\"url\":\"https:\/\/erpschools.com\/erps\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png\",\"contentUrl\":\"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png\",\"width\":250,\"height\":60,\"caption\":\"erpSchools\"},\"image\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"http:\/\/facebook.com\/erpschools\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/person\/dbed9bb7fb66aa7a700fc565da024512\",\"name\":\"Prudhvi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/488cec3605845b95cb20e60c67a8f5c7e74b65a305525c8006315d524f120db9?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/488cec3605845b95cb20e60c67a8f5c7e74b65a305525c8006315d524f120db9?s=96&d=blank&r=g\",\"caption\":\"Prudhvi\"},\"sameAs\":[\"http:\/\/www.erpschools.com\"],\"url\":\"https:\/\/erpschools.com\/erps\/author\/prudhvi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"oracle Workflow tutorial","description":"oracle workflow tutorial to create new workflow with functions, notifications, messages","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial","twitter_misc":{"Written by":"Prudhvi","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#article","isPartOf":{"@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial"},"author":{"name":"Prudhvi","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/person\/dbed9bb7fb66aa7a700fc565da024512"},"headline":"Workflow tutorial","datePublished":"2011-04-17T07:17:08+00:00","dateModified":"2011-04-17T07:17:08+00:00","mainEntityOfPage":{"@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial"},"wordCount":1041,"commentCount":40,"publisher":{"@id":"https:\/\/erpschools.com\/erps\/#organization"},"image":{"@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#primaryimage"},"thumbnailUrl":"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut1.jpg","articleSection":["Articles","Tools","Workflow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#respond"]}]},{"@type":"WebPage","@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial","url":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial","name":"oracle Workflow tutorial","isPartOf":{"@id":"https:\/\/erpschools.com\/erps\/#website"},"primaryImageOfPage":{"@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#primaryimage"},"image":{"@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#primaryimage"},"thumbnailUrl":"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut1.jpg","datePublished":"2011-04-17T07:17:08+00:00","dateModified":"2011-04-17T07:17:08+00:00","description":"oracle workflow tutorial to create new workflow with functions, notifications, messages","breadcrumb":{"@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#primaryimage","url":"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut1.jpg","contentUrl":"http:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/041711_1245_Workflowtut1.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/erpschools.com\/erps\/articles\/workflow-tutorial#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/erpschools.com\/erps"},{"@type":"ListItem","position":2,"name":"Workflow tutorial"}]},{"@type":"WebSite","@id":"https:\/\/erpschools.com\/erps\/#website","url":"https:\/\/erpschools.com\/erps\/","name":"erpSchools","description":"Oracle Apps","publisher":{"@id":"https:\/\/erpschools.com\/erps\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/erpschools.com\/erps\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/erpschools.com\/erps\/#organization","name":"erpSchools","url":"https:\/\/erpschools.com\/erps\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/","url":"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png","contentUrl":"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png","width":250,"height":60,"caption":"erpSchools"},"image":{"@id":"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/facebook.com\/erpschools"]},{"@type":"Person","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/person\/dbed9bb7fb66aa7a700fc565da024512","name":"Prudhvi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/488cec3605845b95cb20e60c67a8f5c7e74b65a305525c8006315d524f120db9?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/488cec3605845b95cb20e60c67a8f5c7e74b65a305525c8006315d524f120db9?s=96&d=blank&r=g","caption":"Prudhvi"},"sameAs":["http:\/\/www.erpschools.com"],"url":"https:\/\/erpschools.com\/erps\/author\/prudhvi"}]}},"_links":{"self":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/posts\/1625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/comments?post=1625"}],"version-history":[{"count":0,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/posts\/1625\/revisions"}],"wp:attachment":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/media?parent=1625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/categories?post=1625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/tags?post=1625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}