protected void manualStart(final String caseExecutionId) { caseService .withCaseExecution(caseExecutionId) .manualStart(); }
protected void manualStart(final String caseExecutionId) { caseService .withCaseExecution(caseExecutionId) .manualStart(); }
public void manuallyStartCaseExecution(String caseExecutionId) { withCaseExecution(caseExecutionId).manualStart(); }
public void manuallyStartCaseExecution(String caseExecutionId) { withCaseExecution(caseExecutionId).manualStart(); }
public void manuallyStartCaseExecution(String caseExecutionId, Map<String, Object> variables) { withCaseExecution(caseExecutionId).setVariables(variables).manualStart(); }
public void manuallyStartCaseExecution(String caseExecutionId, Map<String, Object> variables) { withCaseExecution(caseExecutionId).setVariables(variables).manualStart(); }
public void testManualStartInvalidCaseExecution() { try { caseService .withCaseExecution("invalid") .manualStart(); fail(); } catch (NotFoundException e) { } try { caseService .withCaseExecution(null) .manualStart(); fail(); } catch (NotValidException e) { } }
public void manualStart(CaseExecutionTriggerDto triggerDto) { try { CaseService caseService = engine.getCaseService(); CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseExecutionId); initializeCommand(commandBuilder, triggerDto, "start manually"); commandBuilder.manualStart(); } catch (NotFoundException e) { throw createInvalidRequestException("manualStart", Status.NOT_FOUND, e); } catch (NotValidException e) { throw createInvalidRequestException("manualStart", Status.BAD_REQUEST, e); } catch (NotAllowedException e) { throw createInvalidRequestException("manualStart", Status.FORBIDDEN, e); } catch (ProcessEngineException e) { throw createRestException("manualStart", Status.INTERNAL_SERVER_ERROR, e); } }
@Test public void testManualStart() { 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_MANUAL_START_URL); verify(caseServiceMock).withCaseExecution(MockProvider.EXAMPLE_CASE_EXECUTION_ID); verify(caseExecutionCommandBuilderMock).manualStart(); }
/** * Starts the case execution for oneTaskCase.cmmn<p> * Only works for testcases, which deploy that process. * * @return the execution id for the activity PI_HumanTask_1 */ protected String startDefaultCaseExecutionManually() { String humanTaskExecutionId = caseService .createCaseExecutionQuery() .activityId("PI_HumanTask_1") .singleResult() .getId(); caseService .withCaseExecution(humanTaskExecutionId) .manualStart(); return humanTaskExecutionId; }
@Deployment(resources = CMMN_CALL_DECISION_CONSTANT_WITH_MANUAL_ACTIVATION) public void testDecisionNotFound() { // given createCaseInstanceByKey(CASE_KEY); String decisionTaskId = queryCaseExecutionByActivityId(DECISION_TASK).getId(); try { // when caseService .withCaseExecution(decisionTaskId) .manualStart(); fail("It should not be possible to evaluate a not existing decision."); } catch (DecisionDefinitionNotFoundException e) {} }
protected void startCaseTask() { CaseExecution caseExecution = engineRule.getCaseService().createCaseExecutionQuery().activityId("PI_CaseTask_1").singleResult(); engineRule.getCaseService().withCaseExecution(caseExecution.getId()).manualStart(); }
@Deployment(resources={ "org/camunda/bpm/engine/test/api/cmmn/oneMilestoneCase.cmmn" }) public void testManualStart() { // given createCaseInstance(DEFINITION_KEY).getId(); String caseTaskId = queryCaseExecutionByActivityId(MILESTONE_KEY).getId(); try { // when caseService .withCaseExecution(caseTaskId) .manualStart(); fail(); } catch (NotAllowedException e) { } }
protected CaseInstance createCaseInstance(String caseDefinitionKey) { CaseInstance caseInstance = caseService.withCaseDefinitionByKey(caseDefinitionKey).create(); CaseExecution caseExecution = caseService.createCaseExecutionQuery().activityId(DECISION_TASK_ID).singleResult(); caseService.withCaseExecution(caseExecution.getId()).setVariable("status", "gold").manualStart(); return caseInstance; }
protected void createCaseInstance(String caseDefinitionKey, String tenantId) { caseService.withCaseDefinitionByKey(caseDefinitionKey).caseDefinitionTenantId(tenantId).create(); CaseExecution caseExecution = caseService.createCaseExecutionQuery().activityId(PROCESS_TASK_ID).tenantIdIn(tenantId).singleResult(); caseService.withCaseExecution(caseExecution.getId()).manualStart(); }
protected void createCaseInstance(String caseDefinitionKey, String tenantId) { caseService.withCaseDefinitionByKey(caseDefinitionKey).caseDefinitionTenantId(tenantId).create(); CaseExecution caseExecution = caseService.createCaseExecutionQuery().activityId(CASE_TASK_ID).tenantIdIn(tenantId).singleResult(); caseService.withCaseExecution(caseExecution.getId()).manualStart(); }
public void testProcessRefTenantIdExpression() { deployment(CMMN_TENANT_EXPR); deploymentForTenant(TENANT_ONE, PROCESS); caseService.withCaseDefinitionByKey("testCase").create(); CaseExecution caseExecution = caseService.createCaseExecutionQuery().activityId(PROCESS_TASK_ID).singleResult(); caseService.withCaseExecution(caseExecution.getId()).manualStart(); ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKey("testProcess"); assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L)); }
protected CaseInstance createCaseInstance(String caseDefinitionKey, String tenantId) { CaseInstance caseInstance = caseService.withCaseDefinitionByKey(caseDefinitionKey).caseDefinitionTenantId(tenantId).create(); CaseExecution caseExecution = caseService.createCaseExecutionQuery().activityId(DECISION_TASK_ID).tenantIdIn(tenantId).singleResult(); caseService.withCaseExecution(caseExecution.getId()).setVariable("status", "gold").manualStart(); return caseInstance; }
@Deployment( resources = { CMMN_CALL_DECISION_EXPRESSION_WITH_MANUAL_ACTIVATION, DECISION_LITERAL_EXPRESSION_DMN} ) public void testCallDecisionWithLiteralExpression() { // given CaseInstance caseInstance = createCaseInstanceByKey(CASE_KEY, Variables.createVariables() .putValue("testDecision", "decisionLiteralExpression") .putValue("a", 2) .putValue("b", 3)); String decisionTaskId = queryCaseExecutionByActivityId(DECISION_TASK).getId(); // when caseService .withCaseExecution(decisionTaskId) .manualStart(); // then assertNull(queryCaseExecutionByActivityId(DECISION_TASK)); assertEquals(5, getDecisionResult(caseInstance)); }
@Deployment(resources = "org/camunda/bpm/engine/test/cmmn/cmm10/Cmmn10CompatibilityTest.testSentryIfPartCondition.cmmn") public void testSentryIfPartCondition() { // given createCaseInstanceByKey("case", Variables.createVariables().putValue("value", 99)); String humanTask1 = queryCaseExecutionByActivityId("PI_HumanTask_1").getId(); String humanTask2 = queryCaseExecutionByActivityId("PI_HumanTask_2").getId(); assertTrue(queryCaseExecutionById(humanTask2).isAvailable()); // when caseService .withCaseExecution(humanTask1) .setVariable("value", 999) .manualStart(); // then assertTrue(queryCaseExecutionById(humanTask2).isEnabled()); }