protected void complete(final String caseExecutionId) { caseService .withCaseExecution(caseExecutionId) .complete(); }
protected void complete(final String caseExecutionId) { caseService .withCaseExecution(caseExecutionId) .complete(); }
public void completeCaseExecution(String caseExecutionId) { withCaseExecution(caseExecutionId).complete(); }
public void completeCaseExecution(String caseExecutionId) { withCaseExecution(caseExecutionId).complete(); }
public void completeCaseExecution(String caseExecutionId, Map<String, Object> variables) { withCaseExecution(caseExecutionId).setVariables(variables).complete(); }
public void completeCaseExecution(String caseExecutionId, Map<String, Object> variables) { withCaseExecution(caseExecutionId).setVariables(variables).complete(); }
public void testCompleteInvalidCaseExeuction() { try { caseService .withCaseExecution("invalid") .complete(); fail("The case execution should not be found."); } catch (NotFoundException e) { } try { caseService .withCaseExecution(null) .complete(); fail("The case execution should not be found."); } catch (NotValidException e) { } }
public void complete(CaseExecutionTriggerDto triggerDto) { try { CaseService caseService = engine.getCaseService(); CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseExecutionId); 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); } }
public void complete(CaseExecutionTriggerDto triggerDto) { try { CaseService caseService = engine.getCaseService(); CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseExecutionId); 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); } }
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); } }
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); } }
@Test public void testComplete() { given() .pathParam("id", MockProvider.EXAMPLE_CASE_EXECUTION_ID) .contentType(ContentType.JSON) .body(EMPTY_JSON_OBJECT) .then() .expect() .statusCode(Status.NO_CONTENT.getStatusCode()) .when() .post(CASE_EXECUTION_COMPLETE_URL); verify(caseServiceMock).withCaseExecution(MockProvider.EXAMPLE_CASE_EXECUTION_ID); verify(caseExecutionCommandBuilderMock).complete(); }
@Test public void testComplete() { given() .pathParam("id", MockProvider.EXAMPLE_CASE_INSTANCE_ID) .contentType(ContentType.JSON) .body(EMPTY_JSON_OBJECT) .then() .expect() .statusCode(Status.NO_CONTENT.getStatusCode()) .when() .post(CASE_INSTANCE_COMPLETE_URL); verify(caseServiceMock).withCaseExecution(MockProvider.EXAMPLE_CASE_INSTANCE_ID); verify(caseExecutionCommandBuilderMock).complete(); }
@Deployment(resources={"org/camunda/bpm/engine/test/api/cmmn/oneCaseTaskCaseWithManualActivation.cmmn"}) public void testCompleteAnEnabledCaseTask() { // given createCaseInstance(DEFINITION_KEY); String caseTaskId = queryCaseExecutionByActivityId(CASE_TASK_KEY).getId(); try { // when caseService .withCaseExecution(caseTaskId) .complete(); fail("Should not be able to complete an enabled case task."); } catch (NotAllowedException e) {} }
@Deployment(resources={"org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCaseWithManualActivation.cmmn"}) public void testCompleteAnEnabledProcessTask() { // given createCaseInstance(DEFINITION_KEY); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK_KEY).getId(); try { // when caseService .withCaseExecution(processTaskId) .complete(); fail("Should not be able to complete an enabled process task."); } catch (NotAllowedException e) {} }
@Deployment(resources={ "org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCase.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" }) public void testComplete() { // given createCaseInstance(DEFINITION_KEY); String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK_KEY).getId(); try { // when caseService .withCaseExecution(processTaskId) .complete(); fail("It should not be possible to complete a process task, while the process instance is still running."); } catch (NotAllowedException e) {} }
@Deployment(resources={ "org/camunda/bpm/engine/test/api/cmmn/oneCaseTaskCase.cmmn", "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" }) public void testComplete() { // given createCaseInstance(DEFINITION_KEY); String caseTaskId = queryCaseExecutionByActivityId(CASE_TASK_KEY).getId(); try { // when caseService .withCaseExecution(caseTaskId) .complete(); fail("It should not be possible to complete a case task, while the process instance is still running."); } catch (NotAllowedException e) {} }
@Deployment(resources={ "org/camunda/bpm/engine/test/api/cmmn/oneMilestoneCase.cmmn" }) public void testComplete() { // given createCaseInstance(DEFINITION_KEY).getId(); String caseTaskId = queryCaseExecutionByActivityId(MILESTONE_KEY).getId(); try { // when caseService .withCaseExecution(caseTaskId) .complete(); fail(); } catch (NotAllowedException e) { } }
@Deployment(resources = {"org/camunda/bpm/engine/test/cmmn/listener/CaseInstanceListenerTest.testCloseListenerByScript.cmmn"}) public void testCloseListenerByScript() { // given String caseInstanceId = caseService .withCaseDefinitionByKey("case") .create() .getId(); caseService .withCaseExecution(caseInstanceId) .complete(); // when caseService .withCaseExecution(caseInstanceId) .close(); // then // TODO: if history is provided, the historic variables have to be checked! }
@Deployment(resources={"org/camunda/bpm/engine/test/api/cmmn/oneCaseTaskAndOneHumanTaskCaseWithManualActivation.cmmn"}) public void testCompleteADisabledCaseTask() { // given createCaseInstance(DEFINITION_KEY); String caseTaskId = queryCaseExecutionByActivityId(CASE_TASK_KEY).getId(); caseService .withCaseExecution(caseTaskId) .disable(); try { // when caseService .withCaseExecution(caseTaskId) .complete(); fail("Should not be able to complete a disabled case task."); } catch (NotAllowedException e) {} }