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.

Task Editor

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

There is special attribute available for dynamic task assignment:
ld_initiator: the user that manually launched the workflow

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
VariableJava ClassDescription
candidatesUserlist of the current task's candidate users
documentsDocumentlist of the attached documents
documentDocumentfirst element of the documents list
taskthe current task
taskNamename of the current task
initiatorUserthe user that started the workflow
workflowname of the workflow
processIdidentifier of the current process
definitionIdidentifier of the process definition
actionslist of possible actions(transitions) declared for the current task
actionname of the current action(transition), only available inside the transition
assigneeuser 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
VariableJava ClassDescription
candidatesUserlist of the current task's candidate users
documentsDocumentlist of the attached documents
documentDocumentfirst element of the documents list
taskthe current task
taskNamename of the current task
initiatorUserthe user that started the workflow
workflowname of the workflow
processIdidentifier of the current process
definitionIdidentifier of the process definition
actionslist of possible actions(transitions) declared for the current task
actionname of the current action(transition), only available inside the transition
assigneeuser assigned to the current task

Read the Automation manual for more information.