use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class CaseInstanceResourceImpl method getCaseInstance.
public CaseInstanceDto getCaseInstance() {
CaseService caseService = engine.getCaseService();
CaseInstance instance = caseService.createCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();
if (instance == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Case instance with id " + caseInstanceId + " does not exist.");
}
CaseInstanceDto result = CaseInstanceDto.fromCaseInstance(instance);
return result;
}
use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class CaseInstanceResourceImpl method terminate.
public void terminate(CaseExecutionTriggerDto triggerDto) {
try {
CaseService caseService = engine.getCaseService();
CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseInstanceId);
initializeCommand(commandBuilder, triggerDto, "terminate");
commandBuilder.terminate();
} catch (NotFoundException e) {
throw createInvalidRequestException("terminate", Status.NOT_FOUND, e);
} catch (NotValidException e) {
throw createInvalidRequestException("terminate", Status.BAD_REQUEST, e);
} catch (NotAllowedException e) {
throw createInvalidRequestException("terminate", Status.FORBIDDEN, e);
} catch (ProcessEngineException e) {
throw createRestException("terminate", Status.INTERNAL_SERVER_ERROR, e);
}
}
use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class CaseInstanceResourceImpl method complete.
public void complete(CaseExecutionTriggerDto triggerDto) {
try {
CaseService caseService = engine.getCaseService();
CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseInstanceId);
initializeCommand(commandBuilder, triggerDto, "complete");
commandBuilder.complete();
} catch (NotFoundException e) {
throw createInvalidRequestException("complete", Status.NOT_FOUND, e);
} catch (NotValidException e) {
throw createInvalidRequestException("complete", Status.BAD_REQUEST, e);
} catch (NotAllowedException e) {
throw createInvalidRequestException("complete", Status.FORBIDDEN, e);
} catch (ProcessEngineException e) {
throw createRestException("complete", Status.INTERNAL_SERVER_ERROR, e);
}
}
use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class LocalCaseExecutionVariablesResource method updateVariableEntities.
protected void updateVariableEntities(VariableMap variables, List<String> deletions) {
CaseService caseService = engine.getCaseService();
caseService.withCaseExecution(resourceId).setVariablesLocal(variables).removeVariablesLocal(deletions).execute();
}
use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class LocalCaseExecutionVariablesResource method setVariableEntity.
protected void setVariableEntity(String variableKey, TypedValue variableValue) {
CaseService caseService = engine.getCaseService();
caseService.withCaseExecution(resourceId).setVariableLocal(variableKey, variableValue).execute();
}
Aggregations