Upload
joget-workflow
View
157
Download
0
Embed Size (px)
Citation preview
All Rights Reserved © Joget Inc
Joget Workflow v5
Doing more with your Process Design
http://facebook.com/jogetworkflowhttp://twitter.com/jogetworkflow
Last Revised on May 2016Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Prerequisites
1. Knowledge about designing process using the Workflow Designer.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Content
1. Type of routes2. Participant Mapping using Workflow Variable
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Chapter 1
Type of routes
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Routes
• Route is used to split or merge a process flow.• The 2 types of routes supported by Process Builder are:
– Exclusive (XOR)
– Parallel (AND)
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Exclusive Route
• After “Activity 1”, only 1 path will be taken, either Activity 2, 3 or 4, based on matching condition.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Exclusive Route
• What if there’s no condition set at all?
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Parallel Route
• After “Activity 1”, next 3 activities will be executed simultaneously.
• “Activity 5” will not be performed until Activity 2, 3, and 4 are completed.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Discussion
• List down all combinations of Join and Split type and how it would affect the process flow.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Chapter Review
1. Understand the use of Route and its configurations.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Chapter 2
Participant Mapping using Workflow Variable
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Participant Mapping using Workflow Variable
• Dynamically map to participant using workflow variable.• Workflow variable may consists of:-
1. Group code2. Username3. Department code4. Head of Department (Department code)
• Supports multiple assignments. (Semicolon separated value [Eg. jack;david;clark])
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Problem statement
• A new role is added to existing process but the participant can only be decided during the runtime. (In the last activity before the activity in the new role’s swimlane)
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Exercise: Amend Process flow to include new Participant
• Add a new participant – HR• Add a new workflow variable - hr
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Map participant to workflow variable
• Select the workflow variable to be used under “Map to Workflow Variable” in participant mapping and choose the appropriate mapping type.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Mapping form field to workflow variable
• Any *input element can be used to assign value to the Workflow Variable.• Insert a text field element into the form and tie to the workflow variable created
earlier.* Input elements that allow mapping to Workflow Variable are:-
– Checkbox– Date Picker– Hidden Field– ID Generator Field– Radio– Select Box– Textarea– Text Field– Calculation Field– Multi Select Box– Popup Select Box– Time Picker
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Mapping form field to workflow variable
• Insert a text field element into the form and tie to it.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Exercise: Verify participant mapping
• Run the process to test whether the participant mapping works as designed.
• The new participant should be assigned to the username as specified in the form.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Creating form element to populate user list using Bean Shell Form Binder
• Create a Select Box element
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Creating form element to populate user list using Bean Shell Form Binder
• Configure the ID and Label to be the same as the previous one.
• Choose Bean Shell Form Binder as the Options Binder.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Creating form element to populate user list using Bean Shell Form Binder
• Go to the next tab to configure the Bean Shell Form Binder.
• Populate Script with code in the next slide.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Populate select box using Bean Shell Form Binderimport java.util.Collection;import org.joget.apps.app.service.AppUtil;import org.joget.apps.form.model.FormRow;import org.joget.apps.form.model.FormRowSet;import org.joget.directory.model.service.ExtDirectoryManager;import org.joget.directory.model.User;import org.springframework.context.ApplicationContext;
ApplicationContext ac = AppUtil.getApplicationContext();ExtDirectoryManager directoryManager = (ExtDirectoryManager) ac.getBean("directoryManager");
FormRowSet results = new FormRowSet();results.setMultiRow(true);
Collection userList = directoryManager.getUserList();
for (User u : userList) {FormRow r = new FormRow();r.setProperty("value", u.getUsername());r.setProperty("label", u.getFirstName() + " " + u.getLastName() + " (" + u.getUsername() + ")");results.add(r);
}return results;
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Advanced Participant Mapping using Bean Shell Form Binder
• Go to the last tab and map the Workflow Variable.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Exercise: Verify participant mapping
• Run the process again to test whether the participant mapping works as designed.
• The new participant should be assigned to the username as specified in the form.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Materials
• The Bean Shell code used in this chapter can be obtained from 19.2.1.txt
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Chapter Review
1. Able to assign Participant by using Workflow Variable’s value.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Module Review
1. Understand the use of Route and its configurations.2. Able to assign Participant by using Workflow Variable’s
value.
Joget Inc Internal Use Only
All Rights Reserved © Joget Inc
Stay Connected with Joget Workflow
• http://www.joget.org • http://community.joget.org • http://twitter.com/jogetworkflow • http://facebook.com/jogetworkflow • http://youtube.com/jogetworkflow • http://slideshare.net/joget
Joget Inc Internal Use Only