User tasks in workflows

In this tutorial you create and configure a workflow user task, give it a name and a description, assign it to a user, and add form fields to create a dialog box. You then deploy and run the workflow containing the task to see the results in Collibra Data Governance Center(Collibra DGC).

Prerequisites

  • Eclipse IDE.
  • Flowable Eclipse Designer plugin.
  • Access to a Collibra DGC environment as a user with the Sysadmin global role or a global role that has at least the Workflow Administration global permission.
  • Access to the Collibra Console for troubleshooting.

For more installation details and to get familiar with the Eclipse IDE interface, see Getting Started with workflows.

Create a user task

Open Eclipse IDE and

  1. Create a new Flowable project and diagram.
  2. Add a pool and configure its properties.
  3. Add a start event and an end event.

Tip   If you have followed the Hello World! tutorial, you should already have a diagram containing a start event, and an end event. If you don’t want your Hello World! workflow to be replaced by the new workflow, make a copy of the diagram and change the process ID of the pool.

Note   For more information on how to create a Flowable project and diagram, see the Getting started with workflows and the Hello World! tutorials.

To create a user task from the Palette:

From the Task section of the Palette, drag a UserTask to the pool.

Connect the start event to the user task:

Hover the pointer over the start event and drag the Connection icon over the user task.

Connect the user task to the end event:

Hover the pointer over the user task and drag the Connection icon over the end event.

To create a user task from the start event:

Hover the pointer over the start event and click the UserTask icon.

A user task is added to the pool and a connection created between the start event and the user task.

Connect the user task to the end event:

Hover the pointer over the user task and drag the Connection icon over the end event.

Configure the user task

  1. Select the user task.
  2. In the Properties view, select the General section.
  3. In the Name field, enter a title for the task. We are using My Task in this example.

  4. In the Properties view, select the Documentation section.
  5. In the Documentation field, enter a description for the task. We are using A brief description of the task. in this example.

The task properties will be reflected in Collibra DGCwhen the task is active:

Assign a user to the task

You need to assign the user task to a user. A candidate user is a user who can perform a workflow task. You can specify candidate users by using candidate user expressions.

Tip   We recommend to enclose all user expressions in curly brackets.

Expression

Description

Example

{user(<userName>)}

The task is assigned to the user having the specified user name.

{user(Admin)}

{role(<roleName>)}

The task is assigned to the users having the specified role.

{role(Catalog)}

{group(<groupName>)}

The task is assigned to the users belonging to the specified group.

{group(Data Custodians)}

To learn more about candidate user expressions, read the Candidate user expressions Collibra DGC Administration Guide section.

Tip   While developing a workflow, you should assign yourself to the tasks you are creating. The real user assignments should be completed towards the end of the testing process.

We are assigning the task to the same user who starts the workflow.

To define the user who starts the workflow:

  1. In the shared area, select the start event.
  2. In the Properties view, select the Main config section.
  3. In the Initiator field, enter a name for the variable that defines the user who starts the workflow. We are using startUser in this example. The value of the variable becomes the username of that user.

  4. Select the user task.
  5. In the Properties view, select the Main config section.
  6. In the Candidate users field enter {user(${startUser})}.

    This assigns the task to the user who started the workflow defined by the variable startUser. The variable is called by enclosing it inside an expression: ${}. The value of the variable is then assigned to the user() object.

Add form fields to the task

As is, the user task only contains the name, a description and a user assignation. Use form fields to create a dialog box and to provide and request more information. Some of the available form fields are:

Type

Usage, Configuration and Example

string
Enter a single line of non formatted text.
plainText
Enter multiple lines of non formatted text.
textarea
Enter multiple lines of formatted text.
long
Enter a whole number.
boolean
Make a choice between two given values.
datetime
Select a date or a date and time.
Form values Id Name
dateTimeType datetime
dateTimeType date
checkbox
Select multiple possible values from a list of predefined values.
Form values Id Name
<Id1> <First value>
<Id2> <Second value>
radiobox
Select one possible value from a list of predefined values.
Form values Id Name
<Id1> <First value>
<Id2> <Second value>
fileUpload
Upload a file via the system explorer or by dragging and dropping.
button
Set the button value to true, submit the form and close the dialog box.

