Assign a User in Charge

When do I use Dynamic Users?

For example, you have two tasks assigned to multiple users. Whoever accepts the first one should also get the second task.

Below, you can see the finished model for our example. The first task is assigned to Dev-Department and to a Dynamic user. If one user from the Dev-Department group accepts the task, the same user will also get the second one.

assign-a-dynamic-user-in-charge-2018-07-24

Create a Role Model 

First, you need to create a role with at least two users. Under Designers, you can find a category named Roles

assign-a-dynamic-user-in-charge-2018-07-24-1

Double-click the role and rename it Dev-Department. Right-click the role element and click Add/Remove users.

Above the Name label, you can see “abr” typed in, this is because you need to type in at least three letters in order to search for a user. Double-click the users you want to select for this role. Hit OK. 

assignUserInCharge

Save your Role model and you are ready to switch back to your process.

Create and configure a Process Model (Workflow)

In the tab Processes click on New Model. Drag & drop the following elements onto the canvas: Start, Task, Task, End. Name them properly, to get a better feeling for your workflow. Now save your model. Click on Edit Workflow Variables and add the following fields. Click OK.

assign-a-dynamic-user-in-charge-2018-07-25

Configure the first Task Element

The Start element does not need any specific configuration, you can leave it as it is. Right-click the first Task and click Select role. Double-click the previously created Role model and click OK

assign-a-dynamic-user-in-charge-2018-07-25-18

Double-click the Dev-Department and click OK. Now right-click the first Task again and click Select business entity fields.

assign-a-dynamic-user-in-charge-2018-07-25-2

Click on Workflow Variables and double-click both. Mark them as output (Red Arrow). Hit OK. Right-click the Task again and click Select user in charge.

Switch to Dynamic click on User name and “UserInCharge”, do not forget to tick both checkboxes. Is the first checkbox ticked, the username, of the user who completes the task, will be written into our workflow variable. Is the second checkbox ticked, the task will be assigned to the role because at this moment our workflow variable “UserInCharge” is empty. Click OK.

assign-a-dynamic-user-in-charge-2018-07-25-4

Now right-click the first Task again and select Form builder. Rename the first label joke to “You’ve got a good joke? Tell me: ” or something like that (We will need this for testing purposes). Also, delete the “UserInCharge” label and Text field. Click Finish.

assign-a-dynamic-user-in-charge-2018-07-25-6

Configure the second Task Element

Right-click the Task and click Select business entity fields. Select both your variables and mark them as input (Green Arrow). Hit OK

assign-a-dynamic-user-in-charge-2018-07-25-7

Right-click it again and click Select user in charge. Switch to Dynamic, select User name and UserInCharge. Tick the second checkbox hit OK

assign-a-dynamic-user-in-charge-2018-07-25-8

Right-click the second Task element again and click Form builder. Change the label "UserInCharge" to "This user accepted the task:"  Change the label “joke” to “Read this out loud and see how many of your colleagues laugh:”. Click Finish.

assign-a-dynamic-user-in-charge-2018-07-25-9

Test the Configuration

At the right top corner, you can see who is currently logged in.

assign-a-dynamic-user-in-charge-2018-07-25-10

Save your model and switch to Publish in the menu tab. Now deploy (Deploy process) your process, then start it (F8).

Under Designer, you can find Tasks. Here you will find a new task. Double-click it. This task was sent to the role “Dev-Department” (Chris Meyer and Allen Brewer)

assign-a-dynamic-user-in-charge-2018-07-25-12

We can now see that currently there is no user in charge.

At the bottom right corner, you can now decide between accepting the task or denying it. Whoever completes the task will be in charge for it. 

assign-a-dynamic-user-in-charge-2018-07-25-15

Let’s accept it with your user (Chris Meyer in this case) and see if the second task is assigned to the correct user. 

assign-a-dynamic-user-in-charge-2018-07-25-16

Let’s complete this task, write down your joke and hit Finish. Check Tasks with both users, there should be no task assigned to Allen Brewer but one to Chris Meyer. 

assign-a-dynamic-user-in-charge-2018-07-25-17

As we can see the second Task was assigned to the user Chris Meyer. There are no tasks for Allen Brewer. So everything worked fine and you are now comfortable with dynamic users.