of 42
8/12/2019 102634133-Work-Flows
1/42
General Definition of Workflow:
The flow of any work or task, which covers the entire cycle of that task, is called Workflow.Example: If you want to apply the leave then you have to fill leave application and sumit the sameto your mana!er. Then after reviewin! your application your mana!er may approve"re#ect yourleave application. This is called workflow of leave.
$racle %pps Workflow Definition:
Workflow is one of the components of $racle %pps, which automates the flow of work"task. Thatcould e purchase order cycle, order mana!ement cycle etc.
This $racle %pps Workflow works on the followin! & '()s.
*. (ules+. (oles. (outin!&. (eal time
I will discuss each '()
1. (ules: This is related to usiness lo!ic. This rule always refers to the re-uirements of theusiness. It tells what to implement y usin! workflow. In $racle %pps these rules areimplemented y rocedures
+. (oles: (ole means who are mainly involved in the activity. /or example in the aove leaveworkflow, 0eave initiator, 1ana!er are called roles in leave workflow. In oracle %ppsworkflow, '(esponsiilities) playin! as roles.
. (outin!: (outin! represents the actual flow of workflow. It tells us how the workflow is!oin!. In workflow dia!ram, the transition lines represent the routin! of the workflow.
&. (eal Time: This ( represents the (eal time concept in the workflow. 2y usin! workflow wecan control the time also. /or example if the leave approval is pendin! with 1ana!er for days then automatically this workflow escalates to next approval authority. 'Time outfeature) of Workflow implements this concept.
3ow I will discuss the different 4omponents of Workflow:
1. Workflow 2uilder: This is the main component of workflow. 2y usin! this component,developers will develop"customi5e the workflow. 6ou can create new workflow from scratchor you can customi5e already existin! seeded workflow.
+. Workflow En!ine: This component mainly controls the entire workflow activities in $racle%pps.
. Workflow Definition 0oader: This component translates the !raphic components to textformat while savin! this workflow in disk as a file and it !ets saved with .wft extension7Workflow Text8. This loader also translates the .wft format to !raphics format whileopenin! the file in workflow uilder.
&. Workflow 3otification En!ine: This component is responsile to send the notifications to theroles defined in workflow. /or example when employee sumits the leave re-uest,workflow notification en!ine sends the leave information as notification to 1ana!er.
8/12/2019 102634133-Work-Flows
2/42
9. Workflow tatus 1onitor: 2y usin! this component, we can see the status of worklowrelated to current transaction.
Overview:
This article will illustrate how to create or define workflow attriutes, notifications, messa!es, roles
or users, functions, processes and last ut not the least, how to launch a workflow from 0";0.The workflow concepts are etter explained usin! an example.
Business Requirement:
When an item is created in inventory, workflowneeds to e launched and it should collect thedetails of the item created and sends a notification to !roup of users alon! with the details and linkto master item form.
Oracle APPS : Workflow Tables
Oracle Applications - Workflow Tables (Quick Review)
Important WF Tables:
wf_user_role_assignments
wf_user_roles
wf_roleswf_items
wf_item_attributes
wf_item_attribute_values
wf_item_attributes_tlwf_activities
wf_activities_tlwf_activity_attributeswf_activity_attributes_tl
wf_activity_transitions
wf_deferredwf_control
WF_!"TIFI#$TI"!_$TT%I&'T()
WF_*())$+()
WF_*())$+()_TWF_*())$+(_$TT%I&'T()
WF_*())$+(_$TT%I&'T()_T
WF_(T)WF_-%"#())_$#TIITI()
WF_$#TIITI() table stores the definition of an activity. $ctivities can be -rocesses,
notifications, functions or folders. $ process activity is a modelled wor/flow process,
which can be included as an activity in other processes to represent a subprocess. $
notification activity sends a message to a performer. $ functions activity performs an
8/12/2019 102634133-Work-Flows
3/42
automated function that is written as a -0) stored procedure. $ folder activity is not
part of a process, it provides a means of grouping activities.
WF_IT(*) is the runtime table for wor/flow processes. (ach row defines one wor/ item
within the system.
WF_IT(*_$TT%I&'T() table stores definitions of attributes associated with a process.
(ach row includes the se2uence in which the attribute is used as well as the format of the
attribute data.
WF_!"TIFI#$TI"!) holds the runtime information about a specific
instance of a sent message. $ new row is created in the table each time a message is sent.
Process flow:When an item is created it will create"insert a record in MTL_SYSTEM_ITEMS_Bsocreate a databasetri!!er on the tale and launch workflow from that tri!!er. %ll you need to do iscreate the workflow, create the tri!!er, pl"sqlpacka!e, roles and finally create an item in inventory.
$pen W/TD and save as new workflow 4reate %ttriutes
4reate /unctions
4reate 3otification
4reate 1essa!es
4reate (oles
4reate dataase tri!!er
4reate 0";0 acka!e
1)Open WFSTD and save as new wor!"ow:
http://erpschools.com/Oracle_Applications_Workflow_Tutorial.asphttp://erpschools.com/Oracle_Applications_Workflow_Tutorial.asp8/12/2019 102634133-Work-Flows
4/42
3avi!ation: /ile
8/12/2019 102634133-Work-Flows
5/42
4lick 2rowse then navi!ate to Workflow installation directory
3avi!ation: Workflow Installation Directory= W/=D%T%=>=W/TD
3ow 4lick /ile
8/12/2019 102634133-Work-Flows
6/42
Enter the fields as elow
Internal 3ame: E(BDE1$
Display 3ame: Erpchools Demo
Description: Erpchools Demo
8/12/2019 102634133-Work-Flows
7/42
3ow you will see Erpchools Demo icon in the 3avi!ator
8/12/2019 102634133-Work-Flows
8/42
Expand the node to see attriutes, processes, notifications, functions, Events, 1essa!es andlookup types.
8/12/2019 102634133-Work-Flows
9/42
Doule click on rocess to open up the properties window as shown elow
8/12/2019 102634133-Work-Flows
10/42
Enter the fields
Internal 3ame: E(4C$$0B($4E
Display 3ame: Erpchools rocess
Description: Erpchools rocess
8/12/2019 102634133-Work-Flows
11/42
8/12/2019 102634133-Work-Flows
12/42
Doule click ErpS#$oo"s %ro#essIcon
8/12/2019 102634133-Work-Flows
13/42
8/12/2019 102634133-Work-Flows
14/42
&'(reate Wor!"ow )ttri*utes:
3avi!ation:Window menu< 3avi!ator
(i!ht click on %ttriutes and click 3ew %ttriute
8/12/2019 102634133-Work-Flows
15/42
Enter the fields
Internal 3ame: ERPBITE1B3>12E(
Display 3ame: Item 3umer
Description: Item 3umer
Type: Text
Default Value: alue 3ot %ssi!ned
http://erpschools.com/Oracle_Applications_Workflow_Attributes.asphttp://erpschools.com/Oracle_Applications_Workflow_Attributes.asp8/12/2019 102634133-Work-Flows
16/42
4lick %pply and then $A
4reate one more attriute
(i!ht click on %ttriutes and click 3ew %ttriute
8/12/2019 102634133-Work-Flows
17/42
Enter the attriute fields
Internal 3ame: E(BE3DBITE1B/$(1B0I3A
Display 3ame: end Item /orm 0ink
Description: end Item /orm 0ink
Type: /orm
alue: I3IDIT1
8/12/2019 102634133-Work-Flows
18/42
4lick %pply and then $A
8/12/2019 102634133-Work-Flows
19/42
+'(reate Wor!"ow Fun#tion:
$pen Erpschools process in That (i!ht click and then click on 3ew /unction
roperties window will open as shown elow
8/12/2019 102634133-Work-Flows
20/42
4han!e"Enter the fields as elow
4han!e Item Type to Standardfrom Erpchools Demo
elect Internal 3ame as Start
(emainin! fields will e populated automatically
8/12/2019 102634133-Work-Flows
21/42
4lick %pply then $A
8/12/2019 102634133-Work-Flows
22/42
%!ain (i!ht click on white spaceand click 3ew /unction
8/12/2019 102634133-Work-Flows
23/42
4han!e the properties as elow
Item Type: tandard
Internal 3ame: E3D
8/12/2019 102634133-Work-Flows
24/42
4lick %pply and then $A
8/12/2019 102634133-Work-Flows
25/42
(i!ht click on white space and then click 3ew /unction
8/12/2019 102634133-Work-Flows
26/42
Enter the fields
Internal 3ame: ERPBGETBITE1BDET%I0
Display 3ame: Get 3ew Inventory Item Details
Description: Get 3ew Inventory Item Details
/unction 3ame: erpschoolsBdemoBpk!.!etBitemBdetails
8/12/2019 102634133-Work-Flows
27/42
4lick %pply and then $A
8/12/2019 102634133-Work-Flows
28/42
,' (reate Wor!"ow -oti!i#ations:
(i!ht click on white spaceand then click 3ew 3otification
8/12/2019 102634133-Work-Flows
29/42
Enter fields
Internal 3ame: ERPBE3DBITE1BDET
Display 3ame: end Item Detials
Description: end Item Detials
1essa!e: ned Item Details 1essa!e
8/12/2019 102634133-Work-Flows
30/42
4lick %pply and then $A
.'(reate Wor!"ow Messa/es:
Rightclick on 1essa!e and click 3ew
http://click.adbrite.com/mb/click.php?sid=523742&banner_id=10873260&variation_id=1147525&uts=1244579774&cpc=302e30313935&keyword_id=121194&inline=y&ab=168296523&sscup=78847b5959ec11a6cac40593b9e333ad&sscra=627069e4616a22d0d326238f7f863cce&ub=1166791973&guid=493771bc-7bde-4afb-9aa5-9430ef7d5800&odc=svx&rs=&r=http://click.adbrite.com/mb/click.php?sid=523742&banner_id=10873260&variation_id=1147525&uts=1244579774&cpc=302e30313935&keyword_id=121194&inline=y&ab=168296523&sscup=78847b5959ec11a6cac40593b9e333ad&sscra=627069e4616a22d0d326238f7f863cce&ub=1166791973&guid=493771bc-7bde-4afb-9aa5-9430ef7d5800&odc=svx&rs=&r=8/12/2019 102634133-Work-Flows
31/42
roperties window will pop upas show elow
8/12/2019 102634133-Work-Flows
32/42
Enter the fields
Internal 3ame: ERPBE3DBITE1BDETB1G
Display 3ame: end Item Details 1essa!e
Description: end Item Details 1essa!e
8/12/2019 102634133-Work-Flows
33/42
Go to 2ody Ta and enter as shown elow
8/12/2019 102634133-Work-Flows
34/42
4lick %pply and then $A
3avi!ation: Window Menu< 3avi!ator
elect Item /orm 0ink %ttriute
8/12/2019 102634133-Work-Flows
35/42
Dra! and drop oth attriutes to ?end Item Details 1essa!e@
0'(reate Ro"es:
%dhoc roles can e created throu!h 0"SQfrom dataase or they can e created from!pplicationsusin! 1ser Mana/ement(esponsiility. If you use 0";0 to create roles make sureyou !ive all user names and role names in >E( case to avoid some prolems
cript to 4reate a %dhoc (ole
cript to %dd user to existin! %dhoc (ole
cript to (emove user from existin! %dhoc (ole
>sin! %dhoc roles in workflow notifications
%dhoc (oles Tales
S#ript to (reate a )d$o# Ro"e
8/12/2019 102634133-Work-Flows
36/42
DE40%(E
lvBrole varchar+7*8 :F 'E(4C$$0BDE1$B($0E)
lvBroleBdesc varchar+7*8 :F ' E(4C$$0BDE1$B($0E)
2EGI3
wfBdirectory.4reate%dCoc(ole7lvBrole,
lvBroleBdesc,
3>00,
3>00,
'(ole Demo for erpschool users),
'1%I0CT10),
'3%1E* 3%1E+H, >E( 3%1E C$>0D 2E I3 4%
3>00,
3>00,
'%4TIE),
3>008
dbms_output.put_line7'4reated (ole) JJ) 'JJlvBrole8
End
"
S#ript to )dd user to a"read2 e3istin/ )d$o# Ro"e
DE40%(E
vBroleBname varchar+7*8
vBuserBname varchar+7*8
2EGI3
vBroleBname :F 'E(4C$$0BDE1$B($0E)
vBuserBname :F '3%1EH
8/12/2019 102634133-Work-Flows
37/42
W/BDI(E4T$(6.%dd>sersTo%dCoc(ole7vBroleBname, vBuserBname8
USER NAMES SHOULD BE in CAPS
E3D
S#ript to Remove user !rom e3istin/ )d$o# Ro"e
DE40%(E
vBroleBname varchar+7*8
vBuserBname varchar+7*8
2EGI3
vBroleBname :F 'E(4C$$0BDE1$B($0E)
vBuserBname :F '3%1EH
W/BDI(E4T$(6.(emove>sers/rom%dCoc(ole7vBroleBname, vBuserBname8USER NAMES inCAPS
E3D
1sin/ )d$o# ro"es in workflownoti!i#ations:
3avi!ation: /ile < 0oad (oles from Database
elect roles you want to use and then click $A.
$pen the notification properties and then navi!ate to node ta, select per!ormeras the role you#ust created and loaded from dataase.
Ta*"es:
W/B($0E
W/B>E(B($0E
W/B0$4%0B($0E
W/B>E(B($0EB%IG31E3T
4'Laun#$in/ wor!"ow !rom %L5S6L:
/irst create a databasetri!!er as elow to call a 0"SQprocedure from which you kick off theworkflow.
(reate Data*ase Tri//er
8/12/2019 102634133-Work-Flows
38/42
4(E%TE $( (E0%4E T(IGGE( ?E(B4C$$0BDE1$BT(IGGE(@ %/TE( I3E(T $3I3.1T0B6TE1BITE1B2 (E/E(E34I3G 3EW % 3EW $0D % $0D /$( E%4C ($W
DE40%(E
lvBid 3>12E( :F :3EW.inventoryBitemBid
lvBitemBse!ment* %(4C%(+7*8 :F :3EW.se!ment*
lvBitemtype %(4C%(+7K8 :F :3EW.itemBtype
lvBuserBid 3>12E( :F L*
lvBitemkey %(4C%(+7*8
lvBor!id 3>12E( :F+
errorBms! %(4C%(+7+8
errorBcode 3>12E(
2EGI3
lvBuserBid :F fndB!loal.userBid
lvBor!id :F fndB!loal.or!Bid
lvBitemkey :F **+ This should be unique value
E(BDE1$.0%>34CBW$(A/0$W7'E(BDE1$)
,lvBitemkey
,)E(4C$$0B($4E) po!ess na"e
,lvBid
,lvBor!id
,lvBitemBse!ment*
8
EM4ETI$3
WCE3 $TCE( TCE3
errorBcode :F ;04$DE
errorBms! :F ;0E((17;04$DE8
8/12/2019 102634133-Work-Flows
39/42
(%IEB!PP"#!$"%&BE(($(7L+*9,errorBms!8
E3D
"
(reate %L5S6L %a#a/e to i#o!! wor!"ow
4(E%TE $( (E0%4E %4A%GE %.E(BDE1$ I
($4ED>(E 0%>34CBW$(A/0$W
7
itemtype I3 %(4C%(+,
itemkey I3 %(4C%(+,
process I3 %(4C%(+,
itemBid I3 3>12E(,
or!Bid I3 3>12E(,
itemBse!ment* I3 %(4C%(+
8
E3D E(BDE1$
"
4(E%TE $( (E0%4E %4A%GE 2$D6 %.E(BDE1$ I
($4ED>(E 0%>34CBW$(A/0$W7
itemtype I3 %(4C%(+,
itemkey I3 %(4C%(+,
process I3 %(4C%(+,
itemBid I3 3>12E(,
or!Bid I3 3>12E(,
itemBse!ment* I3 %(4C%(+
8
8/12/2019 102634133-Work-Flows
40/42
I
vBmasterBformBlink varchar+798
vBitemBnumer varchar+7*8
errorBcode varchar+7*8
errorBms! varchar+798
2EGI3
vBaddBitemBid :F ' ITE1BIDF@' JJ itemBid JJ '@'
vBitemBnumer :F itemBse!ment*
vBmasterBformBlink :F vBmasterBformBlink JJ vBaddBitemBid
W/BE3GI3E.Threshold :F L*
W/BE3GI3E.4(E%TE($4E7itemtype, itemkey, process8
#e$ $he value o% a$$ibu$e assi&ned in 'o(%lo'
vBmasterBformBlink :F wfBen!ine.!etitemattrtext7
itemtype F< itemtype
,itemkey F< itemkey
,aname F< 'E(BE3DBITE1B/$(1B0I3A)8
) assi&n values $o vaiables so $ha$ *ou !an use$he a$$ibu$es
vBmasterBformBlink varchar+798 :F vBmasterBformBlinkJJ):N(EBAE6F@I3E3T$(6@N%BC$(TB3%1EF@I3@ $(GB1$DEF@6@ '
vBmasterBformBlink :F vBmasterBformBlink JJ vBaddBitemBid
se$ $he a$$ibu$e values in 'o(%lo' so $ha$ *ou !an use $he" in no$i%i!a$ions
W/BE3GI3E.etItem%ttrText7itemtype, itemkey, '1%TE(/$(1), vBmasterBformBlink8
W/BE3GI3E.etItem%ttrText7itemtype, itemkey, 'E(BITE1B3>12E(), itemBse!ment*8
s$a$ $he 'o(%lo' po!ess
W/BE3GI3E.T%(T($4E7itemtype, itemkey8
EM4ETI$3 WCE3 $TCE( TCE3
8/12/2019 102634133-Work-Flows
41/42
errorBcode :F ;04$DE
errorBms! :F ;0E((17;04$DE8
add db"s o %nd+ou$pu$ "essa&es as equied
E3D 0%>34CBW$(A/0$W
This po!edue 'ill ,us$ pu$ $he i$e" nu"be in$o 'o(%lo' a$$ibu$e ERP+-TEM+NUMBER
($4ED>(E GETBITE1BDET%I07
itemtype I3 %(4C%(+,
itemkey I3 %(4C%(+,
actid I3 3>12E(,
funcmode I3 %(4C%(+,
resultout $>T 3$4$6 %(4C%(+
8
I
vBGETBITE1B3>12E( %(4C%(+7*8
2EGI3
E0E4T EG1E3T* I3T$ BGETBITE1B3>12E( /($1 1T0B6TE1BITE1B2 WCE(E($W3>1 F*
W/BE3GI3E.etItem%ttrText7itemtype, itemkey,'E(BITE1B3>12E(),vBGETBITE1B3>12E( 8
*ou !an use $he &e$ %un!$ion as belo'.
v+#ET+-TEM+NUMBER /0 '%+en&ine.&e$i$e"a$$$e1$2
i$e"$*pe 03 i$e"$*pe
4i$e"(e* 03 i$e"(e*
4ana"e 03 56+ATTR-BUTE789
resultout:F)4$10ETE:)JJ)6O
exception when others then
dbms_output.put_line7'Entered Exception)8
8/12/2019 102634133-Work-Flows
42/42
fndBfile.putBline7fndBfile.lo!,)Entered Exception)8
E3D GETBITE1BDET%I0
E3D E(BDE1$
"