Advanced Workflow Article

download

of 49

  • date post

    18-Nov-2014
  • Category

    Documents
  • view

    668
  • download

    1

Embed Size (px)

transcript

ecmarchitect.com

AlfrescoDeveloper:AdvancedWorkflowsNovember,2007JeffPotts

ThisworkislicensedundertheCreativeCommonsAttributionShareAlike2.5License.Toviewacopyofthislicense, visithttp://creativecommons.org/licenses/bysa/2.5/orsendalettertoCreativeCommons,543HowardStreet,5thFloor, SanFrancisco,California,94105,USA.

ecmarchitect.comAlfrescoDeveloper:AdvancedWorkflowsNovember2007

JeffPotts

TableofContentsIntroduction...........................................................................................................................................4 Whatisaworkflow?.............................................................................................................................4 Workflowoptions.............................................................................................................................6 Alfrescoworkflow............................................................................................................................7 jBPMconcepts......................................................................................................................................9 Deployingprocesses............................................................................................................................18 WiringaprocesstotheAlfrescoUI....................................................................................................20 Defineaworkflowspecificcontentmodel....................................................................................21 Updatewebclientconfigcustom.xml...........................................................................................23 Externalizethestrings....................................................................................................................23 Implementationsummary....................................................................................................................24 SomeCoWhitepapersubmissionexample..........................................................................................25 Businessprocessdescription..........................................................................................................25 Highlevelsteps.............................................................................................................................25 Step1:Implementthebasicflowandworkflowuserinterface.....................................................26 Step2:Implementwebscriptsandactions....................................................................................40 Step3:Addatimertothethirdpartytask.....................................................................................47 Step4:Configuretheworkflowsfordeployment..........................................................................48 Conclusion...........................................................................................................................................48 Deployingandtesting..........................................................................................................................49 Wheretofindmoreinformation..........................................................................................................49 Abouttheauthor..................................................................................................................................50

AlfrescoDeveloper:AdvancedWorkflowsThisworkislicensedundertheCreativeCommonsAttributionShare Alike2.5License

Page2of49

ecmarchitect.comAlfrescoDeveloper:AdvancedWorkflowsNovember2007 JeffPotts

IntroductionThisarticleisabouttheadvancedworkflowfunctionalityavailableinAlfrescothroughitsembedded JBossjBPMworkflowengine.First,becauseworkflowcanmeandifferentthingstodifferentpeople, I'lltalkaboutmydefinitionoftheterm.Then,I'lldiveintofundamentaljBPMconceptsthatwillhelp youunderstandhowprocessesaredefinedandhowtheworkflowengineactuallyworks.(Thosewho usejBPMseparatefromAlfrescomightevenfindthissectionhelpful).Oncethatfoundationisin place,I'llwalkthroughanexamplethatfeaturesmanyofthedifferentconcepts. TheexamplecontinuestheSomeCoexamplescoveredinearlierpapers.Init,we'llimplementa businessprocessthathelpsSomeCoroutewhitepapersforreviewandapprovalbyinternalaswellas externalparties.

Whatisaworkflow?WhenAlfrescoreleasedversion1.4oftheproduct,theymadeahugeleapforwardinenterprise readiness.ThatwasthereleasewhenAlfrescoembeddedtheJBossjBPMengineintotheproduct whichmeantthatenterprisescouldrouteAlfrescorepositorycontentthroughcomplexbusiness processes.Acontentrepositorywithouttheabilitytofacilitatebusinessprocessesthatproduce, consume,ortransformthecontentwithinitislittlemorethanaglorifiedfileserver,sothiswasa welcomeaddition. Butbeforewegeekoutonthewondersofgraphbasedexecutionlanguageslet'sagreeonwhattheterm workflowmeans.Generically,aworkflowisareliablyrepeatablepatternofactivityenabledbya systematicorganizationofresources...thatcanbedocumentedandlearned1.Thetermhasbeenaround sincepeoplestartedstudyingthenatureofworkintheearly20thcenturyinanefforttostreamline1 http://en.wikipedia.org/wiki/Workflow

AlfrescoDeveloper:AdvancedWorkflowsThisworkislicensedundertheCreativeCommonsAttributionShare Alike2.5License

Page3of49

