use of org.jbpm.services.api.model.ProcessInstanceDesc in project jbpm by kiegroup.
the class CaseServiceImpl method getCaseRoleAssignments.
@Override
public Collection<CaseRoleInstance> getCaseRoleAssignments(String caseId) throws CaseNotFoundException {
authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.MODIFY_ROLE_ASSIGNMENT);
ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
CaseFileInstance caseFile = internalGetCaseFileInstance(caseId, pi.getDeploymentId());
return ((CaseFileInstanceImpl) caseFile).getAssignments();
}
use of org.jbpm.services.api.model.ProcessInstanceDesc in project jbpm by kiegroup.
the class CaseServiceImpl method removeDataFromCaseFile.
@Override
public void removeDataFromCaseFile(String caseId, String name) throws CaseNotFoundException {
authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.REMOVE_DATA);
ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new RemoveDataCaseFileInstanceCommand(identityProvider, Arrays.asList(name), authorizationManager));
}
use of org.jbpm.services.api.model.ProcessInstanceDesc in project jbpm by kiegroup.
the class CaseServiceImpl method assignToCaseRole.
/*
* Case role assignment methods
*/
@Override
public void assignToCaseRole(String caseId, String role, OrganizationalEntity entity) throws CaseNotFoundException {
authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.MODIFY_ROLE_ASSIGNMENT);
ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new ModifyRoleAssignmentCommand(identityProvider, role, entity, true));
}
use of org.jbpm.services.api.model.ProcessInstanceDesc in project jbpm by kiegroup.
the class CaseServiceImpl method reopenCase.
@Override
public void reopenCase(String caseId, String deploymentId, String caseDefinitionId, Map<String, Object> data) throws CaseNotFoundException {
authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.REOPEN_CASE);
ProcessInstanceDesc pi = runtimeDataService.getProcessInstanceByCorrelationKey(correlationKeyFactory.newCorrelationKey(caseId));
if (pi != null) {
throw new CaseActiveException("Case with id " + caseId + " is still active and cannot be reopened");
}
Map<String, Object> params = new HashMap<String, Object>();
params.put("caseId", caseId);
params.put("maxResults", 1);
List<Long> caseIdMapping = commandService.execute(new QueryNameCommand<List<Long>>("findCaseIdContextMapping", params));
if (caseIdMapping.isEmpty()) {
throw new CaseNotFoundException("Case with id " + caseId + " was not found");
}
logger.debug("About to reopen case {} by starting process instance {} from deployment {} with additional data {}", caseId, caseDefinitionId, deploymentId, data);
processService.execute(deploymentId, CaseContext.get(caseId), new ReopenCaseCommand(identityProvider, caseId, deploymentId, caseDefinitionId, data, processService));
}
use of org.jbpm.services.api.model.ProcessInstanceDesc in project jbpm by kiegroup.
the class CaseServiceImpl method addDataToCaseFile.
@Override
public void addDataToCaseFile(String caseId, Map<String, Object> data, String... restrictedTo) throws CaseNotFoundException {
authorizationManager.checkOperationAuthorization(caseId, ProtectedOperation.ADD_DATA);
ProcessInstanceDesc pi = verifyCaseIdExists(caseId);
List<String> accessRestriction = null;
if (restrictedTo != null) {
accessRestriction = Arrays.asList(restrictedTo);
}
processService.execute(pi.getDeploymentId(), ProcessInstanceIdContext.get(pi.getId()), new AddDataCaseFileInstanceCommand(identityProvider, data, accessRestriction, authorizationManager));
}
Aggregations