Workflow

All of the documents evolve according to a defined life cycle. There are different ways that this can be done. One option is to use a workflow.

A workflow is a process in which a chain of users is defined to review, approve or reject a document. Workflows are traditionally used to validate documents (make them go to an "Approved" state), but they can also be used to have the document reviewed without a life cycle state change.

Your workflows can be created in the Workflow designer integrated in the LogicalDOC application. Users who are involved in workflows are alerted by email. They can have a synthetic view of all of the tasks that they have to do on documents in their dashboard. The documents for review are listed there.

The administrator creates workflow templates based on his organizational business process. Any system user may be involved in a workflow on one or more documents. 

The workflow consists of Tasks and Transitions that a collection of documents must pass through before the workflow can be considered complete.

  • Task: can be defined as a stage in a document’s life- cycle, such as 'billed', or 'draft'. Each workflow has a single start task, which is the initial task (displayed in green).
  • Transition: defines how documents move between tasks in the workflow. Transitions are actions that move a document to the next task.

Properly configure the SMTP connection

The workflow engine notifies the required persons when tasks must to be worked on , so it is important to correctly configure the connection to your SMTP server.

Workflow Elements

Each workflow is composed by several tasks connected by transitions. In the designer each task is drawn as a box with specific icon and color, and you can move them simply by dragging the object where you want in the drawing panel. To edit the properties of a specific element just double-click on it to open the context menu.

Here below you can see all the different types of tasks you can use.

TASK

A task represents a specific activity that can be accomplished by a number of participants.

Each template must have an initial task that is the first status where it is positioned the workflow when started. To mark a task as initial, double-click on it and select the Start Status item.

FORK

Sometimes it is necessary to launch two or more tasks at the same time, that's why the Fork primitive is available in the workflow designer. You can insert a Fork by clicking on Add Fork button. Basically a fork is a special task that automatically starts two or more tasks when the workflow goes into the fork status.

JOIN

When you need to wait for various parallel activities to complete before moving on, it is necessary to insert a Join element.

Click on Add Join and it appears the join object into the workflow schema design page. You can connect all the parallel activities to this node by using standard tranditions, and the system will guarantee the completion of all these before passing control to the next task.

Of course with a Join you can have more ingoing transitions but only one outgoing, that is automatically triggered when all the parallel activities are completed.

END STATUS

The End Status is the primitive you have to use to model the end of the business process. When the workflow reaches this status, the execution ends. An End Status can accept ingoing transactions only.

Workflow History

In the Workflow section of the dashboard, click on History to access the complete history of all the workflow instances.

In the Workflow selector, choose one of the entries to which you have access and optionally put a tag you are looking for and press the Search button.

Then double-click on one of the workflow instances to see the detailed list of all the events.

Administrators can inspect all the instances, while other users can see only those instances they initiated or supervised.

Completing a Task

Anytime a new task in which you are a participant has to be completed, you receive a notification by email. You can see all the details of the job in the Workflow section of the Dashboard.

Here you find three dashlets that show:

  • tasks assigned to you directly
  • tasks which you can take the ownership
  • tasks of workflows in which you are the supervisor

Take the ownership of a task

In the dashlet Tasks I can own double click on the task you want to start working on and then click on the Take OwnerShip button. Please note that this task is moved into the dashlet Tasks assigned to me. If your are the only possible participant of a task, the sytem will automatically assign the it to you so you will be not required to manually take the ownership.

Complete a task

Double click on a task you already own to open the details dialog box.

Here you can see all the details of the task, and in the Appended Documents tab you will find the list of documents currently included in the workflow.

Now you have all the information to complete the work and when you have finished it, just click on the button that reports the right transition name. This will complete the current task and the workflow will move on through the selected transition.

Appending new documents

Sometimes your work produces new documents which must be appended to the workflow, in this case just click on Add Documents to browse the folders and choose the documents to add, you can also use the current content of the clipboard by clicking on Add documents from clipboard.

Leave notes

If you open the Notes tab, you will see notes left by other colleagues involved in the same workflow, and you also can leave your own notes.

Workflow Progress

If you want to see the workflow progress, just click on Completion Diagram

Workflow Automation

The Workflow Automation allows you to execute automatic actions when a task is reached or assigned to a user or when a transition is taken. You program the automation through a simple scripting language based on Velocity Template Language (VTL).

To use this feature you must have a minimum of programming knowledge. Please look at the Automation Syntax Guide to familiarize with the syntax. You may also look at the Workflow Automation Snippets.

In your automation script you can reference the following variables:

