Claim button is missing

In certain conditions A cadidate user doesn’t have a claim button.
The users do however show in the candidate users.
Screenshot as example.
flowable

As you can see, rpa and slag are candidate. I’m logged in as rpa, but I cannot claim.

All tests are done on a fresh install of flowable version 6.1.2 with users in a local mariadb.

Working condition:
Users are added during candidate process design:

    <userTask id="sid-970115D1-48B8-4338-BA0B-6BC58D66F767" flowable:candidateUsers="slag,rpa" flowable:formKey="test">
  <extensionElements>
    <modeler:user-info-email-slag xmlns:modeler="http://flowable.org/modeler"><![CDATA[slag@flowable.com]]></modeler:user-info-email-slag>
    <modeler:user-info-firstname-slag xmlns:modeler="http://flowable.org/modeler"><![CDATA[sebastiaan]]></modeler:user-info-firstname-slag>
    <modeler:user-info-lastname-slag xmlns:modeler="http://flowable.org/modeler"><![CDATA[lag]]></modeler:user-info-lastname-slag>
    <modeler:user-info-email-rpa xmlns:modeler="http://flowable.org/modeler"><![CDATA[rpa@flowable.org]]></modeler:user-info-email-rpa>
    <modeler:user-info-firstname-rpa xmlns:modeler="http://flowable.org/modeler"><![CDATA[robin]]></modeler:user-info-firstname-rpa>
    <modeler:user-info-lastname-rpa xmlns:modeler="http://flowable.org/modeler"><![CDATA[pa]]></modeler:user-info-lastname-rpa>
    <modeler:activiti-idm-candidate-user xmlns:modeler="http://flowable.org/modeler"><![CDATA[true]]></modeler:activiti-idm-candidate-user>
    <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[true]]></modeler:initiator-can-complete>
  </extensionElements>
</userTask>

non working condition with a string variable in the process declaration:
in this case ${users} is populated during process start using an input box.
The string would be similar to this: slag,rpa

    <userTask id="sid-D1BDD1F6-C3B5-4951-A0E4-2313A9DAC505" flowable:candidateUsers="${users}"></userTask>

non working condition with java code:

	public void notify(DelegateTask arg0) {
	System.out.println(arg0.getCandidates());
	
	arg0.addCandidateUser("rpa");
	arg0.addCandidateUser("slag");
}

I’ve tried reproducing it, by adding a few candidate users in the modeler, but I can see the claim button for the three candidate users I added.

The xml has my users:

flowable:candidateUsers="fozzie,gonzo,admin"

Can you check in the database, more specifically whether the ACT_RU_IDENTITYLINK table contains the two candidate user entries?

If you define the candidate users in the xml there isn’t an issue.

I attached an app with 3 test cases.
CandidateUsersapp

  1. CandidateUsersPredefined. (working)
    Candidate users are predefined in the xml: flowable:candidateUsers=“slag,rpa”

database contents:

±-----±-----±----------±------------±---------±---------±--------------±-------------+
| ID_ | REV_ | GROUP_ID_ | TYPE_ | USER_ID_ | TASK_ID_ | PROC_INST_ID_ | PROC_DEF_ID_ |
±-----±-----±----------±------------±---------±---------±--------------±-------------+
| 5248 | 1 | NULL | starter | admin | NULL | 5246 | NULL |
| 5253 | 1 | NULL | candidate | slag | 5252 | NULL | NULL |
| 5254 | 1 | NULL | participant | slag | NULL | 5246 | NULL |
| 5255 | 1 | NULL | candidate | rpa | 5252 | NULL | NULL |
| 5256 | 1 | NULL | participant | rpa | NULL | 5246 | NULL |
±-----±-----±----------±------------±---------±---------±--------------±-------------+

  1. CandidateUsersWithVariable (not working)
    xml: flowable:candidateUsers=“${users}”
    Candidate users are requested during startup of the process and filled into a text field.
    users show up as candidate users but don’t have a claim button.

MariaDB [flowable]> SELECT * FROM ACT_RU_IDENTITYLINK ;
±-----±-----±----------±------------±---------±---------±--------------±-------------+
| ID_ | REV_ | GROUP_ID_ | TYPE_ | USER_ID_ | TASK_ID_ | PROC_INST_ID_ | PROC_DEF_ID_ |
±-----±-----±----------±------------±---------±---------±--------------±-------------+
| 5264 | 1 | NULL | starter | admin | NULL | 5262 | NULL |
| 5272 | 1 | NULL | candidate | rpa | 5271 | NULL | NULL |
| 5273 | 1 | NULL | participant | rpa | NULL | 5262 | NULL |
| 5274 | 1 | NULL | candidate | slag | 5271 | NULL | NULL |
| 5275 | 1 | NULL | participant | slag | NULL | 5262 | NULL |
±-----±-----±----------±------------±---------±---------±--------------±-------------+

  1. candidateusersWithJavaClass
    xml: flowable:candidateUsers=“”
    Candidate users are added with a DelegateTask using the java code: arg0.addCandidateUser(“rpa”);

