use of org.jbpm.casemgmt.impl.model.CaseRoleImpl in project jbpm by kiegroup.
the class CaseRuntimeDataServiceImpl method collectCaseRoles.
private Collection<CaseRole> collectCaseRoles(Process process) {
String roles = (String) process.getMetaData().get("customCaseRoles");
if (roles == null) {
return Collections.emptyList();
}
List<CaseRole> result = new ArrayList<CaseRole>();
String[] roleStrings = roles.split(",");
for (String roleString : roleStrings) {
String[] elements = roleString.split(":");
CaseRoleImpl role = new CaseRoleImpl(elements[0]);
result.add(role);
if (elements.length > 1) {
role.setCardinality(Integer.parseInt(elements[1]));
}
}
return result;
}
use of org.jbpm.casemgmt.impl.model.CaseRoleImpl in project jbpm by kiegroup.
the class CommentNotificationEventListenerTest method buildCaseFile.
protected CaseFileInstance buildCaseFile(List<String> mentionedRoles) {
CaseFileInstanceImpl caseFile = new CaseFileInstanceImpl("CASE-00001", "dummy", new HashMap<>());
List<CaseRole> roles = mentionedRoles.stream().map(roleName -> new CaseRoleImpl(roleName)).collect(Collectors.toList());
caseFile.setupRoles(roles);
caseFile.assignUser("owner", "john");
caseFile.assignUser("manager", "mary");
return caseFile;
}
Aggregations