use of org.jbpm.casemgmt.impl.command.AddDynamicProcessToStageCommand in project jbpm by kiegroup.
the class CaseServiceImpl method addDynamicSubprocessToStage.
@Override
public Long addDynamicSubprocessToStage(String caseId, String stageId, String processId, Map<String, Object> parameters) throws CaseNotFoundException {
authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.ADD_PROCESS_TO_CASE);
ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
return processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new AddDynamicProcessToStageCommand(identityProvider, caseId, pi.getId(), stageId, processId, parameters));
}
use of org.jbpm.casemgmt.impl.command.AddDynamicProcessToStageCommand in project jbpm by kiegroup.
the class CaseServiceImpl method addDynamicSubprocessToStage.
@Override
public Long addDynamicSubprocessToStage(Long processInstanceId, String stageId, String processId, Map<String, Object> parameters) throws CaseNotFoundException {
ProcessInstanceDesc pi = runtimeDataService.getProcessInstanceById(processInstanceId);
if (pi == null || !pi.getState().equals(ProcessInstance.STATE_ACTIVE)) {
throw new ProcessInstanceNotFoundException("No process instance found with id " + processInstanceId + " or it's not active anymore");
}
String caseId = pi.getCorrelationKey();
authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.ADD_PROCESS_TO_CASE);
return processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(processInstanceId), new AddDynamicProcessToStageCommand(identityProvider, caseId, pi.getId(), stageId, processId, parameters));
}
Aggregations