This content has been marked as final.
Show 2 replies
-
1. Re: How to register user and group dynamically in jBPM 6.2?
awizenm Apr 13, 2015 5:17 PM (in response to awizenm)I assume a new user should find his way to the OrganizationalEntity table. But how?
Is there a way to create and persist the UserImpl directly - as User is now an interface?
Does jBPM 6 support dynamic user creation and handling at all?
-
2. Re: How to register user and group dynamically in jBPM 6.2?
awizenm Apr 15, 2015 11:29 AM (in response to awizenm)ok, playing around directly with UserImpl is not a good idea.
Registering a user (adding a user) to the task seems also to be an obsolete concept in jBPM 6.2.
The solution to my problem is indeed adding the bpmn2:potentialOwner element to bpmn2 like in the Evaluation.bpmn example. Then passing arbitrary user as a parameter on process start in Java code.
However, to be able to give the task to any user I had to use my own simple UserGroupCallback in the test class:
Here is the constructor:
public MyJbpmJUnitBaseTestCase(boolean arg0, boolean arg1) { super(arg0, arg1); userGroupCallback = new UserGroupCallback() { @Override public List<String> getGroupsForUser(String userId, List<String> groupIds, List<String> allExistingGroupIds) { List<String> groups = new ArrayList<String>(); groups.add("myGroup"); return groups; } @Override public boolean existsUser(String userId) { return true; } @Override public boolean existsGroup(String groupId) { return true; } }; }