MariaDB [flowable]> SELECT * FROM ACT_RU_IDENTITYLINK ;
±-----±-----±----------±------------±---------±---------±--------------±-------------+
| ID_ | REV_ | GROUP_ID_ | TYPE_ | USER_ID_ | TASK_ID_ | PROC_INST_ID_ | PROC_DEF_ID_ |
±-----±-----±----------±------------±---------±---------±--------------±-------------+
| 5281 | 1 | NULL | starter | admin | NULL | 5279 | NULL |
| 5286 | 1 | NULL | candidate | rpa | 5285 | NULL | NULL |
| 5287 | 1 | NULL | participant | rpa | NULL | 5279 | NULL |
| 5288 | 1 | NULL | candidate | slag | 5285 | NULL | NULL |
| 5289 | 1 | NULL | participant | slag | NULL | 5279 | NULL |
±-----±-----±----------±------------±---------±---------±--------------±-------------+

Many thanks for the excellent explanation and example zip.
You were right, both cases had a bug. The bug has been fixed here: https://github.com/flowable/flowable-engine/commit/36199dba40ed6426dc9455054902cd0abed3aa7d

Hi Joram, I compiled and installed 6.2.0-snapshot but I still encounter an issue using a java class.
The task I run is the following:

    <startEvent id="startEvent1"></startEvent>
<userTask id="UserTask1" flowable:assignee="rpa">
  <extensionElements>
    <flowable:taskListener event="create" class="eu.newtec.ibq.AssignUser"></flowable:taskListener>
    <modeler:activiti-idm-assignee xmlns:modeler="http://flowable.org/modeler"><![CDATA[true]]></modeler:activiti-idm-assignee>
    <modeler:assignee-info-email xmlns:modeler="http://flowable.org/modeler"><![CDATA[rpa@newtec.eu]]></modeler:assignee-info-email>
    <modeler:assignee-info-firstname xmlns:modeler="http://flowable.org/modeler"><![CDATA[Robin]]></modeler:assignee-info-firstname>
    <modeler:assignee-info-lastname xmlns:modeler="http://flowable.org/modeler"><![CDATA[Panis]]></modeler:assignee-info-lastname>
    <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
  </extensionElements>
</userTask>

The java class contains the following:

public class AssignUser implements TaskListener{

public void notify(DelegateTask delegateTask) {
	delegateTask.setAssignee("slag");
	delegateTask.addCandidateUser("edi");
	delegateTask.addCandidateGroup("lgoe");
	System.out.println(delegateTask.getAssignee());
	System.out.println(delegateTask.getCandidates());				
}

}

Console output:

rpa

So I’m sure the Java class runs, since i get console output, but assigning or adding candidates isn’t done.

There seems to be an issue indeed: the problem is that calling setAssignee() (and the others) doesn’t propagate the changes to the history. That’s something that needs fixing (but I doubt it’ll be possible for the next release).

As a current workaround, you need to go through the service. You can get the service via the CommandContextUtil: CommandContextUtil.getProcessEngineConfiguration().getTaskService().setAssignee();

Hi Joram,

Thx for looking into this.

I did some more testing using CommandContextUtil.
The delegate task I’m using is the following:

	public void notify(DelegateTask delegateTask) {
	CommandContextUtil.getProcessEngineConfiguration().getTaskService().setAssignee(delegateTask.getId(), "rpa");
	CommandContextUtil.getProcessEngineConfiguration().getTaskService().addCandidateUser(delegateTask.getId(), "edi");
	CommandContextUtil.getProcessEngineConfiguration().getTaskService().addCandidateUser(delegateTask.getId(), "lgoe");
	CommandContextUtil.getProcessEngineConfiguration().getTaskService().addCandidateUser(delegateTask.getId(), "slag");
	System.out.println("candidates: " + delegateTask.getCandidates());
}

Console output is:
candidates: [IdentityLinkEntity[id=52513, type=candidate, userId=edi, taskId=52507], IdentityLinkEntity[id=52519, type=candidate, userId=slag, taskId=52507], IdentityLinkEntity[id=52516, type=candidate, userId=lgoe, taskId=52507]]

Candidates are shown in the candidate list in flowable-task but the claim button is still missing.

The claim button is missing because there is an assignee being set. When an assignee is set, that assignee has claimed the task.

Hi,

I have just installed version 6.2.1 and I cannot claim a task. It is in status “Assigned to nobody” and there is no claim button. I am running in H2 configuration mode.

In the following it is the process def:

<?xml version="1.0" encoding="UTF-8"?> A vacation request model Provide vacation info

Can you help me?

Are you sure the user is part of the ‘management’ group? I’ve tried it here (with master version though) and the claim button is there.

My observation is that “admin” (default user) does not get claim button but other users get the claim button somehow.

User case:

  • A user assigns “admin” as a participant