use of org.jbpm.shared.services.impl.commands.QueryStringCommand in project jbpm by kiegroup.
the class CaseInstanceAuditEventListener method afterCaseRoleAssignmentAdded.
@Override
public void afterCaseRoleAssignmentAdded(CaseRoleAssignmentEvent event) {
Map<String, Object> parameters = new HashMap<>();
parameters.put("caseId", event.getCaseId());
QueryStringCommand<List<Long>> queryCommand = new QueryStringCommand<List<Long>>(FIND_CASE_PROCESS_INST_ID_QUERY, parameters);
List<Long> processInstanceId = commandService.execute(queryCommand);
if (processInstanceId.isEmpty()) {
return;
}
CaseRoleAssignmentLog assignmentLog = new CaseRoleAssignmentLog(processInstanceId.get(0), event.getCaseId(), event.getRole(), event.getEntity());
commandService.execute(new PersistObjectCommand(assignmentLog));
}
Aggregations