For a full list of available options, see the Form property types Collibra DGC Administration Guide section.

To add a simple form field to the task:

  1. Select the user task.
  2. In the Properties view, select the Form section.
  3. Click New.

    The Form property configuration window appears.

  4. In the Form property configuration window, enter the Id, the Name and the Type of the form. We are using string1, String example and string in this example.

  5. Click OK.

    The form properties are added to the task and the Required, Readable and Writable properties are set to their default values: false, true and true, respectively.

To add a form that requires additional configuration:

  1. Select the user task.
  2. In the Properties view, select the Form section.
  3. Click New.

    The Form property configuration window appears.

  4. In the Form property configuration window, enter the Id, the Name and the Type of the form. We are using checkbox1, Check box example and checkbox in this example.

  5. In the Form values section, click New.

  6. In the Form value configuration window, enter the Id and Name of the form values. We are using cxb1, First choice and cxb2, Second choice in this example.

  7. Click OK.
  8. Repeat steps 5, 6, and 7 for as many times as necessary.
  9. In the Form property configuration window, click OK.

    The form properties are added to the task and the Required, Readable and Writable properties are set to their default values: false, true and true, respectively.

Follow the above steps to add more forms to your task and save your work.

Upload the BPMN file to Collibra DGC

  1. Sign in to Collibra DGC as a user with the Sysadmin global role or a global role that has at least the Workflow Administration global permission.
  2. In the main menu, click Settings.
  3. In the tab pane, click WorkflowsDefinitions.
  4. Click Upload a file and locate the BPMN file you have just created inside the Eclipse workspace folder.

    Tip   With the BPMN file selected in Eclipse, select NavigateShow InSystem Explorer. An explorer window will open, showing the exact file location. You can now drag and drop the file to the Upload a file section in your browser.

An Activity Queue window displays the upload progress.

Once the file is uploaded, you see your workflow in the Workflows Definitions table.

For more details, see the Deploy a workflow section of the Collibra Data Governance Center Administration Guide.

Configure and enable the workflow

When you upload workflows to Collibra DGC, they are automatically deployed but not enabled. Workflows most likely require additional configuration.

The following configuration allows you to start the workflow from a community page.

To configure your workflow:

  1. Sign in to Collibra DGC as a user with the Sysadmin global role or a global role that has at least the Workflow Administration global permission.
  2. In the main menu, click Settings.
  3. In the tab pane, click WorkflowsDefinitions.
  4. Click the name of the workflow.
  5. In the Applies To section, click the edit icon .
  6. Select Community from the drop-down menu and click Save.
  7. To confirm the change, click Yes in the dialog box.

The current workflow status is Disabled. To enable the workflow, click the icon in the title bar, in the upper-right part of the page.

Start the workflow

Workflows may be configured to be available in different sections of the Collibra Data Governance Center or to different roles but in this example, we have configured the workflow so that you may start it from a community page.

Navigate to any community page. We have selected the out of the box Business Analysts Communityin this example.

Note   Depending on the level of customization of your Collibra DGC environment, the logo and the available communities might differ.

To start the workflow, click the button with the workflow name in the title bar, under the name of the community.

A notification indicates the workflow has started.

You see the green task bar appear under the title bar with the values defined previously for title and additional text.

To see the task dialog box, click View task a the right of the task bar.

To complete the workflow, click Submit on the dialog box.

The workflow ends, and the task form and task bar closes.

Note   If you would like to start the workflow again, press the button with the workflow name in the title bar.

For additional details, see the Enable or disable a workflow section of the Collibra Data Governance Center Administration Guide and the Using workflows section of the Collibra DGC User Guide.

Troubleshooting

Upload errors

In case of errors, the workflow does not upload, and an error message is displayed.

The logs contain more information about the error:

  1. Open Collibra Console.Collibra Console opens with the Infrastructure page.
  2. Click the name of the environment you deployed the workflow in to display its details.
  3. Select Data Governance Center.
  4. Select Logs → dgc.log

Look for errors related to the workflow upload.

Next steps

You have added forms to a user task, and saw how they appear in Collibra DGC.

The next tutorial will show you how to control the workflow by using exclusive gateways.

Additional resources