Reputation: 2710
I developed a spring and hibernate application that integrate with jbpm 6. I successfully started sample process designed in eclipse bpmn 2 plugin
I set actors id like below who are defined users in my web application. I know there have to be a link between jbpm and my user table. But I couldn't find any explanation.
So my question is there a way to use my own predefined user-groups-positions etc. as activity responsible?
Sample Process
I tried to add some existing wep application user ids to actor list of User Task but this doesn't work of course
Edit: I'm working on jbpm-human-task-jpa source code to change organizational structure and I hope I will achive to accommodate the code with my own organization
Upvotes: 1
Views: 990
Reputation: 832
I think you want to implement a custom UserGroupCallback. You will need to create a class that implements that interface and register it with the runtime. If you are using CDI, you can add the @ApplicationScoped annotation to the class and it should register. If are manually building the runtime you can register it like in the following code
RuntimeEnvironment environment = RuntimeEnvironmentBuilder.Factory.get()
.newDefaultBuilder()
.entityManagerFactory(emf)
.userGroupCallback(usergroupCallback)
Below is an example implementation of the getGroupsForUser method.
public List<String> getGroupsForUser(String userId, List<String> groupIds, List<String> allExistingGroupIds) {
List<String> groups = new ArrayList<String>();
if ("ismail".equals(userId)) {
groups.add("admin");
groups.add("project_manager");
}
return groups;
}
You can set a task assignment by Group by going in the User Task / Attributes / Group Id. You can use either admin or project_manager in that field. When you try to claim that task as the user ismail, it should be available. Instead of hard coding like it did, you can make a JDBC or JPA call to another database to perform the lookup.
Upvotes: 1