Web UI

HOWTO: Customize Workflow Tasks

Updated: February 22, 2018 Page Information Edit on GitHub

Follow the related video course and exercises on Nuxeo University.

In this tutorial you will learn how to create a custom workflow tasks layout in Studio Designer. We'll be using a custom validation workflow template linked to the Contract document type.


Create a Workflow Template

First, we need to create a new workflow template in Studio Modeler. This workflow will be applied to the Contract document type.

  1. Go to Workflow > Process Definitions and click on New.
  2. On the Activation tab, next to the field Current document has one of the types, select the Contract local type and move it from left to right. Now we will add a custom workflow variable called Type to specify which type of contract you are validating.
  3. On the Variables tab, add a field type as a string.
  4. On the Graph tab, select an Accept/Reject user tasks and drag and drop it on the graph.
  5. Click on the Edit button next to the task.
  6. Fill in the General tab as shown below:
  7. On the Variables tab, activate the custom variable by moving it to the right box.
  8. Save your changes. You should end up with a graph like this:

We will finish our Studio Modeler configuration by creating a vocabulary for the Type variable, to be able to select the type from a drop down list during the workflow process. The vocabulary will be composed of three different types of employment contract.

  1. Go to Vocabularies and click on New
  2. Fill in the rows like this:
Id Label
full-time-part-time Full-time and part-time
fixed-terms Fixed-term
freelance-consultant-contractor Freelancers, consultants, contractors
  1. Save your modifications.

Create a Task layout

We can now configure our layout on Studio Designer.

  1. On the Layouts tab, go to the Workflows menu and click on Contract Validation task and then on CONFIGURE. The workflow layout works as the document type layout, you can browse the element catalog and switch editors between code and visual.
  2. You can start by reorder the properties on the visual editor to end up with something like this:
  3. Switch to editor from visual to code and change the line corresponding to the type field to turn it into a nuxeo-directory-suggestion to link the type property to the associated directory:
    <nuxeo-directory-suggestion role="widget" label="Type"
     placeholder="Select the contract type..."
  4. Save your changes.

You can now deploy your project on your instance and see what it looks like!

Technical Overview

Workflow Tasks

Each workflow task has its own form defined by a dedicated element. This form is excluded from the vulcanization process and is therefore dynamically loaded.

In the $NUXEO_SERVER/nxserver/nuxeo.war/ui/ directory, you can see:

└── workflow
    ├── nuxeo-document-task.html
    ├── nuxeo-document-task-review-result.html
    ├── paralleldocumentreview
    │   ├── nuxeo-task2169-layout.html
    │   ├── nuxeo-task2556-layout.html
    │   └── nuxeo-task328d-layout.html
    └── serialdocumentreview
        ├── nuxeo-task38e-layout.html
        ├── nuxeo-task542-layout.html
        └── nuxeo-task6d8-layout.html

By convention, a $NUXEO_SERVER/nxserver/nuxeo.war/ui/workflow/{worfklowName}/nuxeo-{taskId}-layout.html file defines the form layout of the task with task ID {taskId} for the workflow {worfklowName}.

a month ago Manon Lumeau review workflow howto
a month ago Manon Lumeau Fix studio button name
3 months ago manonlumeau NXDOC-1405: format + clean up + ok for lts2017
3 months ago Manon Lumeau add tags for doc days
4 months ago manonlumeau Update NX University links with Docebo URLs
4 months ago manonlumeau Added content-review-lts2017 label
5 months ago manonlumeau NXDOC-1346-FT review screenshot
History: Created by manonlumeau

We'd love to hear your thoughts!

All fields required