Anda di halaman 1dari 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 same
to your mana!er. Then after reviewin! your application your mana!er may approve"re#ect your
leave 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. That
could 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 the
usiness. It tells what to implement y usin! workflow. In $racle %pps these rules are
implemented y .rocedures
+. (oles: (ole means who are mainly involved in the activity. /or example in the aove leave
workflow, 0eave initiator, 1ana!er are called roles in leave workflow. In oracle %pps
workflow, '(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 we
can 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 out
feature) 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 scratch
or 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 text
format while savin! this workflow in disk as a file and it !ets saved with .wft extension
7Workflow Text8. This loader also translates the .wft format to !raphics format while
openin! the file in workflow uilder.
&. Workflow 3otification En!ine: This component is responsile to send the notifications to the
roles 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.
9. Workflow :tatus 1onitor: 2y usin! this component, we can see the status of worklow
related 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, workflow needs to e launched and it should collect the
details of the item created and sends a notification to !roup of users alon! with the details and link
to master item form.
Oracle APPS : Workflow Tables
Oracle Applications - Workflow Tables (Quick Review)
Important WF Tables:
wf_user_role_assignments
wf_user_roles
wf_roles
wf_items
wf_item_attributes
wf_item_attribute_values
wf_item_attributes_tl
wf_activities
wf_activities_tl
wf_activity_attributes
wf_activity_attributes_tl
wf_activity_transitions
wf_deferredwf_control
WF_!"TIFI#$TI"!_$TT%I&'T()
WF_*())$+()
WF_*())$+()_T,
WF_*())$+(_$TT%I&'T()
WF_*())$+(_$TT%I&'T()_T,
WF_(T)
WF_-%"#())_$#TI.ITI()
WF_$#TI.ITI() 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
automated function that is written as a -,0)1, 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_B so
create a database tri!!er on the tale and launch workflow from that tri!!er. %ll you need to do is
create the workflow, create the tri!!er, pl"sql packa!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:
3avi!ation: /ile << $pen
4lick 2rowse then navi!ate to Workflow installation directory
3avi!ation: Workflow Installation Directory= W/=D%T%=>:=W/:TD
3ow 4lick /ile <:ave as, Enter ?Erp:chools Demo@ and click $A
(i!ht click on W/:TD and select 3ew Item type
Enter the fields as elow
Internal 3ame: E(.BDE1$
Display 3ame: Erp:chools Demo
Description: Erp:chools Demo
3ow you will see Erp:chools Demo icon in the 3avi!ator
Expand the node to see attriutes, processes, notifications, functions, Events, 1essa!es and
lookup types.
Doule click on .rocess to open up the properties window as shown elow
Enter the fields
Internal 3ame: E(.:4C$$0:B.($4E::
Display 3ame: Erp:chools .rocess
Description: Erp:chools .rocess
Doule click ErpS#$oo"s %ro#ess Icon
&' (reate Wor!"ow )ttri*utes:
3avi!ation:
Window menu < 3avi!ator
(i!ht click on %ttriutes and click 3ew %ttriute
Enter the fields
Internal 3ame: ERPBITE1B3>12E(
Display 3ame: Item 3umer
Description: Item 3umer
Type: Text

Default Value: Dalue 3ot %ssi!ned
4lick %pply and then $A
4reate one more attriute
(i!ht click on %ttriutes and click 3ew %ttriute
Enter the attriute fields
Internal 3ame: E(.B:E3DBITE1B/$(1B0I3A
Display 3ame: :end Item /orm 0ink
Description: :end Item /orm 0ink
Type: /orm
Dalue: I3DIDIT1
4lick %pply and then $A
+' (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
4han!e"Enter the fields as elow
4han!e Item Type to Standard from Erp:chools Demo
:elect Internal 3ame as Start
(emainin! fields will e populated automatically
4lick %pply then $A
%!ain (i!ht click on white space and click 3ew /unction
4han!e the properties as elow
Item Type: :tandard
Internal 3ame: E3D
4lick %pply and then $A
(i!ht click on white space and then click 3ew /unction
Enter the fields
Internal 3ame: ERPBGETBITE1BDET%I0:
Display 3ame: Get 3ew Inventory Item Details
Description: Get 3ew Inventory Item Details
/unction 3ame: erpschoolsBdemoBpk!.!etBitemBdetails
4lick %pply and then $A
,' (reate Wor!"ow -oti!i#ations:
(i!ht click on white space and then click 3ew 3otification
Enter fields
Internal 3ame: ERPB:E3DBITE1BDET
Display 3ame: :end Item Detials
Description: :end Item Detials
1essa!e: :ned Item Details 1essa!e
4lick %pply and then $A
.' (reate Wor!"ow Messa/es:

Right click on 1essa!e and click 3ew
.roperties window will pop up as show elow
Enter the fields
Internal 3ame: ERPB:E3DBITE1BDETB1:G
Display 3ame: :end Item Details 1essa!e
Description: :end Item Details 1essa!e
Go to 2ody Ta and enter as shown elow
4lick %pply and then $A
3avi!ation: Window Menu < 3avi!ator
:elect Item /orm 0ink %ttriute
Dra! and drop oth attriutes to ?:end Item Details 1essa!e@
0'
(reate Ro"es:
%dhoc roles can e created throu!h .0"SQ from dataase or they can e created from
!pplications usin! 1ser Mana/ement (esponsiility. If you use .0":;0 to create roles make sure
you !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
DE40%(E
lvBrole varchar+7*EE8 :F 'E(.:4C$$0:BDE1$B($0E)G
lvBroleBdesc varchar+7*EE8 :F ' E(.:4C$$0:BDE1$B($0E)G
2EGI3
wfBdirectory.4reate%dCoc(ole7lvBrole,
lvBroleBdesc,
3>00,
3>00,
'(ole Demo for erpschool users),
'1%I0CT10),
'3%1E* 3%1E+H, I>:E( 3%1E :C$>0D 2E I3 4%.:
3>00,
3>00,
'%4TIDE),
3>008G
dbms_output.put_line7'4reated (ole) JJ) 'JJlvBrole8G
EndG
"
S#ript to )dd user to a"read2 e3istin/ )d$o# Ro"e
DE40%(E
vBroleBname varchar+7*EE8G
vBuserBname varchar+7*EE8G
2EGI3
vBroleBname :F 'E(.:4C$$0:BDE1$B($0E)G
vBuserBname :F '3%1E,HG
W/BDI(E4T$(6.%dd>sersTo%dCoc(ole7vBroleBname, vBuserBname8G
USER NAMES SHOULD BE in CAPS
E3DG
S#ript to Remove user !rom e3istin/ )d$o# Ro"e
DE40%(E
vBroleBname varchar+7*EE8G
vBuserBname varchar+7*EE8G
2EGI3
vBroleBname :F 'E(.:4C$$0:BDE1$B($0E)G
vBuserBname :F '3%1E,HG
W/BDI(E4T$(6.(emove>sers/rom%dCoc(ole7vBroleBname, vBuserBname8G USER NAMES in
CAPS
E3DG
1sin/ )d$o# ro"es in workflow noti!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!ormer as 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 database tri!!er as elow to call a .0"SQ procedure from which you kick off the
workflow.
(reate Data*ase Tri//er
4(E%TE $( (E.0%4E T(IGGE( ?E(.B:4C$$0:BDE1$BT(IGGE(@ %/TE( I3:E(T $3
I3D.1T0B:6:TE1BITE1:B2 (E/E(E34I3G 3EW %: 3EW $0D %: $0D /$( E%4C ($W
DE40%(E
lvBid 3>12E( :F :3EW.inventoryBitemBidG
lvBitemBse!ment* D%(4C%(+7*EE8 :F :3EW.se!ment*G
lvBitemtype D%(4C%(+7KE8 :F :3EW.itemBtypeG
lvBuserBid 3>12E( :F L*G
lvBitemkey D%(4C%(+7*E8G
lvBor!id 3>12E( :F+G
errorBms! D%(4C%(+7+EEE8G
errorBcode 3>12E(G
2EGI3
lvBuserBid :F fndB!loal.userBidG
lvBor!id :F fndB!loal.or!BidG
lvBitemkey :F **,+G This should be unique value
E(.BDE1$.0%>34CBW$(A/0$W7'E(.BDE1$)
,lvBitemkey
,)E(.:4C$$0:B.($4E::) po!ess na"e
,lvBid
,lvBor!id
,lvBitemBse!ment*
8G
EM4E.TI$3
WCE3 $TCE(: TCE3
errorBcode :F :;04$DEG
errorBms! :F :;0E((17:;04$DE8G
(%I:EB!PP"#!$"%&BE(($(7L+E*9E,errorBms!8G
E3DG
"
(reate %L5S6L %a#a/e to i#o!! wor!"ow
4(E%TE $( (E.0%4E .%4A%GE %..:.E(.BDE1$ I:
.($4ED>(E 0%>34CBW$(A/0$W
7
itemtype I3 D%(4C%(+,
itemkey I3 D%(4C%(+,
process I3 D%(4C%(+,
itemBid I3 3>12E(,
or!Bid I3 3>12E(,
itemBse!ment* I3 D%(4C%(+
8G
E3D E(.BDE1$G
"
4(E%TE $( (E.0%4E .%4A%GE 2$D6 %..:.E(.BDE1$ I:
.($4ED>(E 0%>34CBW$(A/0$W7
itemtype I3 D%(4C%(+,
itemkey I3 D%(4C%(+,
process I3 D%(4C%(+,
itemBid I3 3>12E(,
or!Bid I3 3>12E(,
itemBse!ment* I3 D%(4C%(+
8
I:
vBmasterBformBlink varchar+79EEE8G
vBitemBnumer varchar+7*EE8G
errorBcode varchar+7*EE8G
errorBms! varchar+79EEE8G
2EGI3
vBaddBitemBid :F ' ITE1BIDF@' JJ itemBid JJ '@'G
vBitemBnumer :F itemBse!ment*G
vBmasterBformBlink :F vBmasterBformBlink JJ vBaddBitemBidG
W/BE3GI3E.Threshold :F L*G
W/BE3GI3E.4(E%TE.($4E::7itemtype, itemkey, process8G
#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(.B:E3DBITE1B/$(1B0I3A)8G
) assi&n values $o vaiables so $ha$ *ou !an use$he a$$ibu$es
vBmasterBformBlink varchar+79EEE8 :F vBmasterBformBlinkJJ):N(E:.BAE6F@I3DE3T$(6@
N%..B:C$(TB3%1EF@I3D@ $(GB1$DEF@6@ 'G
vBmasterBformBlink :F vBmasterBformBlink JJ vBaddBitemBidG
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), vBmasterBformBlink8G
W/BE3GI3E.:etItem%ttrText7itemtype, itemkey, 'E(.BITE1B3>12E(), itemBse!ment*8G
s$a$ $he 'o(%lo' po!ess
W/BE3GI3E.:T%(T.($4E::7itemtype, itemkey8G
EM4E.TI$3 WCE3 $TCE(: TCE3
errorBcode :F :;04$DEG
errorBms! :F :;0E((17:;04$DE8G
add db"s o %nd+ou$pu$ "essa&es as equied
E3D 0%>34CBW$(A/0$WG
This po!edue 'ill ,us$ pu$ $he i$e" nu"be in$o 'o(%lo' a$$ibu$e ERP+-TEM+NUMBER
.($4ED>(E GETBITE1BDET%I0:7
itemtype I3 D%(4C%(+,
itemkey I3 D%(4C%(+,
actid I3 3>12E(,
funcmode I3 D%(4C%(+,
resultout $>T 3$4$.6 D%(4C%(+
8
I:
vBGETBITE1B3>12E( D%(4C%(+7*EEE8G
2EGI3
:E0E4T :EG1E3T* I3T$ DBGETBITE1B3>12E( /($1 1T0B:6:TE1BITE1:B2 WCE(E
($W3>1 F*G
W/BE3GI3E.:etItem%ttrText7itemtype, itemkey,
'E(.BITE1B3>12E(),vBGETBITE1B3>12E( 8G
*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$1.0ETE:)JJ)6OG
exception when others then
dbms_output.put_line7'Entered Exception)8G
fndBfile.putBline7fndBfile.lo!,)Entered Exception)8G
E3D GETBITE1BDET%I0:G
E3D E(.BDE1$G
"

Anda mungkin juga menyukai