use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class SingleActivityConcurrentCompensationScenario method instantiateAndTriggerCompensation.
@DescribesScenario("init.triggerCompensation")
@ExtendsScenario("init")
@Times(3)
public static ScenarioSetup instantiateAndTriggerCompensation() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
// throw compensation; the compensation handler for userTask should then be active
Task beforeCompensateTask = engine.getTaskService().createTaskQuery().taskDefinitionKey("beforeCompensate").processInstanceBusinessKey(scenarioName).singleResult();
engine.getTaskService().complete(beforeCompensateTask.getId());
}
};
}
use of org.camunda.bpm.engine.ProcessEngine 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.ProcessEngine 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.ProcessEngine 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.ProcessEngine 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);
}
};
}
Aggregations