Jeff Power
Jeff Power

Reputation: 33

JBPM - jbpm-server-7.35 reassignments not working

On a user task, we configured reassignments with following info

Users:  Katy
Groups: HR
Expires At: 1m

at run time, I get a message:

Please check that there is no group and user with same id

I tried removing HR and tried again, but no luck.

Please see the stacktrace below

WorkflowRuntimeException: [changevalue.test:18 - Task:2] -- Organizational entity already exists with [UserImpl:'HR'] id, please check that there is no group and user with same id

at org.jbpm.workflow.instance.node.WorkItemNodeInstance.processWorkItemHandler(WorkItemNodeInstance.java:175)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:146)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:203) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:408) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:389) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:358) at org.jbpm.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerCompleted(ExtendedNodeInstanceImpl.java:44) at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:412) at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:372) at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:307) at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:451) at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:421) at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:620) at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:167) at org.jbpm.process.workitem.rest.RESTWorkItemHandler.executeWorkItem(RESTWorkItemHandler.java:841) ... 145 more Caused by: java.lang.RuntimeException: Organizational entity already exists with [UserImpl:'HR'] id, please check that there is no group and user with same id at org.jbpm.services.task.persistence.JPATaskPersistenceContext.persistOrgEntity(JPATaskPersistenceContext.java:255) at org.jbpm.services.task.commands.UserGroupCallbackTaskCommand.persistIfNotExists(UserGroupCallbackTaskCommand.java:153) at org.jbpm.services.task.commands.UserGroupCallbackTaskCommand.addUserFromCallbackOperation(UserGroupCallbackTaskCommand.java:141) at org.jbpm.services.task.commands.UserGroupCallbackTaskCommand.doCallbackUserOperation(UserGroupCallbackTaskCommand.java:104) at org.jbpm.services.task.commands.UserGroupCallbackTaskCommand.doCallbackUserOperation(UserGroupCallbackTaskCommand.java:97) at org.jbpm.services.task.commands.UserGroupCallbackTaskCommand.doCallbackOperationForTaskDeadlines(UserGroupCallbackTaskCommand.java:419) at org.jbpm.services.task.commands.AddTaskCommand.execute(AddTaskCommand.java:114) at org.jbpm.services.task.commands.AddTaskCommand.execute(AddTaskCommand.java:56)

Upvotes: 0

Views: 510

Answers (2)

abhigupta13004
abhigupta13004

Reputation: 41

There is a bug with jbpm reassignment feature. It tries to add the given users as groups and groups as users. Since 'HR' is an existing group, your scenario will give an error because of this reassignment bug (which is trying to add 'HR' as a user).

The issue is regarding bpmn file generation. In the process of file generation the user names are getting swapped with the group names.

<bpmn2:dataInputAssociation id="_pXn2EsUVEeq_vYStelyULQ">
    <bpmn2:targetRef>_77A0B1FE-F97B-4892-B916-1105512538F7_NotStartedReassignInputX</bpmn2:targetRef>
    <bpmn2:assignment id="_pXn2E8UVEeq_vYStelyULQ">
      <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="_pXn2FMUVEeq_vYStelyULQ"><![CDATA[[users:HRGroup|groups:kris]@[2m]]]></bpmn2:from>
      <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="_pXn2FcUVEeq_vYStelyULQ">_77A0B1FE-F97B-4892-B916-1105512538F7_NotStartedReassignInputX</bpmn2:to>
    </bpmn2:assignment>
</bpmn2:dataInputAssociation>

Kris should have been a user here and HR was supposed to be a group. To rectify it we can edit the bpmn file and reimport it in the project.

Upvotes: 2

Sudhish Nair
Sudhish Nair

Reputation: 444

From the stack trace, it looks like you have a user name and group with the same name "HR" causing the conflict.

I tried removing HR and tried again, but no luck.

From where did you remove "HR", did you remove the user with name "HR" from application-user.properties? If not try removing the user from the file.

If you still face the issue just cross-check if the entry is still there in the "OrganizationalEntity" table.

Upvotes: 0

Related Questions