Name Methods Description
nl   represents the new line
product   name of the product
locale   current locale
CURRENT_DATE   current date
candidates   list of the current task's candidate users
documents   list of the attached documents
task   the current task
taskName   name of the current task
initiator   the user that started the worflow
workflow   name of the workflow
processId   identifier of the current process
definitionId   identifier of the process definition
tenantId   identifier of the current tenant
actions   list of possible actions(transitions) declared for the current task
assignee   user assigned to the current task
DateTool

format(Date date, boolean time)

formats a date for the current locale optionally including the time
I18N

format(String key, String value)

prints the translation of a key and expands one optional value
format(String key, String value1, String value2) prints the translation of a key and expands 2 optional values
format(String key, String value1, String value2, String value3) prints the translation of a key and expands 3 optional values
format(String key, String value1, String value2, String value3, String value4) prints the translation of a key and expands 4 optional values
format(String key, String value1, String value2, String value3, String value4, String value 5) prints the translation of a key and expands 5 optional values
format(String key, String[] values) prints the translation of a key and expands an array of optional values
DocTool downloadUrl(long docId) prints the download Url for the given document's id
downloadUrl(Document doc) prints the download Url for the given document
downloadUrl(History history) prints the download Url for the given event
downloadTicket(long docId, boolean pdfConversion, Integer expireHours, Date expireDate) creates and prints the a download ticket for the given document or it's PDF conversion
displayUrl(long tenantId, long docId) prints the display Url for the given document's id
displayUrl(Document doc) prints the display Url for the given document
displayUrl(History history) prints the display Url for the given event
store(Document doc) stores a document
store(Document doc, String username) stores a document in the name of the given user
move(Document doc, String targetPath, String username) moves a document in a target path
copy(Document doc, String targetPath, String username) copies a document in a target path
Folder createPath(Document doc, String targetPath) creates a path, if the path is relative it is computed from the document's folder. Returns the created folder
Document convert(Document doc, String format, Sring username) converts a document into a different format in the name of the given user. Returns the created document
displayFileSize(Long size) prints a formatted file size
getPath(Document doc) prints the path of the given document
FolderTool displayUrl(long tenantId, long folderId) prints the display Url for the given folder's id
displayUrl(Folder folder) prints the display Url for the given folder
displayUrl(FolderHistory history) prints the display Url for the given event
getPath(Long folderId) prints the path of the given folder
ClassTool Object newInstance(String classname) instanciates the given class. Returns the created instance
SystemTool exec(String commandline) executes a given command
exec(String commandline, String path) executes a given command from a specific path
execGetOutput(String commandline) executes a given command and returns the output
execGetOutput(String commandline, String path) executes a given command from a specific path and returns the output
log print(String message) prints a message in the system output
debug(String message) prints a debug message in the log file
info(String message) prints an informative message in the log file
warn(String message) prints a warning message in the log file
error(String message) prints an error message in the log file
WorkflowTool complete(Task task, String transition) completes a task with the given transition
claim(Task task, String username) claims a task for the given user
completeUrl(Task task, String transition, User user) prints the Url to complete the task with a specific transition
claimUrl(Task task, User user) prints the Url to claim a task for a specific user
addNote(Task task, String note) adds a new note on the given task instance
getHistories(String processId, String eventName) gets the list of events of a given process instance, you can optionally filter for a given event name('task.start', 'task.end', ...)
getLastHistory(String processId, String eventName) gets the last event of a given process instance, you can optionally filter for a given event name('task.start', 'task.end', ...)
MailTool sendDocuments(Collection<Document> documents, String from, String to, String subject, String message) sends a collection of documents by email to a recipient
sendDocuments(Collection<Document> documents, String from, Collection<String> to, String subject,
String message)
sends a collection of documents by email to a set of recipients
sendDocument(Document document, String from, String to, String subject, String message) sends a document by email to a recipient
sendDocument(Document document, String from, Collection<String> to, String subject, String message) sends a document by email to a set of recipients
sendMessage(long tenantId, String from, String to, String subject, String message) sends an email to a recipient
sendMessage(long tenantId, String from, Collection<String> to, String subject, String message) sends an email to a set of recipients
BarcodeTool extract(Document doc, String possibleFormats) extracts the barcodes inside a given document, you can optionally filter by format("CODE_39,EAN_8")
extract(String filePath, String tenant, String possibleFormats) extracts the barcodes inside a given file, you can optionally filter by format("CODE_39,EAN_8")
extractBarcode(Document doc, String possibleFormats) extracts the first barcode inside a given document, you can optionally filter by format("CODE_39,EAN_8")
extractBarcode(String filePath, String tenant, String possibleFormats) extracts the first barcode inside a given file, you can optionally filter by format("CODE_39,EAN_8")