Beruflich Dokumente
Kultur Dokumente
Workflow Components
1.WorkflowEngine 2.BusinessEventSystem 3.WorkflowMonitor 4.NotificationSystem 5.DirectoryServices 6.WorkflowBuilder 7.NotificationWozrklist
8.WorkflowDefinitionsLoader
9.WorkflowXMLLoader
Workflow Engine
TheWorkflowEngineembeddedintheOracleDatabaseimplementsprocessdefinitionsatruntime. TheWorkflowEnginemonitorsworkflowstatesandcoordinatestheroutingofactivitiesforaprocess. TheWorkflowEngine:
IsembeddedintheOracledatabaseserver
Monitorsthestateofeachactivityinaworkflow process
Signalsanychangesintheworkflowstateusing callstoPL/SQLorJavaAPIs
Business events
TheeventmustberaisedtotheEventManager.
Systems
Systemsthatwillcommunicateeventswitheachothermuststoreeachotherssystem definitionsinordertoaddresseventmessagestoeachother.
Agents
Communicationwithinandbetweensystemsis accomplishedbysendingamessagefromone agenttoanother. EachagentonaWorkflowenabledsystemis associatedwithanAQqueue. TheBusinessEventSysteminteractswiththeagent byenqueuingordequeuingeventmessagesonits queue.
Standard Agents
WhenyouinstallOracleWorkflow,fourstandard agentsareautomaticallydefinedonthelocalsystem. WF_INStandardinboundagent WF_OUTStandardoutboundagent WF_DEFERREDStandardagentfordeferred subscriptionprocessing
WF_ERRORStandardagentforerrorhandling
Workflow Monitor
Allowsmonitoringandadministrationofdefinedworkflowsviastandardwebbrowsercapableofsupporting Java.
Notification System
TheNotificationSystemroutesnotificationstoarole(responsibility)oraspecificuser.Therearethreeways inwhichtoaccessnotificationsemail,webbrowser,orviatheOracleApplications.Themethodinwhichto viewnotificationscanbesetattheuserlevelsoapplicationsuserscanaccessnotificationsviathenotification viewer,travellingsalespeoplecanaccessviaawebbrowseroremail,etc.
Directory Services
OracleWorkflowdoesnotmaintainitsownrepositoryofusersandroles,insteaditconsistsofthreeviews thatpulltheinformationfromavarietyofOracleApplicationstables.Eachviewcontainsthecolumnsthat Workflowneedstoreferencetogetinformationaboutauserorrole.Theseviewsare:
WF_USERS WF_ROLES
WF_USER_ROLES
Notification Worklist
TheNotificationWorklistisafeaturethatprovidesalistofopennotificationsforaparticular
NewSelfServiceWebPageFormat
TheOracleWorkflowwebpagesarebeingconvertedtothenewformatforOracleselfservice webapplications.DependingonyourversionofOracleWorkflowandwhichpatchesyouhave applied,youmayseeOracleWorkflowwebpagesinthepreviousformatorinthenewformat. Currently,theNotificationsWorklistandtheNotificationRuleswebpagesareavailableinthe newformatfortheversionofOracleWorkflowembeddedinOracleEBusinessSuite.
Workflow XMLLoader
Workflow Processes
OracleWorkflowmanagesbusinessprocessesaccordingtorulesthatyoudefine.Therules,whichwecalla workflowprocessdefinition,includetheactivitiesthatoccurintheprocessandtherelationshipbetween thoseactivities. AnactivityinaprocessdefinitioncanbeanautomatedfunctiondefinedbyaPL/SQLstoredprocedureoran externalfunction,anotificationtoauserorrolethatmayoptionallyrequestaresponse,abusinessevent,ora subflowthatitselfismadeupofamoregranularsetofactivities. AworkflowprocessisinitiatedwhenanapplicationcallsasetofOracleWorkflowEngineAPIs. TheWorkflowEnginetakesoverbydrivingtherelevantworkitemdefinedbytheapplication,througha specificworkflowprocessdefinition. Accordingtotheworkflowprocessdefinition,theWorkflowEngineperformsautomatedstepsandinvokes appropriateagentswhenexternalprocessingisrequired. Thefollowingdiagramdepictsasimplifiedworkflowprocessdefinitionthatroutesarequisitiontoamanager
orsetofmanagersforapproval.
Electronic Notifications
OracleWorkflowletsyouincludeusersinyourworkflowstohandleactivitiesthatcannotbeautomated,such asapprovalsforrequisitionsorsalesorders.TheNotificationSystemsendsnotificationstoandprocesses responsesfromusersinaworkflow.
Electronic MailIntegration
Electronicmail(email)userscanreceivenotificationsofoutstandingworkitemsandcanrespondtothose notificationsusingtheiremailapplicationofchoice.Anemailnotificationcanincludeanattachmentthat providesanothermeansofrespondingtothenotification.
InternetEnabled Workflow
AnyuserwithaccesstoastandardWebbrowsercanbeincludedinaworkflow.Webuserscanaccessa NotificationWebpagetoseetheiroutstandingworkitems,thennavigatetoadditionalpagestoseemore detailsorprovidearesponse.
Routing Information
Businessprocessestodayinvolvegettingmanytypesofinformationtomultiplepeopleaccordingtorulesthat areconstantlychanging.Withsomuchinformationavailable,andinsomanydifferentforms,howdoyouget therightinformationtotherightpeople?OracleWorkflowletsyouprovideeachpersonwithallthe informationtheyneedtotakeaction.OracleWorkflowcanroutesupportinginformationtoeachdecision makerinabusinessprocess,includingpeoplebothinsideandoutsideyourenterprise.
File Edit
Navigator Toolbar
TheNavigatortoolbarincludesthefollowingbuttonswhichapplyonlytoobjectsselectedfromthenavigator tree:
NewStore
Createsanewdatastorebranchinthenavigatortree.
DeveloperMode
TogglesbetweenDeveloperandPresentationdisplay. Find
DisplaystheSearchwindowtospecifythesearchcriteriatolocateanobjectinthenavigatortree.
QuickStartWizard
RunstheQuickStartWizardtobegincreatingaworkflowprocessdefinition.
Help
DisplayshelponhowtouseOracleWorkflow.
NewObject
Createsanewobjectdependingontheobjectbranchyouselect(itemtype,Processes,Notifications, Functions,Messages,orLookupTypes)bydisplayingthepropertypageforthatobjecttype.
PrintDiagram
Printsthecurrentprocessdiagram.
NewProcess
Displaystheprocessactivitynodepropertypageforyoutocreateanewprocessactivity.
NewNotification
Displaysthenotificationactivitynodepropertypageforyoutocreateanewnotificationactivity.
NewFunction
Displaysthefunctionactivitynodepropertypageforyoutocreateanewfunctionactivity.
NewEvent
Displaystheeventactivitynodepropertypageforyoutocreateaneweventactivity.
DeleteSelection
Deletestheselectedobject. Properties Showsthepropertypagesoftheselectedobject.
DeveloperMode
TogglesbetweenDeveloperandPresentationdisplay.
Find
DisplaystheprocessOverviewwindow.
ShowInstanceLabels
DisplaystheinstancelabelofthenodeasthenodeactivitylabelintheProcesswindow.
ShowInternalNames
DisplaystheinternalnameofthenodeasthenodeactivitylabelintheProcesswindow.
ShowDisplayNames
DisplaysthedisplaynameofthenodeasthenodeactivitylabelintheProcesswindow.
ShowComments
DisplaysthecommentsofthenodeasthenodeactivitylabelintheProcesswindow.
ShowPerformers
DisplaystheperformerofthenodeasthenodeactivitylabelintheProcesswindow. Help
DisplayshelponhowtouseOracleWorkflow.
Standard Activities
TheStandarditemtypeincludesfunctionandnotificationactivitiesprovidedbyOracle Workflowthatcanbeincludedinprocessdiagramsassociatedwithotheritemtypes.These activitiesinclude: And Or CompareDate CompareNumber CompareText
CompareExecutionTime Wait Block DeferThread LaunchProcess Noop LoopCounter Start End RoleResolution Notify VoteYes/No
Differentdesignmethods:
TopDownDesign:Ifyouprefertoapproachyour
designfromahighlevel,youcanfirstsketchout theprocessdiagramwithactivities,andthengo backlatertocreatethesupportingobjectsforeach activity.
CreatingaNewProcessfromTopDown
1.UsetheQuickStartWizardtocreatetheprocess framework,includingtheitemtypeandinitialproces activity.
CreatingaNewProcessfromBottomUp
1.Definetheitemtypeoftheprocess. 2.Definetheitemtypeattributesfortheprocess. 3.Definelookuptypesandlookupcodes. 4.Definemessages. 5.Definemessageattributes. 6.Definefunction,notification,event,orprocess activities. 7.Diagramtherelationshipoftheactivities.
CreateaworkflowprocessintheOracleWorkflowBuilderusingtheQuickStart Wizard:
1.StarttheOracleWorkflowBuilder.
2.FromtheFilemenu,chooseQuickStartWizard.
3.
Definethefollowingpropertiesforthenewitemtype:
InternalName:WFVACXX
DisplayName:XXVacationProposal
PersistenceType:Temporary
NumberofDays:5
Definethefollowingpropertie fortheprocess:
InternalName:WFVACXX_PROCESS
DisplayName:XXVacationProposalProcess
ChooseOK . 4.CreatenotificationactivitynodesforVacationProposal,VacationRejectedFYI,and
VacationApprovedFYInotificationactivities.
Foreachnotification,clicktheNewNotificationbuttonintheprocessdiagram
windowtoolbar,andthenclickanopenspotinthediagrambetweentheStartand
Endnodes
Inthenodepropertieswindowforeachnotification,enteraninternalnameand
displaynameandchooseanicon.FortheVacationProposalnotification,selectthe ApprovallookuptypethatisprovidedintheStandarditemtypeastheResultType
fortheactivity.ThenchooseOK.
5.CreateanewEndnodebydraggingtheEndfunctionfromtheStandarditemtypeinthe
navigatortreeintotheprocessdiagramwindow.DoubleclickthenewEndnodeand
choosetheNodetab.IntheStart/Endfield,selectEnd.
6.Intheprocessdiagram,drawtransitionsbetweenthenodesintheprocesstoindicatethe
processflow.Todrawatransition,clickthesourceactivity,holddowntherightmouse
button,dragthecursortothedestinationactivity,andreleasetherightmousebutton.For
transitionsfromtheVacationProposalnode,choosetheappropriateresultfromthe
resultsmenuthatappears.
7.SelecttheXXVacationProposalProcessinthenavigatortree,rightclicktheprocess
activity,andchoosePropertiestoopenthepropertypagesfortheprocess.
8.ChoosetheActivitytabandselectApprovalastheresulttypefortheprocess.Then
chooseOK.
9.DoubleclicktheEndnodethatfollowstheVacationRejectedFYInodeandchoosethe
Nodetab.SelectRejectintheResultfield.
10.DoubleclicktheEndnodethatfollowstheVacationApprovedFYInodeandchoosethe
Nodetab.SelectApproveintheResultfield.
11.IntheNavigatorwindow,clicktheVerifybuttontoverifyyourworkflow.Becauseyou
havenotyetdefinedtheunderlyingcomponentsforyourprocess,theWorkflowError
windowdisplayswarningsforvalidationchecksthattheprocessdoesnotyetsatisfy.
Reviewtheerrormessagestolearnabouttheerrors.Inlaterpractices,youwilladd
additionalfunctionalitytoyourworkflowtoeliminatetheseerrors.ClickCanceltoexit
theWorkflowErrorwindow.
12.FromtheFilemenu,chooseSaveAsandsaveyournewdatastoreanditemtypetoa
workflowdefinitionfilenamedwfvacXX.wft.TheOracleWorkflowBuilderwillverify
yourworkflowagain.ClickSaveintheWorkflowErrorwindowtofinishsavingthe
workflowdefinition.
Dependingontheworkflowprocessyouwishtocreate,youneedtodefineallorsomeofthefollowingtypes ofcomponentstomakeuptheprocess:
FormTheattributevalueisanOracleApplicationsinternalformfunctionnameanditsoptionalform
functionparameters.ThisattributetypeisnotrelevantforthestandaloneversionofOracleWorkflow.
Role Theattributevalueistheinternalnameofarole.Ifamessageattributeoftyperoleisincludedina notificationmessage,theattributeautomaticallyresolvestotherole'sdisplayname,eliminatingtheneedfor youtomaintainseparateattributesfortherole'sinternalanddisplaynames. Attribute Theattributevalueistheinternalnameofanotherexistingitemtypeattributethatyouwanttomaintain referencestoinaprocess. Event TheattributevalueisaBusinessEventSystemeventmessageinthestandardWF_EVENT_Tstructure. ItemTypePropertyPage
DefiningItemTypesandAttributes
ToCreateanItemType
1. Openanexistingdatastoreor,selectNewfromtheFilemenutocreateanewdatastoretodefinethis
newitemtype.ThendefineanewitemtypeinthenavigatortreebychoosingNewItemTypefrom theEditmenu.AnItemTypepropertypageappears.
2. EnteratranslatableDisplayNamethatislongerandmoredescriptive.Youcanalsosupplya
descriptionfortheitemtype.
3. SpecifyapersistencetypeofTemporaryorPermanent.IfyousetthepersistencetypetoTemporary,
thenspecifythenumberofdaysfromthetimetheiteminstancecompletesbeforeitsstatusaudittrail canbepurged.
4. Ifyouritemtypehasorwillhavemorethanoneworkflowprocessassociatedwithit,youmayspecify
aselectorfunctionusingthesyntax<package_name>.<procedure_name>.Theselectorfunctionisa PL/SQLstoredprocedurethatautomaticallyidentifiesthespecificprocessdefinitiontheWorkflow Engineshouldexecutewhenaworkflowisinitiatedforthisitemtype.Youcanalsoextendthe selectorfunctiontobeageneralcallbackfunctionthatresetscontextinformationeachtimethe WorkflowEngineestablishesanewdatabasesessiontoexecuteactivities.
5. ChooseApplytosaveyourchanges. 6. SelecttheRolestabpagetospecifytherolesthathaveaccesstothisitemtype.(Thisfunctionalitywill
besupportedinafuturerelease.)
7. SelecttheAccesstabpagetosettheaccessandcustomizationlevelsforthisitemtype. 8. ChooseApplytosaveyourchanges,OKtosaveyourchangesandclosethepropertypageorCancelto
cancelyourchangesandclosethepropertypage.
9. Asecondarybranchappearsinthenavigatortreethatrepresentstheitemtypeyoujustcreated.You
canrevieworeditthepropertiesofthisitemtypeatanytimebydoubleclickingontheitemtypein thenavigatortreeorbyselectingtheitemtypeandchoosingPropertiesfromtheEditmenu.
10.
ToDefineanItemTypeorActivityAttribute
1. Tocreateanitemtypeattribute,selectanitemtypeinthenavigatortree,thenchooseNewAttribute
fromtheEditmenu. ItemTypeAttributePropertyPage Tocreateanactivityattribute,selectanactivityinthenavigatortreeandchooseNewAttributefrom theEditmenu. ActivityAttributePropertyPage AnAttributepropertypageappearsinbothcases.
2. ProvideanInternalNameinalluppercasewithnoleading/trailingspaces.AllOracleWorkflowAPIs,
SQLscripts,andPL/SQLproceduresrefertotheinternalnamewhenidentifyinganattribute.
URLSpecifyanoptionalUniversalResourceLocator(URL)toanetworklocationinthe
DefaultValuefieldandspecifytheframetargetfortheURL.
FormThisattributeisrelevantonlyfortheversionofOracleWorkflowembeddedinOracle
Applications.
DocumentEnteranoptionalstringthatidentifiesthedocumentinthedefaultvaluefield.
Note:TheFrameTargetfieldisnotapplicableforattributesoftypedocument.Fordocumentattributes,this fieldisreservedforfutureuse.
RoleSpecifyarolename. AttributeSpecifythenameofanitemtypeattributethatyouwanttomaintainreferencesto
inaprocessbychoosingfromthelistofexistingitemtypeattributes.
EventIfyouaredefininganitemtypeattribute,youcannotspecifyanydefaultvalueforan
eventattribute.Ifyouaredefininganactivityattribute,youcanonlyspecifyaneventitem typeattributeasthedefaultvalue.
7. Foritemtypeattributes,theoptionaldefaultvalueisaconstantthatyouenterorselectfromalistof
values.Theconstant,however,maybeatextstringthatallowsfortokensubstitutionatruntime.
8. ChooseApplytosaveyourchanges,OKtosaveyourchangesandclosethepropertypage,orCancel
tocancelyourchangesandclosethepropertypage.
9. Ifyouaredefininganitemtypeattribute,selecttheAccesstabpagetosettheaccesslevelsallowedto
modifythisattribute.Activityattributesassumetheaccess/protectionleveloftheirparentactivity.
10. 11.
ChooseApplytosaveyourchanges.
Standard Functions
OracleWorkflogooglewBuildercomesequippedwithseveralbuiltinworklowsanddemos,oneofwhichis WF_STANDARD,aworkflowprocessdefinitionusedtodefinestandardfunctionsusablewithinother workflowprocessdefinitions. WF_STANDARDincludesfunctionssuchas: Andfunctionfacilitatingtherendezvousofparallelthreads,flowwillnotcontinueuntilalltransitionstothe functionarecompleted Orfunctionfacilitatingtherendezvousofparallelthreads,flowwillcontinuewithcompletionofthefirst transitiontothefunction LoopCounterfunctionusedtocountthenumberoftimesaloopingflowhastransitionedthrough,allows continuationorexitoftheloopingflowbasedoncounter Comparisonoperationsfunctionsusedtocomparedate,text,andnumbervaluestocorrespondingitem attributetypes,allowsbranchingbasedontheresultofthecomparison XMLGetTagValuefunctionfacilitatingtheretrievalofdatafromaneventattributeandstorageinanother itemattribute XMLComparisonoperationssimilartoregularcomparisonoperations,exceptthecomparisonsutilizedata retrievedfromeventsforpathdetermination Assignfunctionallowingavalueforanitemattributetobesetwithintheworklfowprocessatruntime Waitfunctionthatwillholdatransitionfromcompletionuntilaspecifiedperiodordatehaspassed DeferThreadfunctionusedtoforceallfollowingactivitiesonthesamethreadtobedeferredforthe backgroundenginetorun
Standard APIs
ThereisanentirelibraryofstandardAPIs,buthereareafewexamples wf_engine.CreateProcesscreatesaninstantiationofthespecifiedworkflowprocess wf_engine.StartProcessinitiatesthecreatedworkflowprocess(usedintandemwithCreateProcess) wf_engine.backgroundrunsaonetimebackgroundengine wf_engine.SetItemAttrTextusedtosetthevalueofatextitemattributewithinaworkflowprocess externallyfromPL/SQL wf_engine.GetItemAttrTextusedtoretrievethevalueofatextitemattributefromwithinaworkflow processandreturnittoPL/SQL AnothertypeofstandardAPIistheuserdefinedfunction/procedurehavingpredefinedparametersand returntypes(whereapplicable) Aprocedurewiththefollowingparameterlistcanbecalledfromwithinaworkflowprocessandgivenauser specifiedname
funcmode INVARCHAR2,