use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class SentryScenario method newSentryInstance.
@DescribesScenario("newSentryInstance")
public static ScenarioSetup newSentryInstance() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
CaseService caseService = engine.getCaseService();
CaseInstance caseInstance = caseService.createCaseInstanceByKey("case", scenarioName);
String caseInstanceId = caseInstance.getId();
CaseExecutionQuery query = caseService.createCaseExecutionQuery().caseInstanceId(caseInstanceId);
String firstHumanTaskId = query.activityId("PI_HumanTask_1").singleResult().getId();
caseService.manuallyStartCaseExecution(firstHumanTaskId);
caseService.completeCaseExecution(firstHumanTaskId);
String secondHumanTaskId = query.activityId("PI_HumanTask_2").singleResult().getId();
caseService.manuallyStartCaseExecution(secondHumanTaskId);
caseService.completeCaseExecution(secondHumanTaskId);
}
};
}
use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class SentryScenario method triggerEntryCriterion.
@DescribesScenario("triggerTaskEntryCriterion")
public static ScenarioSetup triggerEntryCriterion() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
CaseService caseService = engine.getCaseService();
caseService.createCaseInstanceByKey("case", scenarioName);
}
};
}
use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class SentryScenario method completeStage.
@DescribesScenario("triggerStageEntryCriterion")
public static ScenarioSetup completeStage() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
CaseService caseService = engine.getCaseService();
CaseInstance caseInstance = caseService.createCaseInstanceByKey("case", scenarioName);
String caseInstanceId = caseInstance.getId();
CaseExecutionQuery query = caseService.createCaseExecutionQuery().caseInstanceId(caseInstanceId);
String firstHumanTaskId = query.activityId("PI_HumanTask_1").singleResult().getId();
caseService.manuallyStartCaseExecution(firstHumanTaskId);
caseService.completeCaseExecution(firstHumanTaskId);
String secondHumanTaskId = query.activityId("PI_HumanTask_2").singleResult().getId();
caseService.manuallyStartCaseExecution(secondHumanTaskId);
}
};
}
use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class SentryScenario method completeInstance.
@DescribesScenario("completeInstance")
public static ScenarioSetup completeInstance() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
CaseService caseService = engine.getCaseService();
caseService.createCaseInstanceByKey("case", scenarioName);
}
};
}
use of org.camunda.bpm.engine.CaseService in project camunda-bpm-platform by camunda.
the class MockedProcessEngineProvider method mockServices.
private void mockServices(ProcessEngine engine) {
RepositoryService repoService = mock(RepositoryService.class);
IdentityService identityService = mock(IdentityService.class);
TaskService taskService = mock(TaskService.class);
RuntimeService runtimeService = mock(RuntimeService.class);
FormService formService = mock(FormService.class);
HistoryService historyService = mock(HistoryService.class);
ManagementService managementService = mock(ManagementService.class);
CaseService caseService = mock(CaseService.class);
FilterService filterService = mock(FilterService.class);
ExternalTaskService externalTaskService = mock(ExternalTaskService.class);
when(engine.getRepositoryService()).thenReturn(repoService);
when(engine.getIdentityService()).thenReturn(identityService);
when(engine.getTaskService()).thenReturn(taskService);
when(engine.getRuntimeService()).thenReturn(runtimeService);
when(engine.getFormService()).thenReturn(formService);
when(engine.getHistoryService()).thenReturn(historyService);
when(engine.getManagementService()).thenReturn(managementService);
when(engine.getCaseService()).thenReturn(caseService);
when(engine.getFilterService()).thenReturn(filterService);
when(engine.getExternalTaskService()).thenReturn(externalTaskService);
}
Aggregations