use of org.camunda.bpm.qa.upgrade.DescribesScenario in project camunda-bpm-platform by camunda.
the class SingleActivityConcurrentCompensationScenario method instantiate.
@DescribesScenario("init")
@Times(3)
public static ScenarioSetup instantiate() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
engine.getRuntimeService().startProcessInstanceByKey("SingleActivityConcurrentCompensationScenario", scenarioName);
// create the compensation event subscription and wait before throwing compensation
Task userTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).singleResult();
engine.getTaskService().complete(userTask.getId());
}
};
}
use of org.camunda.bpm.qa.upgrade.DescribesScenario 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.qa.upgrade.DescribesScenario 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.qa.upgrade.DescribesScenario 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.qa.upgrade.DescribesScenario 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);
}
};
}
Aggregations