ecmarchitect.commanufacturingprocesses. Infact,intheworldofECM,itissometimeshelpfultothinkofanassemblylineormanufacturing processwhenthinkingabouthowcontentflowsthroughanorganization.Contentisbornofraw material(data),shapedandmoldedbyoneormorepeople(collaboration)ormachines(systems), reviewedforquality,anddeliveredtoconsumers.Contentmaygothroughasingleprocessormany subprocesses.Contentmaytakedifferentroutesthroughaprocessbasedoncertainaspectsofthat content.Theoutputofanorganizationordepartmentofknowledgeworkersisessentiallythecontent thatcomesrollingofftheassemblyline(thecollectionofworkflowsthatdefinethatorganization's businessprocesses). Althoughnotalwaysformalizedorautomated,almosteveryoneinmodernsocietyhasbeeninvolvedin aworkflowinsomeway:

Whenyousubmitaninsuranceclaim,youareinitiatingaworkflow. Ifyouwitnessdrunkanddisorderlyconductonanairlineflightandareaskedtoprovidea statementtotheairline,youareparticipatinginaworkflow.(Seriously,ithappensmoreoften thanyou'dthink). Whenyoucheckonthestatusofyourloanapplication,youareaskingformetadataabouta runningworkflow. Whensomeonebringsyouacapitalrequestthatrequiresyourapprovalbecauseitisovera certaindollaramount,acharacteristicofthatrequest(thedollaramount)hastriggereda decisionwithintheworkflowthatroutesthecapitalrequesttoyou. Whenyougivethefinalapprovalforapieceofwebcontenttobepublished,itislikelyyouare completingaworkflow.

Asvariedastheseexamplesare,allofthemhaveacoupleofthingsincommonthatmakethem relevanttoECM:(1)Theyareexamplesofhumantohumanand,insomecases,humantomachine interactionand(2)Theyarecontentordocumentcentric. Thesearetwoveryimportantcharacteristicsthathelpclarifythekindofworkflowwe'retalkingabout. Therearestandaloneworkflowengines(infact,jBPMisoneofthem)thatcanbeusedtomodeland executeallsortsofrepeatablepatternsofactivity,withorwithoutcontent,butintheECMspace,the

AlfrescoDeveloper:AdvancedWorkflowsThisworkislicensedundertheCreativeCommonsAttributionShare Alike2.5License

Page4of49

ecmarchitect.compatternswecaremostaboutarethosethatinvolvehumansworkingwithcontent.1

WorkflowoptionsSomeofyouaresaying,You'reright.Workflowsareeverywhere.Icouldreallystreamlinemy organizationbymovingprocessescurrentlyimplementedwithemail,phonecalls,andcubicaldrive bysintoamoreformalizedworkflow.Whataremyoptions?Let'stalkaboutthree:Rollyourown, Standaloneworkflowengines,andEmbeddedworkflowengines. Rollyourown.Peopleareoftentemptedtomeettheirworkflowrequirementswithcustomcode.Very basicsystemsmightbeabletogetbywithasingleflagonarecordoranobjectthatdeclaresthestatus ofthecontentlikeDraftorInRevieworApproved.Butflagsonlycapturethestateofapiece ofcontent.Ifyouwanttoautomatehowcontentmovesfromstatetostate,thecodingandmaintenance becomesmorecomplex.Sure,youcanwritecodeaspartofyourapplicationthatknowsthatonceDraft documentsaresubmittedforreview,theyneedtogotoPurchasingfirstandthentoFinance,ifand onlyiftherequestedcashoutlayismorethan$10mbutdoyoureallywantto? Peopleintentonrollingtheirownworkflowoftenrealizethemaintenanceproblemthiscreates,sothey createanabstractionusedtodescribetheflowfromstatetostatethatkeepsthemfromembeddingthat logicincompiledcode.Oncethey'vedonethat,though,they'veessentiallycreatedtheirown proprietaryworkflowenginethatnooneelseintheworldknowshowtorunormaintain.Andwithall oftheopensourceworkflowenginesavailable,whywouldyouwanttodothat?Sotherollyourown optionisreallynotrecommendedforanybutthemostbasicworkflowrequirements. Standaloneengines.Thereareanumberofstandaloneworkflowenginessometimesmorebroadly referredtoasBPM(BusinessProcessManagement)bothopensourceandproprietary.Theseare oftenextremelyrobustandscalablesolutionsthatcanbeusedtomodel,simulate,andexecuteany processyoucanthinkoffromhighvolumeloanprocessingtocallcenterqueuemanagement.Often, theseworkflowenginesareimplementedinconjunctionwitharulesenginewhichletsbusinessusers havecontrolovercomplicatedifthenelsedecisiontrees. Standaloneenginesaremostappropriateforextremelyhighvolumeorexceedinglycomplexsolutions1 Ofcoursedocumentcentricworkflowsmayincludefullyautomatedstepsandmachinetomachineinteractionsthe pointisthatdocumentcentricworkflowsinwhichhumansreview,approve,orcollaborateinsomewayareinthescope ofthediscussionwhileprocesseswhichrunlightsoutsystemtosystemorchestrationorintegrationarenot.

AlfrescoDeveloper:AdvancedWorkflowsThisworkislicensedundertheCreativeCommonsAttributionShare Alike2.5License

Page5of49

ecmarchitect.cominvolvingmultiplesystems.Anothergooduseforstandaloneenginesiswhenyouaredevelopinga customapplicationthathasworkflowrequirements.Standaloneenginescanusuallytalktoany databaseorcontentmanagementr