Home

Nova Bonita Workflow

image

Contents

1. Workflow Hook Short Rollback Without Name Name Rollback task onReady TOR X X Task onStart TOS X X Task onFinish TOF X X task onSuspend TOS X X task onResume TORE X X automatic onEnter AOE X X In Table 3 2 two of the hooks have a Rollback tag This means that if an error occurs during execution see Section 3 5 1 to determine how to signify that an error has occurred all transactions performed on the Workflow level are rolled back e g activity variables changed during the hook execution are reset to their previous values to the beginning state of the transaction Be aware that no external actions performed by the hook are rolled back The Workflow engine has no way to determine the potential effect of the actions performed in the hook thus it is the hook developer s responsibility to anticipate and respond to possible failures during hook execution Hooks Execution Time Scale In a client driven Workflow context meaning a java program using the Workflow engine API Hooks are leveraged to link processes with already existing applications Hook calls executions are performed by the workflow engine itself meaning that Hooks are always executed at workflow server side so they should not be used to communicate with client applications i e opening a browser However previous behavior could be achieved in a standalone Nova Bonita deployment meaning a deployment in which the workflow eng
2. Java ApprovalWorkflow stc xpdUApprovalWorkflow 1 0 xpdl Eclipse SDK Jog Fie Edt Navigate Search Project Codegeneration Run Window Help 3 r3 ll 0O Q 5 amp g Bie ee ev e EE ave ke nmo t HE Packa fg Hierar x Navig gt 7 O ApprovalWorkflow_1 0 xpdl ApprovalWorkflow 1 0 23 a a7 LE Approvalworkflow amp E bar amp E bin e e ib E bonita core 4 0 RC3 jar E novaBpmuti r996 jar SS src forms S java S S xpd fApprovalWorkfiow_1 0 xpdi R classpath X project E Activity Participant XPDL i Problems 3 Javadoc Declaration E udin 0 errors 0 warnings 0 infos Description Resource Path Location CN m C5 ERO ApprovalWorkflow src xpdllApprovalWorkflow 1 0 xpdl Figure 2 6 Workflow process definition through ProEd Time now to show some other interesting capabilities of this plugin how to create hooks mappers performerAssigns and Multi instantiators java entities Those three java entities can be created in a unified way Just select the java directory in your workflow project and click right then go to New Other and select the workflow java entity you want to create Sew Jes Select a wizard gt Wizards type filter text G Class amp Interface es Java Project Java Project from Existing Ant Buildfile s Plug in Project amp General amp Bonita Workflow t Ne
3. M Al 2 5 8 Adding Hookeren ran duse tieni tecta edited tente teda S E E A 42 Introductionito Hooks epi ree Get dd ne RE MERE EUR EA NEE 48 3 1 1 Hooks Execution Time Scale deeper dete ertet eleg cantor ELOA 48 3 1 2 Out of Timescale Hooks eere tenerent tentent treten tenerent tentent 49 Hooks Capabilities o eaan ec eat ghee ae EEEE n E ide ins eee 49 3 2 1 Workflow Related Hook Actions tenente treten tenente tenentes 49 3 22 Java Environment Related Hook Actions ssseeee tette terere 50 ab dnm 5 3 3 1 Fault Management certe RO RE IRI RR RIEN EHE TORUM E ERE Pede 5 3 3 2 Activity Hooks and Transactions tenete tenerent tentent 53 ya daimepelin ero d C 53 Hooks Specitic Operations inier reete teet pee e tte ea e RT nen 53 Caveat Regarding Activity Deadline sess tt tentent 54 VERET 54 37 1 LWIJ ah Hn 54 3 7 2 A More Complex Hook cite eir erede eee ck legere ive Ee Lo edd eee e ea ERR dain 54 Practical Steps for Hooks Usage tenerent tentent tette tte teens 56 3 8 1 Hook Loading and Compiling eene tentent tenente tentent 56 3 8 2 Hooks deploymeril iere tete ceto reader esa d reet a S 56 Vint reto eet RE DETROIT CDL PL NODI EN 57 AZ Wire e Mapp TREE TREE EE ETT 57 4 2 1 Mapper Type
4. Remove Allow output Folders for source Folders Default output Folder ApprovalWorkflow bin Figure 2 2 Editing Java settings Click on the Finish button when you are done and this wizard will create a new project in Eclipse with the following structure C Navigator 3 E curii E es o lib Eil bonita core 4 0 RC3 jar Eil novaBpmUtil r996 jar S src amp Forms amp java gt xpdl Ei classpath Eil Project Figure 2 3 Workflow project structure In this sample ApprovalWorkflow was given as the name of the project As you can see this wizard has automatically added required libraries to automatically compile java related workflow entities Let s now focus on the workflow process definition For that select the xpdl directory and click right button on New gt Other This will show you the following dialog 12 Bonita Workflow Development Guide Select a wizard Wizards type Filter text S S Bonita Workflow Ny New Bonita Hook t New Bonita Performer Assign Ea New Bonita Project t New Bonita Role Mapper i N New Bonita Transactional Hook W E BPEL 2 0 He cvs H Eclipse Modeling Framework H EJB H E EMFT JET Transformations Example EMF Model Creation Wizards amp J2EE lt Back Finish Figure 2 4 Creating a New XPDL file In this dialog ProEd allows you to automatically create among other options a XPDL file
5. Add participant x E La IV Existing Participants LDAP Search Filter v Select participant Name Type Description New Participant Name a Type Role Human Organizational Unit C System Description gt Mapper Type Class Mame X Cancel Figure 2 26 ProEd Add Participant Window IEJ Note The Existing participants checkbox is unavailable if no connection to the server is available 34 Bonita Workflow Development Guide LDAP Search Click the LDAP Search button the Participant Search window appears Protd Participant Search Lx sinis nome ETIN Search Operation 15 equal Y Value Figure 2 27 Add Participant Search Window Enter data in the Value field to search participants The User Directory can be searched on the following attributes UserID Common Name Surname Given Name Then click the OK button The search results appear in the Select participant area The Mapper Type field in the Mapper area at the bottom of the window displays LDAP Filter Search Browse the Filter drop down menu to filter participants by type Role Human Organizational Unit or System The filter results appear in the Select participant area In the Select participant area select the desired Participant Role Person Organization or System Click OK to add the Par
6. gt Wizards type Filter text es Java Project c X Java Project from Existing Ant Buildfile as Plug in Project General amp Bonita Workflow ER BPEL 2 0 cvs Eclipse Modeling Framework EB EMFT JET Transformations J2EE Java amp Maven Im ect RE DDE l Figure 2 1 Creating a New Workflow Project Then select the New Bonita Project feature and click Next In the next dialog you are allowed to introduce the name of your workflow project as well as the directory name in which the bar file will be generated Once finished click on Next and you will be redirected to the Java Settings dialog In this dialog the wizard will suggest you a default directory structure for your workflow project composed by e forms directory default directory in which forms associated to manual activities will be stored e java directory default directory in which you could add java related workflow entities such hooks mappers performers assignments and Multi instantiators e xpdl directory default directory to store xpdl files Chapter 5 Performer Assignment n Java Settings Define the Java build settings 9 Source zz Projects ES Libraries l gt Order and Export Source Folders on build path E E Approvalworkflow src forms new Add Folder E E ApprovalWorkflow src java new gt E E ApprovalWorkflow sre xpdl new Edit
7. ow2 ow2 ow2 bonita bonita bonita bonita bonita Bonita Workflow Development Guide definition TxHook facade facade facade facade APIAccessor QueryRuntimeAPI runtime ActivityBody runtime ActivityInstance naming InitialContext mail Session mail Address mail Transport mail internet InternetAddress import javax mail internet MimeMessage public class Accept implements TxHook public void execute APIAccessor accessor ActivityInstance ActivityBody activityInstance throws Exception QueryRuntimeAPI runtime accessor getQueryRuntimeAPI String mailString String runtime getActivityVariable activityInstance getUUID Email address obtain JNDI initial context InitialContext ctx new javax naming InitialContext use JNDI lookup to obtain Session in the context of an application server Session session javax mail Session ctx lookup java comp env mail MailSession MimeMessage m new MimeMessage session m setFrom Address to new InternetAddress new InternetAddress mailString m setRecipients javax mail Message RecipientType TO to m setSentDate new java util Date String content m setContent content text plain Sending email Transport send m System out println Email was successfully sent Chapter 5 Performer Assignment 55 3 8 Practical Steps for Hooks Usage 3 8 1 Hook Loading and Compilng Hooks are stor
8. 4 3 5 Activity Hooks and Transactions Any change of state i e startTask finishTask suspendTask statements performed against an activity is part of a transaction This transaction typically involves more than one activity in synchronous executions for example a finishTask statement performed on an activity triggers a change of state in all connected activities The Workflow engine therefore keeps transactional consistency across activities The Workflow engine aborts a transaction in two cases e Afailure at system level e g impossibility to access the Workflow database e An exception not caught by a transactional hook When hooks are executed in a transactional context e Any changes performed on a transactional resource are included in this existing transactional context e Any exception raised by the hook aborts the existing transaction Writing a Hook Process and activity hooks are a java class and have to implement either Hook or TxHook interfaces Those interfaces are located in the package org ow2 bonita definition Hook A hook only requires one method to be implemented execute Parameters of this method will vary depending on the implemented interface For example the signature of a execute method for a hook implementing the hook interface looks as follows execute QueryAPIAccessor accessor ActivityInstance ActivityBody activityInstance while the same method signature for a hook implemen
9. designer with the information necessary to be able to e To create or modify Process Models using the ProEd Workflow editor 1 2 Role of Developer At different points during the Workflow process Nova Bonita Workflow process models may call external Java classes to perform specific tasks These Java classes are divided into four categories according to the task they are to perform during a Workflow process The four types of Java classes that can be involved in a Workflow process are Hooks triggering automatic actions at specific moments during the process or during an activity Mappers specifying the person s corresponding to a specific role Initiator Mapper specifying the person s allowed to start the process Performer assignment refining the assignment of a Participant to an activity Multi Instantiators assignment of a different activity instance to a set of actors human or system This guide provides the developer with the information necessary to e Add hooks mappers initiator mappers performer assignment entities and Multi instantiators to a Workflow process definition e Compile and deploy those entities in the Nova Bonita Workflow environment where those entities are Java classes 8 Bonita Workflow Development Guide Chapter 2 Using the ProEd Workflow Process Editor 2 ProEd Overview ProEd Process Editor is a Java program used to define Workflow models The ProEd tool helps i
10. e The Projects view on the left displays a list of all currently open projects e The Graph view on the right displays the BPMN representation of the current project See Section 2 5 2 for descriptions of these interface functions The screen area devoted to the projects view and the graph view can be resized by dragging the vertical divider either left or right between these two regions The status bar at the bottom displays the currently selected element and the user name if in connected mode Workflow elements can now be added to the project as described in the following sections Chapter 5 Performer Assignment 19 2 5 2 Interface Overview MENUS File Menu New Ctrl N zm Open Ctr o X Close the project gl save Ctrl S H Save As ly Save all Page Format Print preview gt Print Ctrl P Export as jpeg amp Quit Figure 2 14 ProEd File Menu Open opens a XPDL file containing process definition s Close the project closes the current project Save saves the current process definition into a XPDL file Save as saves the current process into a XPDL file after defining a new filename and location and or incrementing the version Save all saves all currently opened projects Page Format defines page layout for printing Print preview previews the graph corresponding to the currently selected process with the defined Page Format Print prints the graph correspon
11. forge objectweb org project showfiles php group id 56 and get the ProEd designer version for Bonita 4 0 1 bonita eclipseDesigner 4 0 1 zip file In order to install the plugin in your Eclipse environment just unzip this file on your eclipse installation directory ProEd for Bonita 4 0 1 has been released for Eclipse up to 3 2 version Once unzipped just restart your Eclipse go to File menu and then either go to New gt Other gt Bonita Workflow gt ProEd XPDL file to create a new XPDL file into your favorite Eclipse project or either New gt Project gt New Bonita project to create a new workflow project Please go to the next sections to know more about those options 10 Bonita Workflow Development Guide 2 4 Creating a workflow BPM Eclipse project This feature is available in the Eclipse version of ProEd Main purpose is to accelerate the process of creating a workflow project in Bonita The idea is to help workflow and BPM designers on creating bar files remember that a bar file in Bonita is a zipped file containing a BPM workflow definition as well as the list of entities resources required to interact with users and your information system To create a new workflow BPM process with ProEd just go to Eclipse File menu and select New gt Project feature If ProEd plugin was successfully installed in your Eclipse environment the following dialog should appear New Project leg Select a wizard lt
12. meaning workflow related operations The Workflow engine also allows creation of hooks for execution without a transactional context Those hooks implementing the Hook interface are executed outside the activity transactional context e Itis strongly recommended that these types of hooks NOT be used to access either Workflow APIs or other transactional APIs Nova Bonita prevents internal issues by only exposing to developers of Non Transactional hooks the use of query APls e If one of these hooks fails during its execution the system throws an exception but the activity life cycle is updated without rolling back any operation or transaction Consider the last sample scenario as described above and change the use of the task onFinish hook implementation from TxHook interface to Hook one the execution is as follows e Imagine that the finishTask statement on Activity 1 completes normally and that Activity 1 has an outgoing transition towards an automatic activity Activity 2 e Activity 2 is started and terminated automatically in the context of the first call related to Activity 1 e Therefore if Activity 2 has an task onFinish non transactional hook that raises an exception the hook does not interrupt the call related to Activity 1 e This means Activity 1 finishes without problem but the system throws an exception due to the Activity2 execution error Bonita Workflow Development Guide 3 3 2 3
13. we will describe other features later on Select so New Bonita XPDL File option and click Next On the next dialog just enter the name of your process i e ApprovalWorkflow as well as a description if required This will automatically create an empty XPDL file in your project and will open the ProEd Eclipse editor File Edit Navigate Search Project Codegeneration Run Window Help irj oe it O Q BEG ES 2 Java Browsing As Sey 7 amp Java AE a A 0 LERLE ma SS Navigator Z3 ILI EA approvalworkflow 1 0 xpdl ApprovalWorkflow 1 0 Z3 N m a07 Bg g ApprovalWorkflow E bar S S bin E lib E bonita core 4 0 RC3 jar E novaBpmUtil r996 jar SS src Forms java classpath project Activity Participant XPDL ne ApprovalWorkflow src xpdl ApprovalWorkflow_1 0 xpdl Figure 2 5 Workflow process editor Chapter 5 Performer Assignment 13 You are now ready to graphically define a workflow process For a detailed description on how to use ProEd graphical editor please take a look to next chapters To illustrate a workflow process definition we will re use the ApprovalWorkflow sample provided in the Bonita distribution examples directory After creating 2 manual and 2 automatic activities assigned to 2 different performers the workflow definition for this process looks like follows m
14. when an activity is executed by the user manual activities TaskonFinish the Hook is called when an activity is finished by the user manual activities Task onSuspend the Hook is executed just after the user calls the suspend operation TaskonResume the Hook is executed just after the user calls the resume operation e automatic onEnter the Hook is executed once the automatic activity is executed e Error handling section a check box allows to define whether or not this hook will be rollbacked if an exception occurs Rollback operation will also abort the activity state change e Choose a hook section If available this field displays the list of deployed Hooks available for use by the Activity or Process Select a Hook from the list fthe Java class is not yet implemented type the Java classname to call remember to create the Java Class with exactly the same name before deploying the Workflow process Chapter 5 Performer Assignment 43 44 CREATING AND DEFINING TRANSITIONS AND ITERATIONS A Transition is a link between two activities it allows the flow of control to pass from one Activity to another Transitions can be created with or without an associated condition A transition that has an attached condition will be displayed as a dotted line An iteration is set between two Activities and involves the repetitive execution of one or more Workflow Activities until a condition is met Iterations in Bonita
15. 25 Figure 2 26 Figure 2 27 Figure 2 28 Figure 2 29 Figure 2 30 Figure 2 31 Figure 2 32 Figure 2 33 Figure 2 34 Creating a New Workflow Project ssssssscsscsscsecsssessessecseesecusssesscssescesesecnssssascscaccascuceussessesseeasensensenenees Editing Java settings Workflow project structure Creating a New XPDI file Workflow process editor Workflow process definition through ProEd P Creating a Bonita Hook Java entity ccsssecssssssssssssssssssessesscsnssscsssssssssacencencsessssssessesseucsecsecaseaseaceaceseesenses Editing Java Hook settings eese entente toten tente tenente tento tte entente ntes tetto ttnentenis Java Hook Preview Editing Hook javo file Bar file generation VIGW tcc tete tee eene NESTEEN E Creating a New Workflow Project sty ui ed x ProEd Display for New Project esent tte tentente tentes tette ttn sentono tente tte ttn entenis deca NU M ProEd Edit menu eu au us ie ProEd Window M M ProEd Participant ViGW ic ssss escssescciesesussdshsccessesossssesshstiseeseasaascvacustysisatsavcevensosisnsstantsavaasstsecsesueouabisvenssteosetsns ProEd Activity View d ProEd Process Mont Prof d Moin tool aie ixssjssssctsscidecceseassazecsvassxcesccstdasaeeasrsstscctecgeageSotvnsssessiessessosugsastab gues sanva
16. 4 0 1 are defined through transitions In the Workflow toolbar click the Transition El 1 Inthe graph window click a source Activity and drag the pointer to a target Activity without releasing the mouse button Transitions a straight arrow links the two activities conditions may be added on the transition or modification of the properties of the transition see following section Figure 2 32 Iterations and Transitions Graph 2 Modify the shape of the arrow Transitions right click the Transition and select Add a point a new point appears on the line click and drag this point to change the shape of the arrow repeat if needed To delete a point right click a point and select Remove a point Note that the Activity View and Participant View have a separate set of added points so that the path of the transition line can be adjusted independently in each view Bonita Workflow Development Guide ADDING EDITING CONDITIONS ON TRANSITIONS 1 Right click on a transition and select Add Update condition The Add condition window appears x op c Attribute como Value Lo El V OK X Cancel Figure 2 33 Add Condition Window 2 Fill in the table as described below Field Value Op Operator Define an AND or OR operator between two conditions Select the appropriate number of brackets according to the number of conditions set for the Transition Variable Select
17. Bonita has been installed The way to do this is as follows e Create the source java file i e MyMapper java 58 Bonita Workflow Development Guide e Compile this java file by adding the bonita jar library in your compilation classpath Es Note If the java class uses user defined libraries include them in your classpath before compiling and deploying the mapper Mappers deploying a mapper Mappers deployment has been improved in Nova Bonita regarding previous versions A centralized way to deploy mappers is available through the ManagementAPI facade This API allows easily to deploy mappers but also any other advanced entities such hooks and performer assigments Depending on the Nova Bonita deployment environment i e Tomcat Application Server Spring application this facade can be leveraged as a POJO or as a Session Bean The idea is to provide different operations allowing mappers deployment e deployClass this operation deploys a single mapper class e deployClasses operation allowing to deploy two or more mappers in a single operation e deployClasseslnJar operation getting as a parameter a jar file which include a set of mappers to be deployed Those operations deploy mappers that could be leveraged afterwards by any workflow process deployed in Nova Bonita Mappers can also be deployed in the context of a workflow process meaning only visible for a particular workflow process e deployBar operation deploy
18. Nova Bonita Workflow Development Guide z C SZ cx O z lt Z O faa O gt O Z Nova Bonita Workflow Development Guide Nova Bonita aka Bonita v4 Software Septem ber 2008 Table of Contents 1 1 1 2 2 1 2 2 2 3 2 4 2 5 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 4 1 4 2 5 1 5 2 Role of DESIGNE PE 8 dU WB T I1 A 8 Pro Ed Overie Weres E 9 Versioning Support in ProEd oterac ttn t nr e MR E HERR REIR M ER IAEA gum 9 Starting ProEd and ProEd Modes of Operation eerte treten tenentis 9 2 3 1 Launching ProEd as a desktop application eerte tenent 10 2 3 2 Launching ProEd as an Eclipse plugin eene tenerent 10 Creating a workflow BPM Eclipse project sese tnnt 11 Using ProEd workflow editor rettet enitn rte bittet tetas en tort ta eek tes eea teeth ee esie eek andere 17 2 5 1 Creating a New Workflow Project seen tenente tenente tentes 17 2 5 2 Interfcice Overview 23 ceci eee t he E REIR te e e HO ERR E 20 2 5 3 Load Save SaveAs Delete Projects sees ttes 29 2 5 4 Defining Workflow Process Properties seeeeee entente tentent tentes 33 2 5 5 Adding Participants 2 5 6 Creating and Defining Activities seen tentent tenente tentent tentent 37 2 5 7 Creating Variables ci
19. agated to all Activities in the project Variables can be added edited or deleted Add button adds a new Variable at Process level see Section 2 5 7 Edit button modifies the selected Variable Delete button deletes the selected Variable e Hookstab This tab allows the definition of Process level Hooks if needed Process level hooks are instantiation hook and termination hook Hooks can be added edited or deleted Add button adds a new Hook at the Process level see Section 2 5 8 Edit button modify the selected Hook Delete button deletes the selected Hook 2 5 5 Adding Participants Participants can be added at Process level or at Activity level Whether a Participant is added to the whole project or only to a specific Activity the participant becomes a Process model Participant and can be thus used for any other Activity created within the project there is no need to add the Participant again to the project To add Participants e Atthe Process level right click in the Project window select Participants tab and click the Add button Chapter 5 Performer Assignment 33 e Atthe Activity level in the Activity window General tab click the New Participant button CHOOSING AN EXISTING PARTICIPANT Click the Existing participants checkbox in the Add Participants window to add an existing Participant to choose the appropriate Participant search the LDAP data or filter it ProEd
20. ar button to select a fixed date e Exception mandatory field If any this field displays the list of deployed Java classes that defines the action to execute if the deadline is missed Select the appropriate Java class If the Java class is not implemented yet type the classname to be called remember to create the Java Class with exactly the same name before deploying the Workflow process 40 Bonita Workflow Development Guide DELETING AN ACTIVITY Select an Activity in the graph view using the pointer Right click the Activity and select Delete Alternatively click the Delete button in the menu or press the delete key In the confirmation dialog box click OK to confirm deletion 2 5 7 Creating Variables Variables can be created at the Process level or at the Activity level Variables can be String type Enumeration type Date type Boolean type Float type Integer type To add Process Variables to the Workflow process model or to a specific Activity do one of the following ProEd Variable Description Type Character String v At the Process level in the Project view Variables tab click the Add button At the Activity level in the Activity window Variables tab click the Add button Name Initial Value Zo Figure 2 30 Variable Menu Chapter 5 Performer Assignment 41 2 5 8 42 e Inthe Variable window fill in the fol
21. blic class PrintMessage implements Hook ee lib I bonita core amp D RC3 jor Ae public void execute QueryAPIAccessor arg0 g novaBpmii r996 i ActivityInstance lt ActivityBody gt argi throws Exception Aap sc System out println I was there forms o java P PrintMessage java 8 amp xpd d ER ApprovalWorkflow_1 0 xpdl X dasspath X project ne writable Smart Insert 11 45 Figure 2 10 Editing Hook java file Mappers and performer assignments can be created the same way just leverage New Bonita Role Mapper and New Bonita Performer Assign features respectively Once created Java workflow entities are ready to be used inside your workflow definition Please check in the next chapter how to add hooks mappers performer assignments and Multi instantiators to the workflow definition L5 Note Hooks as well as mappers performer assignments and Multi instantiators java entities are automatically compiled by the plugin as soon as you save them If you are using external java libraries from within your hook just copy them into the lib directory Let s now address how to generate the bar file corresponding to this workflow project Nothing easier than click on Eclipe save button In fact each save operation in your workflow project will automatically generate or update the bar file of your process by default this bar file is located under the bar directory B Approva
22. d a java related environment 3 2 1 Workflow Related Hook Actions The hook likely interacts with the Workflow engine through a dedicated API The most commonly performed operations are the following getan activivty process variable e methods getVariable set an activity process variabke e methods setVariable getthe activity process name e methods getProcessActivity and getProcess Chapter 5 Performer Assignment 49 start finish an activity methods startTask finishTask For more detailed information about dedicated functions see the Nova Bonita Javadoc API document available under doc javadoc directory 3 2 2 Java Environment Related Hook Actions Hooks are java classes thus any standard java operation may be performed Therefore external program calls and some system calls are feasible within a hook context Depending on the execution environment JSE vs JEE hooks can directly call Java API without adding additional libraries For instance in a Nova Bonita deployment in a JEE application server hooks can directly reach external web services by leveraging the web services framework provided by the application server i e Axis 50 Bonita Workflow Development Guide dud Hooks Logic Hooks are user defined logic entities java classes which may be triggered at defined points of the corresponding activity body life cycle automatic or task Those defined points are
23. ding to the currently selected process Export as jpeg exports the current graph as a JPEG image file Quit exits ProEd 20 Bonita Workflow Development Guide Edit Menu Undo Ctrl Z Redo Ctrl Cut Ctrl gt Copy Ctrl C Paste Ctrl V 1 Delete Select All Unselect All Figure 2 15 ProEd Edit menu e Delete deletes the element selected on the graph view Window Menu C Real Size Ctri Alt N Zoom gt Layout EB arid Ctrl G Participant View v Activity View Figure 2 16 ProEd Window Menu e Real size reverts to the original size of the graph view after zooming in or out e Zoom select a value to zoom in or out on the graph view e Grid display or does not display a grid on the graph Chapter 5 Performer Assignment 21 Participant view organizes the graph of the Workflow process by Participants as shown below Customer Figure 2 17 ProEd Participant View e Activity view organizes the graph of the Workflow process by Activities as shown below Figure 2 18 ProEd Activity View 22 Bonita Workflow Development Guide Process Menu Ef Properties Ctr E Activities lt gt Route Activities Sub process Transitions t Participants Ny Hooks Variables Figure 2 19 ProEd Process Menu Properties displays the properties of the process e Activities displays all basic activities of the process e Sub process displays all sub processe
24. e task onReady hook is called when the task becomes available activities of type task when it is assigned to a user or a group of them The task state has moved from init to ready state taskonStart hook is called as soon as the task is executed This hook is launched by the engine once the task moves to executing state This is correlated to the startTask operation performed by a user task onFinish hook is called as soon as the task is finished This hook is launched by the engine once the task moves to finished state This is correlated to the finishTask operation performed by a User e task onSuspend hook is called when the task is suspended by a user This is correlated to the suspendTask operation e taskonResume hook is called when the task is resumed from a suspended state This is correlated to the suspendTask operation e automatic onEnter hook is called when an automatic activity is executed e onDeadline hook is called when an activity deadline expires Deadlines are started when an activity becomes ready and throws an exception called onDeadline hook when the period of time is reached 3 3 1 Fault Management If an exception occurs during hook execution it is propagated to the application triggering the execution of the hook Consider the following scenario An application calls the finishTask operation on Activity 1 this triggers the execution of an task onFinish hook which raises an exception the exc
25. e of publication depending on thee specific Workflow design progress Role initiator this selection specifies which users are authorized to start the Workflow Process in Nova Bonita Role mapper select the appropriate type of mapper LDAP select LDAP to specify a group of users defined in the LDAP user directory Custom select Custom to call a Java class listing specific users ClassName For an LDAP mapper select the group of users allowed to start the Workflow Process Fora Custom mapper f present this field displays the list of implemented initiatorMapper Java classes specifying a list of users allowed to start the Process Select the appropriate Java class Ifthe Java Mapper class is not yet implemented type the Java classname to call Es Note The Java Mapper class must be created on the server with exactly the same name as before Workflow Process deployment Bonita Workflow Development Guide zax File Edit Window Process Configuration Help Df x d amp 2 100 X Projects Df NewProject 1 0 ey Df Project NewProject 110 a lol Bl c Figure 2 13 ProEd Display for New Project Figure 4 2 displays the main ProEd frame for the newly created project e The menu and main toolbar at the top allow access to the main ProEd functions e The Workflow toolbar in the middle of the window allows access to commonly used design functions
26. eaning only visible for a particular workflow process e deployBar operation deploying a workflow process as well as hooks mappers and performer assignments entities Remove and replace operations are also available in this API allowing hooks removing and hook classes updates e removeClass remove a hook fro the production environment e replaceClass replace an already deployed hook from the production environment 56 Bonita Workflow Development Guide Chapter 4 Mappers 4 1 Introduction Writing a mapper is very similar to writing a hook because both are Java classes than implements a well defined interface In the case of mappers this java class is used to designate a person A mapper Java class is used to designate the person s corresponding to a specific user defined role 4 2 Writing a Mapper A mapper specifies person s corresponding to a specific role defined in the Workflow process model by the process model designer It is used to automatically fill in users with a group of Participants defined in the Process model Three methods for filling are available three types of mappers depending on the method used to retrieve the users in the information system e getting groups roles in an LDAP server LDAP mapper calling a java class to request a users repository custom mapper e getting the initiator of the project instance Instance Initiator mapper In fact LDAP and Instance Initiators mappers types are part
27. ecting a file from the repository After selecting the desired directory select the desired file and click the OK button To save to the original file Doing Save on an existing project will save the project back into the original file without using a dialog If this is a new project doing Save will bring up the SaveAs Dialog to allow the initial file to be specified 30 Bonita Workflow Development Guide To delete an existing file This dialog box also allows the user to delete any XPDL file Navigate to the file as above When a XPDL file is selected the Delete button at the right is enabled Pressing the Delete button causes a dialog box to appear to confirm the intent to delete an existing file IEE Note Note that the Delete button within ProEd can also be used to delete files contained in the repository ProEd Select one XPDL file xj sem Ewon e sl BRIE 3 123 xpdl 3 demande_habilitation_1 0 xpdl Version 1 0 O Medical Workflow_1 0 xpdl Version gt 1 1 Version gt 2 0 Delete FileName Medical Workflow 1 0xpdl Save Cancel Figure 2 25 Save File Dialog To save to an existing file When doing SaveAs it is possible to select an existing file to overwrite Navigate to the file as shown in Figure 4 13 select an existing file and click the Save button A dialog box appears to confirm the intent to overwrite the existing file e The Version
28. ed on the file system as standard java classes It is necessary to load the code that has been written into the production environment in which Nova Bonita has been installed The way to do this is as follows e Create the source java file i e MyHook java e Compile this java file by adding the bonita jar library in your compilation classpath L5 Note If the java class uses user defined libraries include them in your classpath before compiling and deploying the hook 3 8 2 Hooks deployment Hooks deployment has been improved in Nova Bonita regarding previous versions A centralized way to deploy hooks is available through the ManagementAPI fa ade This API allows easily to deploy hooks but also any other advanced entities such mappers and performer assigments Depending on the Nova Bonita deployment environment i e Tomcat Application Server Spring application this fa ade can be leveraged as a POJO or as a Session Bean The idea is to provide different operations allowing hooks deployment e deployClass this operation deploys a single hook class e deployClasses operation allowing to deploy two or more hooks in a single operation e deployClasseslnJar operation getting as a parameter a jar file which include a set of hooks to be deployed Those operations deploy hooks that could be leveraged afterwards by any workflow process deployed in Nova Bonita Hooks can also be deployed in the context of a workflow process m
29. egarding Activity Deadline Contrary to what might be intuitive the deadline of an activity must be set prior to activity start In fact deadlines could be set in the previous manual activity in a task onFinish hook e g to set the deadline in the activity number 3 it is necessary to invoke a hook in the task onFinish hook of activity 2 See example Set Deadline Hook below for set deadline code Use Case A Simple Hook For this example Hello world will be printed in the Workflow console The code produced is the following import import import import org org org org ow2 ow2 ow2 ow2 bonita bonita bonita bonita definition Hook facade QueryAPIAccessor facade runtime ActivityBody facade runtime ActivityInstance public class Reject implements Hook public void execute QueryAPIAccessor accessor ActivityInstance ActivityBody activityInstance throws Exception System out println Hello World Though very interesting this hook is not very useful A More Complex Hook In this case the intent is to send an email to the process creator after registering a person defined in the Workflow process under the activity variable Emaii address Check the related functions documentation for more details on their use import import import import import import import import import import org org Ow2 org org org javax javax javax javax javax ow2
30. eption is caught by the application Things may be a little bit problematic if automatic activities are used e Imagine that the finishTask statement on Activity 1 completes normally and that Activity 1 has an outgoing transition towards an automatic activity Activity 2 e Activity 2 is started and finished automatically in the context of the first call related to Activity 1 e Therefore if Activity 2 has a task onFinish hook that raises an exception it will interrupt the call related to Activity 1 e This means Activity 1 will not finish the activity stays under the executing state and the system throws an exception due to the Activity2 execution error The above examples show two error scenarios related to transactional hook execution Be aware that hooks can be executed in a transactional or in a non transactional context depending on the implemented interface Hook vs TxHook Transactional hooks are executed in the same transactional context as the activity invoking the hook Transactional hooks are those ones implementing the TxHook interface Chapter 5 Performer Assignment 51 52 e Any changes performed on a transactional resource are included in the existing transactional context e Any exception raised by a Hook aborts the existing transaction so the activity will be re executed later on Furthermore all operations executed by the hook before the exception was raised are rolled back
31. es Variables tab variables can be added edited or deleted see Section 4 4 7 Creating Variables Add button adds a new Variable to the Activity Edit button modifies the selected Variable Delete button deletes the selected Variable Inherited Variables area displays the names of all the inherited variables Variables defined at the Process level Activity tab Sub process Activities only displays the list of all Activities included in the Activity Participants tab Sub process Activity only displays the list of all Participants involved in the Sub process Activity see Section 2 5 5 Adding Participants Transitions tab Sub process Activities only displays the list of all Transitions included in the Activity see below Creating and Defining Transitions and Iterations Hooks tab defines the Activity level Hooks Hooks can be added edited or deleted see Section 2 5 8 Adding Hooks Chapter 5 Performer Assignment 39 Add button click to add a new Hook to the Activity Edit button click to modify the selected Hook Delete button click to delete the selected Hook Deadline area click the Add button to add a deadline Condition Time relative time in days hours minutes and seconds the deadline is set at the end of the elapsed time from the Activity starting time entered Date fixed date the deadline is set at the selected date and time Click the Calend
32. es are automatically re positioned when it is necessary to place them in the proper participant lane when two activities overlap or when a participant view position has not been established for the activity e When participants are added or deleted the resulting position of some of the existing participant 2 5 3 lanes may change The activities in these lanes are automatically re positioned to move them into the new lane position and the user may desire to re arrange them in a more harmonious manner Load Save SaveAs Delkte Projects The file chooser window is used to load save and delete the XPDL files corresponding to ProEd projects It is accessed in the following ways File Open menu selection or Open toolbar button File Save menu selection or Save toolbar button File gt SaveAs menu selection Chapter 5 Performer Assignment 29 e Open File button in the Sub Process dialog box Jj WorkflowRepository M Gal Et E8 a Look In demande habifiation T U xpd 3 Medical Workflow 1 0 xpdl FileName Delete OK Cancel Figure 2 24 Open File Dialog The text on the OK button will change to Open based on the operational context To open an existing file Use the combo box at the top of the dialog box to navigate to the desired directory In Connected mode the WorkflowRepository top level directory entry is also available to allow sel
33. field shows the existing version of the Workflow Project e The upper Version button increments the minor version number in the saved file as shown on the button The lower Version button increments the major version number in the saved file as shown on the button Chapter 5 Performer Assignment 31 32 To save fo a new version Using SaveAs to save an existing project into a new file with a new version is the only way to change the version It is possible to increment the major version or the minor version number only by one The version is a property of a ProEd Workflow Project and is not dependent on the file name of the project s XPDL file Although it is not required the recommended format for a ProEd XPDL file name is ProjectName version xpdl For example Medical Workflow 1 0 xpdl When either of the Version buttons is used to increment the major or the minor version a file name of this format will be automatically proposed AN ction Note that attempting to SaveAs and selecting a file that is currently in use results in an error dialog box To save to a new file The SaveAs menu allows saving a project to a new file Navigate to the desired directory as described above Type a new file name in the File Name text box and click the Save button To save to an existing file When doing SaveAs it is possible to select an existing file to overwrite Navigate to the file as described above and selec
34. icular uses cases implementations of customs mappers LDAP mapper will be useful in production environments in which roles groups defined at workflow definition time match with LDAP groups while Instance Initiators mappers are usually leveraged for testing purposes as they assign a particular role to the user that has created a particular workflow instance While mappers are assigned to roles groups in processes they are automatically resolved by Nova Bonita when a manual activity called task becomes available ready state This resolution users roles resolution mechanism gives a lot of flexibility when assigning tasks to one users or a set of them in a particular workflow instance execution Chapter 5 Performer Assignment 57 4 2 1 Mapper Types LDAP Custom and Properties LDAP MAPPER not yet supported in Nova Bonita RC2 but can be implemented through a Custom mapper This mapper uses the LDAP directory to retrieve users that correspond to a specific role defined in Bonita Workflow project LDAP mapper specifics e The location of the LDAP groups depends on the attributes roleDN and roleNameAttribute e There is no mapping between roles groups in the LDAP and roles in Workflow database same name for both bases e The attribute name uid is used to achieve the mapping between the actor identifier in the LDAP base and the userName in the Workflw base e Ifthe group does not exist an exception is thrown e Users fou
35. idea is to provide different operations allowing PA deployment e deployClass this operation deploys a single PA class e deployClasses operation allowing to deploy two or more PA in a single operation e deployClasseslnJar operation getting as a parameter a jar file which include a set of PA to be deployed Those operations deploy PA that could be leveraged afterwards by any workflow process deployed in Nova Bonita PA can also be deployed in the context of a workflow process meaning only visible for a particular workflow process e deployBar operation deploying a workflow process as well as hooks mappers and performer assignments entities Remove and replace operations are also available in this API allowing PAs removing and PAs classes updates e removeClass remove a PA from the production environment e replaceClass replace an already deployed PA from the production environment Bonita Workflow Development Guide 5932 Example of a Performer Assignment In the following performer assignment the user John is set as the performer of the activity calling this custom performer assignment import import import import public public String selectUser QueryAPIAccessor accessor java util Set org ow2 bonita org ow2 bonita org ow2 bonita definition PerformerAssign facade QueryAPIAccessor facade uuid ProcessInstanceUUID class MyPerformerAssign implements PerformerAssign instanceUUID
36. ine is embedded in the client application i e Tomcat based application Bonita Workflow Development Guide As said hooks are automatically triggered by the workflow engine based on activities types known as activity bodies in Nova Bonita life cycle Tasks aka manual activities follows the life cycle below onResume onSuspend onStart onFinish In Figure 3 1 possible hooks types are related to the Nova Bonita task life cycle activities with body task Automatic activities activities with body automatic can only trigger one hook called onEnter This hook is automatically executed by the workflow engine once the activity runs 3 1 2 Out of Timescale Hooks The onDeadline OD hooks are not related to a particular activity state while are also automatically triggered by the engine The onDeadline OD hook is triggered when the set activity deadline expires The deadline is set either by default through ProEd editor or by another hook external program using the Workflow API Be sure to keep in mind that multiple deadlines may be set within the same activity In a normal case this hook is not triggered or called by a common user 3 2 Hooks Capabilities As stated previously hooks in Nova Bonita context are external java classes performing user defined operations Mainly hooks are able to perform a wide array of actions involving two different channels Workflow related and what is calle
37. ing a workflow process as well as hooks mappers and performer assignments entities Remove and replace operations are also available in this API allowing mappers removing and mapper classes updates e removeClass remove a mapper fro the production environment replaceClass replace an already deployed mapper from the production environment 4 2 3 Example of a Mapper The following mapper returns John and Jack names as the mapped persons Of course external requests to data storages are likely to be used in the mapper classes import java util HashSet import java util Set import org ow2 bonita definition RoleMapper import org ow2 bonita facade QueryAPIAccessor import org ow2 bonita facade uuid ProcessInstanceUUID public class MyMapper implements RoleMapper public Set String searchMembers QueryAPIAccessor accessor ProcessInstanceUUID instanceUUID String roleId Set String usersId new HashSet lt String gt j usersId add John usersId add Jack return usersId Chapter 5 Performer Assignment 59 Chapter 5 Performer Assignment This feature provides a means within the Workflow engine to modify the standard assignment rules for activities As mappers performer assignments only concerns to manual activites Tasks While mappers returns a list of users of a role peformers returns only one user the user responsible of a particular manual activity 5 1 Introduction This feature allows a
38. ing and Defining Activities Add Transition adds a Transition between two Activities See CREATING AND DEFINING TRANSITIONS AND ITERATIONS Table 2 1 Description of Workflow Toolbar Design Tools Bonita Workflow Development Guide VIEWS Projects View ER 2731 f Test 1 0 Medical Workflow 1 0 Figure 2 21 Projects View The Projects View displays all processes present in the XPDL repository and or processes that the user has created or opened The version of the process is shown in parenthesis after the process name Right click on a process name to access either the process graph view or to close the project Double click on the process name to display the process graph view Click the black arrows to hide or display this view Graph View The Graph View displays the graphic representation of the current process model It can be organized in two different ways The Activity View emphasizes the relationships between the activities The Participant View emphasizes the participant involvement by grouping activities into participant swim lanes Activity View Activity ft Participant XPDL Figure 2 22 Activity View Chapter 5 Performer Assignment 25 Symbols Description Basic activities are shown by blue rounded rectangles automatic or manual start and various participants Route Activities are shown by green rounded rectangles always automatic start and the SYSTEM pa
39. ion performerAssign CallbackSelectActors 5 2 2 Variables Performer Assignment This allows the process developer to provide at variables performer assignment creation time the activity variable used by the Workflow engine to assign the activity This activity variable is defined in the targeted activity to be assigned Chapter 5 Performer Assignment 61 5 3 5 3 1 62 Practical Steps for Using Callback Performer Assignments Performer Assignment Loading and Compiling As mappers custom performer assignment are loaded and executed by the Workflow engine If adding a specific custom classs follow these steps e Create the source java file i e MyPerformer java e Compile this java file by adding the bonita jar library in your compilation classpath gt Note If the java class uses user defined libraries include them in your classpath before compiling and deploying the performer assignment Performer assignment deploying a performer assignment Performer assignments deployment has been improved in Nova Bonita regarding previous versions A centralized way to deploy those entities is available through the ManagementAPI facade This API allows easily to deploy performers assignment PA but also any other advanced entities such hooks and mappers Depending on the Nova Bonita deployment environment i e Tomcat Application Server Spring application this facade can be leveraged as a POJO or as a Session Bean The
40. isanseeesadaneeaseagevens Projects View m sus m shes Activity VIEW dad Open File Dialog js in s Save File Dialog ProEd Add Participant Window ssssssscsscsscsscescsssessessessesscuscussusaeaseseesecuseucsueascascsecuecussessueaeneeneeneeseeeeaes Add Participant Search Window New Participant Window New Activity Window Variable Menu Add Hook Window Iterations and Transitions Graph Add Condition Window ai te Modifying Transition Properties esent tte ttntente tette tte tn tente nte tonto tte ten entenns Chapter 1 Overview This document describes the design and development operations in Nova Bonita Although design and development activities may be performed by a single individual they require the use of separate tools and therefore are described as two separate roles The information in this document is organized as follows FOR THE DESIGNER e TheProEd XPDL Workflow Process Editor Refer to Chapter 2 FOR THE DEVELOPER e Hooks Refer to Chapter 3 e Mappers and Initiator Mappers Refer to Chapter 4 e Performer Assignment Refer to Chapter 5 Bonita Workflow Development Guide 7 1 1 Role of Designer This guide provides the
41. ities The transition s dialog opens to enter the transition name and other transition properties ProEd remains in the add transition mode indicated by a cross and arrow cursor and additional transitions may be added To delete an activity or and transition If ProEd is not in the select mode indicated by an arrow cursor press the top button in the Workflow toolbar to enter the select mode Select the desired i e activity or transition item by single clicking on it Handles appear on the selected item to indicate its selection Press the Delete key on the keyboard or right click on the desired item select Delete from the context menu and answer Yes to the deletion confirmation dialog Chapter 5 Performer Assignment 27 To reposition an activity e Dragthe activity to the desired location Transitions and iterations also move to remain attached to the activity in the new location To reposition a transition line The end points of a transition are fixed on the source and target activities however the line that connects them may be re positioned to avoid obstacles or un clutter the diagram e Right click on the desired line or line segment e Select Add a Point e Anew handle is added in the middle of the selected line or line segment e Thenew handle may be dragged to re position the line To modify the properties of an activity or a transition e Double click on the item does not apply to subflow activitie
42. ivity Multiple Instance this area allows to choice of an instantiator class that will be resolved at runtime A variable and the name of the java class corresponding to the instantiator class are required this entity is not mandatory Performer manual Basic Activity only this list allows assigning a performer human role or an organization for the Activity being created Click the Add Participant button and see Section 2 5 5 Adding Participants Performer assignment manual Basic Activity only this area allows the choice of the performer to be refined or deferred The performer is determined at run time depending on the value of an attribute or by calling a java class e Variable this list displays all Variables of the Activity The performer is determined at run time according to the value of the selected Variable Custom If specified this list displays the deployed java classes for performer assignment The performer is determined at run time by calling the selected java class If the Java class is not implemented yet type the classname to be called remember to create the Java Class with exactly the same name before deploying the Workflow process DEFINING ACTIVITY Properties In the graph window right click the Activity to define and select Properties the Activity window appears Define the Activity as follows General tab this tab is filled at creation time see Creating and Defining Activiti
43. lowing fields Name mandatory field type a unique name for the Variable and the space character are not allowed Description enter a short description for the Variable Type select one of the following types of Variable Character String a character Enumeration list of values Click the Add button to add a value Date a valid date pop up Boolean true or false values Float floating point Integer numeric value Adding Hooks Hooks are Java procedures that can be added to Process or Activity execution To add a Hook e Atthe Process level in the Project window Hooks tab click the Add button e Atthe Activity level in the Activity window Hooks tab click the Add button The Add Hook window is displayed ProEd Add hook Call point For tasks aka manual activities task onReady task onStart task onFinish task onSuspend task onResume For automatic activities 2 automatic onEnter Hook Name Tz C rollback OK X Cancel Figure 2 31 Add Hook Window Bonita Workflow Development Guide EF Notes Automatic call points are unavailable for Tasks and vice versa as is the case in the task Hook window above To fill in the Add Hook window e Call point section Task onReady the Hook is called when the Task becomes available i e a manual activity is assigned to a user or a group of them TaskonStart the Hook is called
44. lworkflow amp Forms 4 amp java amp xpdl Approvalworkflow 1 0 xpdl X classpath 1X project Figure 2 11 Bar file generation view 16 Bonita Workflow Development Guide 2 5 Using ProEd workflow editor This chapter is dedicated to the desktop version of ProEd However most of the features you will find in the following lines will also be available in the Eclipse version 2 3 1 Creating a New Workflow Project A new Workflow project is created by selecting the File New menu item or by clicking on the New Project button in the main toolbar This displays the New Project dialog box as shown in the following figure General Activities Participants Transitions variables Hooks l Description Version Author State of Publication Role initiator Role mapper ClassName Figure 2 12 Creating a New Workflow Project A project Name must be entered in the General tab All other fields are optional Chapter 5 Performer Assignment 17 18 Field Descriptions Name Assigned name of the project Description enter more information about the Process Version This is a read only field that displays the version information of the current Workflow Process New Workflow Processes will be created with a version of 1 0 Author enter the name of the Workflow Process model Designer State of Publication select the appropriate stat
45. moveClass remove a MI from the production environment e replaceClass replace an already deployed MI from the production environment Chapter 5 Performer Assignment 65 6 2 2 Example of a Multi Instantiator In the following example users John jack and james will get an instance of an activity at workflow runtime As specified in the return values those three users as expected to take over the activity three different instances in fact before the Nova Bonita runtime decides to move forward import java util ArrayList import java util List import org ow2 bonita definition MultiInstantiator import org ow2 bonita definition MultiInstantiatorDescriptor import org ow2 bonita facade QueryAPIAccessor import org ow2 bonita facade uuid ProcessInstanceUUID public class ApprovallInstantiator implements MultilInstantiator public MultilInstantiatorDescriptor execute QueryAPIAccessor accessor ProcessInstanceUUID instanceUUID String activityId String iterationId throws Exception List Object variableValues new ArrayList lt Object gt variableValues add john variableValues add jack variableValues add james return new MultilnstantiatorDescriptor 3 variableValues 66 Bonita Workflow Development Guide
46. mpsi ii ES B Java Browsing E eh 4 QS Sz Navigator 3 E Et ApprovatWorkflow_1 0 xpdl ApprovatWorkflow 1 0 D PrintMessage java 23 Ta e B amp M import org ow2 bonita definition Hook S E ApprovalWorkflow W bar BS bin public class je implements Hook 8 E ib bonita core 4 DRC3 jar sc public void execute QueryAPIAccessor arg0 novaBpmUti r996 jar ActivityInstancecActivityBody argi throws Exception rr ac a TODO Auto generated method stub forms ee PrintMessage java amp xpd ER ApprovalWorkflow 1 0 xpdl x classpath IX project STI Approvalworkflow srcjjava Figure 2 9 Java Hook Preview Chapter 5 Performer Assignment 15 In the picture above PrintMessage was given as the name of the Hook Now you are free to implement this class connector using your own java code For instance we will just print out a message as a default implementation of this hook Java Browsing ApprovalWorkflow src java PrintMessage java Eclipse SDK X ig App Ja Sage Ja Ip File Edit Source Refactor Navigate Search Project Codegeneration Run Window Help r amp 4 HIS ri amp O Q gge Fiel eieav 42 Fe eve Bons Pi Gl Oe gs 5 Navigator 23 Et Approvalworkflow_1 0 xpdl_ApprovalWorkflow 1 0 J PrintMessage java 3 20 Bev import org ow2 bonita definition Hook amp i gt ApprovalWorkflow a bar E B E bin pu
47. n the creation updates and visualization of Workflow processes The ProEd graphics based tool allows the user to visually describe a Workflow process using a single graphical notation inspired from the BPMN standard Business Process Modeling Notation graphic notation All elements of the Workflow can be displayed such as activities transitions iterations etc Values for performers mappers hooks etc can be set at the project or activity level as necessary Finally the Workflow process can be saved using the XPDL standard notation The XPDL file can be saved locally on the computer workstation or in a file repository The file repository provides a shared Workflow storage location residing on the server 2 2 Versioning Support in ProEd ProEd supports versioning of the Workflow process Each Workflow process contains an inherent attribute that describes its version The version consists of a major version number and a minor version number and is represented in the conventional decimal notation of MajorVersion MinorVersion A new Workflow project is created with an initial version of 1 0 If an existing Workflow project that does not contain version information is opened it will be given a version of 1 0 Whenever the SaveAs operation is performed the option is presented to increment either the major version or the minor version by one Saving a Workflow project to a new file in this manner is the only way to change the version numbe
48. nd in the groups must have been deployed before usage of the mapper function Otherwise an exception is thrown e The name of the mapper is user defined Limitations of this version e Groups cannot be recursive Groups inclusions are ignored CUSTOM MAPPER This allows the process developer to request use of the user s storage base When this type of mapper is added a call to a java class is performed The name of this mapper is the name of the called java class ex org myProject CustomMapper After retrieving these users they must be added to the project instance as well as added to the targeted role INSTANCE INITIATOR MAPPER At present this type of mapper auto fills the role with the user name of the creator of the instance based on the authenticated user initiating the instance This mapper is useful for testing purposes in order to assign the role specified in the property to the user instantiating the process By leveraging this mapper in all the roles defined in a workflow process developers can easily check that the workflow execution is working as expected 4 2 2 Practical Steps for Using Custom Mappers Mappers loading and compiling The Workflow engine loads and executes these classes at runtime To add a custom mapper perform the following steps Mappers are stored on the file system as standard java classes It is necessary to load the code that has been written into the production environment in which Nova
49. perties where xx is the java standard language code not necessary if the file was already renamed in step 2 Add the new property file to the package An ant task is provided to assist this step With the new language property file in the current directory run the target proed add lang This will ask for the name of the language file that will be added to the ProEd package The ant task will add the file as well as resign the jar files needed No other steps are necessary by the user When ProEd is executed the presence of the new language file is detected at runtime When the Change language dialog is used all languages found including those added by the above steps will be displayed in the list for selection as the target language for all ProEd panels and dialogs L3 Note If a new version of Workflow is installed the above steps must be repeated Chapter 5 Performer Assignment 47 Chapter 3 Hooks 3 1 3 1 1 48 Introduction to Hooks Hooks in Nova Bonita Workflow context are external java classes performing user defined operations At different moments in Workflow process execution hooks might be called by the workflow engine after instance activity state update Hooks may be called at different moments in the activity lifetime Depending on the activity type task or automatic only a set of them can be used Hooks are prefixed by the type of activity in which they are associated Table 3 1 Hooks Names
50. r There is no special format requirement for the name of a Workflow process s XPDL file however the following format is recommended and will be proposed in the dialogs whenever a new file name is required WorkflowProcessName version xpdl For example MedicalWorkflow 1 0 xpdl 2 3 Starting ProEd and ProEd Modes of Operation ProEd is available in two different versions as a desktop application or as an Eclipse plugin Both versions are available to download at the Bonita forge hitp forge objectweb org project showfiles php group_id 56 Nova Bonita subproject While ProEd desktop application swing application is more oriented to analysts the Eclipse plugin is more intended for developers as they can easily integrate ProEd to their Java development environment Chapter 5 Performer Assignment 9 23 1 launching ProEd as a desktop application Go to the Bonita download forge http forge objectweb org project showfiles php group id 56 and get the ProEd designer version for Bonita 4 0 1 bonita desktopDesigner 4 0 1 zip file Unzip this file in your favorite drive and you are done In order to execute ProEd desktop application just move to the unzipped directory and type ant The only prerequisite to run ProEd is to install Jakarta Ant version up to 1 6 4 go to http ant apache org bindownload cgi for downloading this project 2 3 2 Launching ProEd as an Edipse plugin Go to the Bonita download forge http
51. return John String activityId String iterationId Set lt String gt candidates Chapter 5 Performer Assignment ProcessInstanceUUID 63 Chapter 6 Multi Instantiator This feature allows to create and assign a number of activities to a set of actors human and systems at runtime Multi instantiatior concerns any activity type and are really useful in situations in which the number of occurrences of a particular activity is not known at definition time 6 1 Introduction The principle is based on the execution of an Multi Instantiator class added to the activity definition that returns an object containing e A list of values which size is determining the number of instances to be created and so executed This list of values is used to set for each created activity instance a dedicated activity variable this activity variable is also added to the definition of the activity e The number of finished instances expected to take the transition called joinNumber This number must be greater than O and lesser than or equal to the number of created instances 64 Bonita Workflow Development Guide 6 2 Practical Steps for Using Multi Instantiators 6 2 1 Multi Instantiators Loading and Compiling Multi instantiators are loaded and executed by the Workflow engine If adding a specific custom classs follow these steps e Create the source java file i e Mylnstantiator java e Compile this java file by adding the boni
52. rticipant Subflow activities are fat blue rectangles with a squared plus icon always automatic start and the SYSTEM participant The start activity is shown by a green rounded square always automatic start and the SYSTEM participant The end activity is shown by a red rounded square with a stop sign always automatic start and the SYSTEM participant Ordinary transitions are shown by solid black arrows Transitions that have a condition are shown by dashed green arrows The gear symbol indicates an activity that has the automatic start mode Table 2 2 Description of Activity View Graph Symbols 26 Bonita Workflow Development Guide To add an activity Basic activity route activity Subflow or End activity In the Workflow toolbar click on the activity button The cursor changes to indicate the selected activity type Click in the activity view at the location where the activity is to be added The activity will be added at the specified location The activity s dialog opens to enter the activity name and other activity properties except for the end activity which has no properties or dialog ProEd automatically changes back to the select mode indicated by an arrow cursor To add a transition In the Workflow toolbar click on the transition button The cursor changes to a cross and arrow In the activity view drag from the source activity to the target activity A transition is added between the two activ
53. s Right click on the item and select Properties from the context menu e The end activity has no properties that can be modified To access the items contained in subflow activity e Double click on the activity e Anew graph window opens showing the contents of the subflow e The contents of a subflow activity may not be edited in the new graph window 28 Bonita Workflow Development Guide Participant View The majority of the Activity View discussion in the previous section also applies to the Participant View Ex websale xpdl WebSale 1 0 53 X Reject aes i i Archive I ExpressDe T Y i r j Nd i SalesReview f 5 X 5 Y i x X n a 24 LY n S 7 H NS j i Di A Request Su 0X i P Cm C Activity 4t Participant XPDL Figure 2 23 Participant View The Participant View differs from the Activity View in the following ways e The activities are grouped by participant into swim lanes e The SYSTEM participant lane is shown at the top of the diagram with the other participants following in alphabetical order e Dragging a basic activity from one participant lane into another changes the activity s participant and modifies the start mode as necessary to maintain compatibility e Route subflow and end activities must use the SYSTEM participant so ProEd does not allow them to be dragged out of the SYSYEM lane e Activiti
54. s LDAP Custom and Properties sse terne entes 58 4 2 2 Practical Steps for Using Custom Mappers s sssesssessssesesseesseesneeseesnseneesnsessesneesnesssesneesnesusennesetesnseneesnes 58 4 2 3 Example of a Mapper ssssseeeeeeee tenente tentent tenete ette tente tenter tentent 59 lonee Deto m RR 60 Performer Assignment Types Custom and Properties sse teens 61 iv 5 3 6 1 6 2 5 2 1 Custom Performer Assignment treten tette tenente tentent rettet tnnt 61 5 2 2 Variables Performer Assignment iid tei pa ete ette pa e ge e tp ea 61 Practical Steps for Using Callback Performer Assignments 5 3 1 Performer Assignment Loading and Compiling 5 3 2 Example sta Performer Assignment a dt toot a y X RR OU D UH e IitroductlOH s eerie EUER Ii UTD RETO REOR ento eme tat 64 Practical Steps for Using Multi Instantiators seen tete 6 2 1 Multi Instantiators Loading and Compiling 6 2 2 Example of a Multi Instantiator Bonita Workflow Development Guide List of Figures Figure 2 1 Figure 2 2 Figure 2 3 Figure 2 4 Figure 2 5 Figure 2 6 Figure 2 7 Figure 2 8 Figure 2 9 Figure 2 10 Figure 2 11 Figure 2 12 Figure 2 13 Figure 2 14 Figure 2 15 Figure 2 16 Figure 2 17 Figure 2 18 Figure 2 19 Figure 2 20 Figure 2 21 Figure 2 22 Figure 2 23 Figure 2 24 Figure 2
55. s model Chapter 5 Performer Assignment 37 Pd Type Basic Activity Type of Join Description Multiple Instance Local variable to use Multi Instantiator class Performer Cr a ia Performer assignment Type variable Select a variable Type custom Hook concerned Figure 2 29 New Activity Window To create an activity l Inthe Workflow toolbar click the Activity button the pointer takes the shape of the Activity symbol 2 Position the pointer on the graph view and click the Activity creation window appears 3 Fillin the General tab of the New Activity window as detailed in the following Name type the Activity name Name must be unique Type this field displays the type of Activity selected i e Basic Start Mode select the start mode of the Activity Manual a performer is required to start the Activity 38 Bonita Workflow Development Guide Automatic the Activity is automatically performed by the system depending on the Activity Java class called Hook Type of Join this field specifies under what input condition the Activity becomes ready AND default value the Activity becomes ready only if all incoming transitional conditions are executed synchronization between preceding Activities XOR the Activity becomes ready if one incoming input transitional condition is executed Description enter information about the Act
56. s of the process e Route displays all route activities of the process e Transitions displays all transitions of the process Participants displays all participants of the process e Hooks displays all hooks of the process e Variables displays all variables of the process Configuration Menu e Interface Change language change the language of the application French English default see INTERNATIONALIZATION section Change color change the color of the main window and of all dialog boxes and menus Change look amp feel change the look amp feel of the application This allows a user to select how the process window is represented Chapter 5 Performer Assignment 23 24 Hee e mj Help Menu e Help displays the ProEd User s Manual e About displays ProEd version release date and copyrights TOOLBARS Main Toolbar x SANA s 9 B ox x Figure 2 20 ProEd Main toolbar Workflow Toolbar The Workflow Toolbar groups all Workflow design tools for easy access Button Description Cursor sets the pointer to its standard use Add Basic Activity creates a basic Activity the smallest unit of work See Creating and Defining Activities Add Route Activity creates a route Activity synchronization Activity with complex transitional conditions See Creating and Defining Activities Add Sub Process creates a complete Workflow Process model as an Activity See Creat
57. ssigning additional assignment rules other than those in the standard Workflow model mappers In the standard model all users assigned to a group associated to the activity are able to see and execute this activity ToDo List By adding this new functionality it is possible to e Assign the activity to a user of a group by calling a java class in charge to do the user selection into the user group custom performer assignment e Dynamically assign the activity to a user by using an activity property variables performer assignment When this functionality is added the user could be notified via mail notification for instance that the activity is ready to be started Others users of the groups called role in Nova Bonita associated to the activity will be considered as candidates and so will not see this activity Task in their todo list anymore Candidates list of users resolved by a mapper could be leverage by a performer assignment of type custom to make a selection of the user responsible for this manual activity execution 60 Bonita Workflow Development Guide 5 2 Performer Assignment Types Custom and Properties 2 Custom Performer Assignment This allows the process developer to write a request with a user defined algorithm When this type of custom performer assignment is added a call to a java class is performed The name of this callback performer assignment is the name of the called java class ex org myApplicat
58. t an existing file and click the Save button A dialog will appear to confirm the overwrite Dion Note that attempting to SaveAs and selecting a file that is currently in use results in an error dialog box Bonita Workflow Development Guide 2 5 4 Defining Workflow Process Properties A Workflow Process Model is composed of the following Activities Participants or Transitions between Activities Process and Activity Variables Process and Activity Hooks To define the Process Model Properties e Right click the background in the Graph view and select Properties in the popup menu e Or select Process Properties in the menus The Workflow project dialog is divided into seven tabs e Activity tab displays the list of all Activities included in this Workflow Process model To add an activity refer to Section 2 5 6 Participants tab displays the list of Participants defined for the entire Workflow Process model and available for all Activities Participants can be added edited or deleted Add button click to involve a Participant in the Workflow Process model see Section 2 5 5 Edit button click to modify the selected Participant Delete button click to delete the selected Participant Transitions tab displays the list of Transitions involved in the Workflow project To add a Transition see Section O e Variables tab defines the Process Variables used for the Process instantiation and prop
59. ta jar library in your compilation classpath Ey Note If the java class uses user defined libraries include them in your classpath before compiling and deploying the performer assignment Multi Instantiator deploying a Multi Instantiator Multi Instantiator is a new feature added in Bonita v4 A centralized way to deploy those entities is available through the ManagementAPI facade This API allows easily to deploy Multi instantiators MI but also any other advanced entities such hooks mappers Depending on the Nova Bonita deployment environment i e Tomcat Application Server Spring application this facade can be leveraged as a POJO or as a Session Bean The idea is to provide different operations allowing MI deployment e deployClass this operation deploys a single MI class e deployClasses operation allowing to deploy two or more MI in a single operation e deployClasseslnJar operation getting as a parameter a jar file which include a set of MI to be deployed Those operations deploy MI that could be leveraged afterwards by any workflow process deployed in Nova Bonita MI can also be deployed in the context of a workflow process meaning only visible for a particular workflow process e deployBar operation deploying a workflow process as well as hooks mappers and performer assignments entities Remove and replace operations are also available in this API allowing Mls removing and Mls classes updates e re
60. the Variable from the drop down list Select an operator is equal to l is different from not equal Comp Comparator gt is greater than lt lower than lt lower or equals than gt greater or equals than Select the desired value that corresponds to the above Variable selected from the drop down list A user valve defined value can also be entered if the selected Variable is of the Character String type Table 2 3 Description of Condition Parameters 3 Click OK to create or update the condition transitions with conditions as a dotted green arrow Chapter 5 Performer Assignment 45 MODIFYING THE PROPERTIES OF A TRANSITION l Right click a Transition arrow and select Variable The Transition window appears roEd Request_Approva Name Request Approval Source Request Target Approval Description Condition Variable Figure 2 34 Modifying Transition Properties 2 Fill in the window Name Transition only type the name of the Transition Source the name of the source Activity Target the name of the target Activity Description enter a description of the transition Condition enter information in this table as explained in Section 4 3 11 ADDING EDITING CONDITIONS ON TRANSITIONS 3 Click OK to update 46 Bonita Workflow Development Guide INTERNATIONALIZATION ProEd can be customized to displa
61. the user directory before deploying the Workflow Process Select Instance Initiator to call the initiator of the project Select Custom to call a java class that specifies a list of users nthe Class Name field For LDAP mapper connected mode only the field is unavailable The group of users role or organizational unit will be picked in the user directory For Instance Initiator mapper the field is unavailable The initiator of the Process will be the one assigner to the role For Custom mapper If any this field displays the list of available Java classes that call a specific list of users Select the appropriate Java class If the Java class is not yet implemented type the classname to be called Click OK to add the new Participant in the Workflow Process model Process level or as the performer of an Activity Activity level 2 5 6 Creating and Defining Activities Five types of activities are available within ProEd Basic Activity the smallest unit of work in a Workflow process The majority of Activities are basic Route Activity a flow control point or switch Activity used for synchronization and complex transitional conditions This type of Activity does not contain Hooks Sub process complete separate Workflow Process model set as an Activity of the current Workflow Process model This type of Activity allows simplifying the graph of the Workflow Process model or to reuse an existing Workflow Proces
62. ticipant in the Workflow Process model Process level or as the performer of an Activity Activity level Chapter 5 Performer Assignment 35 CHOOSING A NEW PARTICIPANT ProEd offers the capability of addng a Participant that does not exist in the user directory but must be integrated in the Workflow Process Model In the Add Participants window 1l Check the New participant checkbox 2 Fill in the fields in the New Participant area as follows Name type the name of the new Participant The name must be typed according to the user directory typographical rules Type select the type of Participant to be created e Role a group of users Human a specific person Organizational Unit an organization System for automated Activities The action is automatically performed depending on the Activity Java class called Hook V Hew Participant Name Type C Role C Organizational Unit C System Description Mapper Type v Class Name VW K X Cancel Figure 2 28 New Participant Window 36 Bonita Workflow Development Guide 3 If the Role or Organizational Unit Participant type is selected supply a runtime Mapper in the Mapper area to allow the role to person association not mandatory Inthe Type field Select LDAP to specify a group of users not yet created in the LDAP user directory In this case the new Participant must be created in
63. ting the Tx interface would be execute APIAccessor accessor ActivityInstance ActivityBody activityInstance While the first one gets a QueryAPlAccessor parameter only allowing access to the read only Nova Bonita APls the second one TxHook interface give access to the whole Nova Bonita API through the APlAccessor object Main purpose of this approach is to guarantees that exceptions in non transactional hooks will not cause any damage to workflow related data meaning updating the database state inside hooks should be avoided in non transactional hooks The other parameter of the execute operation is an object containing the execution data of the current activity in which the hook is executed This parameter represents the activity of a particular workflow instance Hooks Specific Operations Prior to coding a hook the developer should organize step by step the needed operations and call the appropriate functions to achieve the goal This code is enclosed in the hook main function Chapter 5 Performer Assignment 53 3 6 3 7 3 7 1 3 7 2 54 The main way to return an error signal to the Workflow the hook caller is to send a Java Exception The exception constructor takes a parameter string and Workflow upon receiving this exception is able to deal with it by a rollback if the hook is transactional Rollback type hook The end user may also be informed that a problem occurred during the activity treatment Caveat R
64. w Bonita Performer Assign New Bonita Project t New Bonita Role Mapper N New Bonita Transactional Hook New Bonita XPDL File 8 BPEL 2 0 m Figure 2 7 Creating a Bonita Hook Java entity 14 Bonita Workflow Development Guide Let s focus on Hooks creation As soon as you click Next on the previous dialog the plugin will move to the Hook creation wizard Java Class Create a new Java class Source folder ApprovalWorkflow srcfiava Package default Enclosing type Name Modifiers public default private protected abstract final static Superclass java lang Object Interfaces org ow bonita definition Hook Remove Which method stubs would you like to create public static void main String args Constructors from superclass v Inherited abstract methods Do you want to add comments as configured in the properties of the current project Generate comments Next gt Finish Figure 2 8 Editing Java Hook settings In this wizard you are allowed to specify the name of your hook as well as the java package in which you want it to be When you are done just click on the Next button this will automatically create a Java hook skeleton class File Edit Source Refactor Navigate Search Project Codegeneration Run Window Help i 0 q iBG 8iemnqi
65. y all static text in different languages The base product supports English and French All static text is contained in language specific property files A new language specific property file can be created by starting with one of the existing property files and customizing it At runtime ProEd will scan for valid language files and allow selection of any language that is present Follow these steps to add a new language to ProEd 1 Extract a base language property file from the ProEd jar file There is an ant task to assist in doing this The build xml file under the Workflow installation contains a proed extract lang target This can be used to extract any language file already in the ProEd package that resides in the delivery From Bull the package is delivered with 2 languages files ProEd_en properties for English and ProEd_fr properties for French The script will ask for the name of the language file to extract The file will be left in the current directory after the ant task is executed Rename this file by replacing the language code to be that for the desired new language For example if ProEd_en properties English was extracted in step 1 and a new Spanish version is to be built rename the file to ProEd_es properties Within the file for each property ending in text replace the property value with the language specific translation of the current value Save the modified property file specifying a name ProEd_xx pro

Download Pdf Manuals

image

Related Search

Related Contents

u - Free  Mode d`emploi Jack Puck  MCNP User Manual, Version 5  Weider WECCBE2496 User's Manual    Jabra® CRUISER2  Trust Lightning Charge & Sync Cable - 1 meter  BEDIENUNGSANLEITUNG  1 SOUNDIR ON Street Erhu  Zentrales Wohnungslüftungsgerät mit  

Copyright © All rights reserved.
Failed to retrieve file