use of org.camunda.bpm.qa.upgrade.Times in project camunda-bpm-platform by camunda.
the class ParallelMultiInstanceCompensationScenario method defaultHandlerBeforeCompensate.
@DescribesScenario("defaultHandler.beforeCompensate")
@Times(3)
public static ScenarioSetup defaultHandlerBeforeCompensate() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
engine.getRuntimeService().startProcessInstanceByKey("ParallelMultiInstanceCompensationDefaultHandlerScenario", scenarioName);
// complete all mi tasks
List<Task> miTasks = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).list();
for (Task miTask : miTasks) {
engine.getTaskService().complete(miTask.getId());
}
}
};
}
use of org.camunda.bpm.qa.upgrade.Times in project camunda-bpm-platform by camunda.
the class SingleActivityCompensationScenario method instantiate.
@DescribesScenario("init")
@Times(3)
public static ScenarioSetup instantiate() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
engine.getRuntimeService().startProcessInstanceByKey("SingleActivityCompensationScenario", 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.Times in project camunda-bpm-platform by camunda.
the class SingleActivityCompensationScenario 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().processInstanceBusinessKey(scenarioName).singleResult();
engine.getTaskService().complete(beforeCompensateTask.getId());
}
};
}
use of org.camunda.bpm.qa.upgrade.Times in project camunda-bpm-platform by camunda.
the class ProcessWithParallelGatewayScenario method startProcessCompleteTwoUserTask.
@DescribesScenario("init.complete.two")
@Times(1)
public static ScenarioSetup startProcessCompleteTwoUserTask() {
return new ScenarioSetup() {
@Override
public void execute(ProcessEngine engine, String scenarioName) {
ProcessInstance procInst = engine.getRuntimeService().startProcessInstanceByKey(PROCESS_DEF_KEY, scenarioName);
List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(procInst.getId()).list();
for (Task task : tasks) {
engine.getTaskService().complete(task.getId());
}
}
};
}
use of org.camunda.bpm.qa.upgrade.Times in project camunda-bpm-platform by camunda.
the class ProcessWithParallelGatewayScenario method startProcessCompleteOneUserTask.
@DescribesScenario("init.complete.one")
@Times(1)
public static ScenarioSetup startProcessCompleteOneUserTask() {
return new ScenarioSetup() {
@Override
public void execute(ProcessEngine engine, String scenarioName) {
ProcessInstance procInst = engine.getRuntimeService().startProcessInstanceByKey(PROCESS_DEF_KEY, scenarioName);
List<Task> tasks = engine.getTaskService().createTaskQuery().processInstanceId(procInst.getId()).list();
if (tasks.size() > 0) {
engine.getTaskService().complete(tasks.get(0).getId());
}
}
};
}
Aggregations