Managing Workflows Using the Workflow Collaboration Center

Objective

After completing this lesson, you will be able to manage a workflow by using the Collaboration Center, including triggering, monitoring and interacting with the workflow.

Introduction

​The Collaboration Center integrates workflows into Backoffice. It is available in all cockpits, notifies internal users of the tasks assigned to them by workflow action steps, and allows them to complete the ensuing decision steps, allowing the workflow to proceed.

Launching a Workflow

​The collaboration sidebar, invoked when you click the appropriate icon in the header (highlighted in the diagram below), displays information about the current user’s assigned tasks. If the current user has the permission to launch one or more workflows, the sidebar also shows running workflows and, at the bottom of the page, a drop box to create a new one. ​Alternatively, the area at the bottom allows you to create a workflow by dropping items onto it.

Managing workflows via the Collaboration sidebar that opens when clicking the Collaboration Center icon in the Backoffice header. It displays running and prepared workflows, as well as tasks assigned to the current user. A large + button at the bottom can be used to create a workflow.

​Usually, the items attached to a workflow are the focus of its tasks. If Alex clicks the + at the bottom of the collaboration sidebar, she can:

  1. Create an empty workflow

  2. Attach items

  3. Start the workflow.

To save time, she can drag one or more items to the + box, then select the workflow template. The workflow she creates will have the dragged items as attachments. She can then add more items if she likes before starting the workflow. However, once she has started the workflow, she cannot add or remove attached items.

Automatically Launch a Workflow

​Alternatively, a workflow can launch itself, using an Activation script written in Java. This script, which is part of the workflow template’s definition, will be run every time an item is modified in Backoffice. If the script returns a value of true, the workflow is launched, using the modified item as an attachment. ​

For example, the script for the Product Approval workflow tests whether the item being modified is a Product, whether the action performed on that item is either create or save, and whether the product’s Approval Status is "check". If all three conditions hold true, the workflow launches with the product attached.

A diagram visualizing the preconditions to start a workflow, ensuring that the type is “Product”, the action is either “create” or “save”, and the approval is “check”. If all these are true, then the workflow starts.A section of the Product Approval workflow template's edit page shows the first few lines of its activation script, written in Java. This script implements the preceding diagram.

Note

​Activation Scripts are typically written by developers, while very simple ones can be understood and even written by business users.

​If you are interested, please have a look at sample workflows in the system to familiarize yourself with these scripts if needed.

The following simplified script example will create a new workflow when a product is saved and its approval status is check:

Java
123456789101112131415
( // save item action.equals("save") &&   // currentValues must be set currentValues != null &&   // approvalStatus must be set currentValues.get("approvalstatus") != null &&   // approvalStatus must be set to "check" currentValues.get("approvalstatus").getCode().equals("check") &&   // saved item is a product typeService.isAssignableFrom("Product", itemType.getCode()) )

Example Workflow

​Let’s take another example, the Product Approval workflow. It is configured to launch itself automatically whenever a product is created or modified with the approval property set to "check". ​As shown in the example below, the workflow has two start nodes. One task appears on Milly's collaboration sidebar, because she is a member of the Product Management Group. The other task appears on Jet’s collaboration sidebar, because he belongs to the Purchase Group. ​Once Milly and Jet indicate that they've done their work, the workflow then displays a task on Chris's collaboration sidebar because he belongs to the Marketing Group. Chris can reject the workflow back to either Milly or Jet if there's a problem, or approve the workflow, which then ends.

Milly and Jet can provide product management and purchase approvals. When they’re done, Chris , on behalf of product marketing, either sends workflow back to Milly or Jet, or to Product Approved.

​And here are the sidebars seen by the administrator who launched the workflow, Milly, Jet, and finally Chris. ​The collaboration sidebar of the administrator shows that the workflow Product Approval was launched and runs now with multiple parallel tasks. It also shows that the tasks includes a single attachment, which is carried over to all subsequent tasks. ​Milly's sidebar shows the Approval through Product Management task, and Jet's sidebar shows the Approval through Purchase task. Once both these tasks are complete, Chris finally sees a task on his sidebar. When he approves it, the workflow ends.

The collaboration sidebar shows the Administrator launching the workflow that Product Approval is running with multiple parallel tasks. Milly's sidebar shows the Approval through Product Management task, Jet's sidebar shows the Approval through Purchase task, and Chris, once those two tasks are complete, sees a task on his sidebar

Triggering, Interacting, and Monitoring Workflow Progress

In the next video, you will see the Product Approval workflow in Backoffice. It demonstrates how multiple employees work together through the collaboration center to ensure a product is properly configured before it’s approved for display on the live site.

Summary

  • The Collaboration Center integrates workflow management into Backoffice, providing a centralized hub for task management.

  • Workflows can be launched manually via the collaboration sidebar or automatically using Activation scripts.

  • Attaching items to workflows is helpful (and sometimes mandatory) for focusing tasks and ensuring relevant information is available.