IBM Business Automation Workflow Custom Task Assignment

Demonstrates how to set custom task assignments using JavaScript expression in IBM BAW 19.0.0.3

--

Pixabay © pexels.com

Code Repository

You can find all the artifact used for the example that will be explained below in the toolkit in Git repository

Introduction

In my last article, I have demonstrated two ways to set task assignment settings with Team Filtering and Direct Assignment that you can find in this link. There’s an update in the release of BAW v19.0.0.3, where we can set custom assignment using a JavaScript expression. This feature does exist already in the old version using the Eclipse Process Designer. Starting BAW v19.0.0.3, custom assignment feature is now available in Web Process Designer.

Assignment Options

You can see this new option in Assignments setting in user task activity, as shown in Figure 1.

Figure 1: Custom Assignment in Assignments Settings

The typical use for this option is to create the expression dynamical in a variable, resulting in the task will be assigned to a specific user or security group, more on this in the next section. You will notice in the developer notes that it tags the Custom option as Deprecated. This feature is part of Eclipse PD that does not carry over to Web PD of BAW’s previous version.

Note: If the user wants to display in the Team Performance dashboard, the task should be assigned to a Team or a Lane because tasks assigned to a Custom option will not display on the Team Performance dashboard.

The Expression

Figure 2 shows the description of the Expression setting that expects the result of:

USER:<user_name> or ROLE:<group_name>

where <user_name> is the user name which also used for logging in to Portal, and <group_name> is the name of the security group. Take note here that ROLE use security group instead of Teams in the process application.

Figure 2: Expression note

Custom Assignment Example

To provide an example, I copy and modify the Dynamic Team Filtering that I created in the last article and change the options for assignments as shown in Figure 3. In this example process, the User Task will be assigned to a specific user name instead of the Team Lane.

Figure 3: Custom Assignment in Assignments Settings

For the expression, you need to bind a string variable and write the expression in Assignment Expression as shown in Figure 4. From the diagram, ‘User Location Filter’ service will output the selectedUser and this will be appended to the expression. Take note that the selectedUser variable will have user_a as the output.

Figure 4: JavaScript expression for assignments

Once we have completed the configuration for custom assignment, you can now run the example from the designer. As you run it you will see in the Inspector that the user task is assigned to user_a, which is according to the configuration that we set in the JavaScript expression.

Figure 5: Process Inspector showing User Task

Task Reassignment

As we see from the example, a custom assignment can give a similar result with other ways of assignment as shown in my previous article and it is quicker to set up since it does not need additional service flow to call. The important thing that needs to be considered is that assigning task this way will ignore the team set up in the lane, so if you assign a task to a certain user when the admin or manager want to reassign the task, they will see the list of all user in the BAW which come from tw_alluser.

Figure 6: Task can be Reassign to tw_alluser

--

--