Designing a Workflow
To add a new Task in your workflow template, click the on Add Task button in the toolbar and a new square appears into the design panel. By default, it is a blue square, if you want to make it your initial task, just double click over it and select the Start Status item, the color will change to green.
To change more properties, double-click on the task and select the Edit item.
A task may or may not require human interaction, depending on what you set in Human interaction. In this case, inside the Candidates section, you can statically assign the task to users and/or groups by selecting them in the User and Group drop down lists. When you select a user or group, you will see the same appearing in the list of candidates. To remove a candidate, select the item and then click on Remove button. Click on Save button to close the window confirming all the settings. Please note that each one of the candidates can own the task so they all will be notified when the task has to be completed, but only one of them will be able to take the ownership and do the job. If you have just one candidate, he will automatically own the task.
Escalation Management
As well as the name and description, you can set the Escalation Management, that is composed by:
- Due date: the maximum task duration
- Remind-Time: defines, after the due date time is expired, how often the involved users will be remembered by email to complete the assigned task
Note at Completion
You may require the user to leave a note when the task has been completed, in this case you have to enable the Require note at completion flag and optionally specify a minimum note size.
Dynamic assignment
Instead of statically define a set of users and groups as possible owners of a task, you can implement a dynamic assignment based on document's metadata(the extended attributes of the document currently involved in the workflow). In the Participants section of the task's dialog box you find a specific Attribute field, here write the name of a custom attribute of type User then press the plus icon to add this in the participants list. At runtime LogicalDOC will inspect the currently involved documents, searching for the attributes you specified here as participants and will add the referenced users as possible owners of the task.
Special attribute for dynamic assignment
Automation
You can execute your own business logic when the task is instantiated or assigned to a participant, to do so open the Automation tab and type your scripts in the respective text areas.
Dictionary available for the Automation in this context
AUTOMATION CONTEXT: WORKFLOW | ||
---|---|---|
Variable | Java Class | Description |
candidates | User | list of the current task's candidate users |
documents | Document | list of the attached documents |
document | Document | first element of the documents list |
task | Task | the current task |
taskName | String | name of the current task |
initiator | User | the user that started the workflow |
workflow | String | name of the workflow |
processId | String | identifier of the current process |
definitionId | String | identifier of the process definition |
actions | List | list of possible actions(transitions) declared for the current task |
action | String | name of the current action(transition), only available inside the transition |
assignee | User | user assigned to the current task |
Read the Automation manual for more information.
Transitions
Once you created your tasks you have to define the transitions between them; to do this, move the cursor near the border of the task's square until you see the hook icon and then drag&drop the arrow to the desired target task. Each transition must have a name, and you can edit it by double-clicking on the label.
Automation
You can execute your own business logic when the transition is chosen, to do so open the Automation tab and type your script in the respective text area.
Dictionary available for the Automation in this context
AUTOMATION CONTEXT: WORKFLOW | ||
---|---|---|
Variable | Java Class | Description |
candidates | User | list of the current task's candidate users |
documents | Document | list of the attached documents |
document | Document | first element of the documents list |
task | Task | the current task |
taskName | String | name of the current task |
initiator | User | the user that started the workflow |
workflow | String | name of the workflow |
processId | String | identifier of the current process |
definitionId | String | identifier of the process definition |
actions | List | list of possible actions(transitions) declared for the current task |
action | String | name of the current action(transition), only available inside the transition |
assignee | User | user assigned to the current task |
Read the Automation manual for more information.