use of org.camunda.bpm.qa.upgrade.DescribesScenario 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());
}
}
};
}
use of org.camunda.bpm.qa.upgrade.DescribesScenario in project camunda-bpm-platform by camunda.
the class ProcessWithCallActivityScenario method startProcessAndCompleteFirstTask.
@DescribesScenario("init.complete.one")
@Times(1)
public static ScenarioSetup startProcessAndCompleteFirstTask() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
ProcessInstance procInst = engine.getRuntimeService().startProcessInstanceByKey(PROCESS_DEF_KEY, scenarioName);
Task task = engine.getTaskService().createTaskQuery().processInstanceId(procInst.getId()).singleResult();
engine.getTaskService().complete(task.getId());
}
};
}
use of org.camunda.bpm.qa.upgrade.DescribesScenario in project camunda-bpm-platform by camunda.
the class ProcessWithEventSubProcessScenario method startProcessWithThrowedBpmnError.
@DescribesScenario("init.error")
@Times(1)
public static ScenarioSetup startProcessWithThrowedBpmnError() {
return new ScenarioSetup() {
@Override
public void execute(ProcessEngine engine, String scenarioName) {
ProcessInstance procInstance = engine.getRuntimeService().startProcessInstanceByKey(PROCESS_DEF_KEY, scenarioName);
Job job = engine.getManagementService().createJobQuery().processInstanceId(procInstance.getId()).singleResult();
engine.getManagementService().executeJob(job.getId());
}
};
}
use of org.camunda.bpm.qa.upgrade.DescribesScenario in project camunda-bpm-platform by camunda.
the class ProcessWithParallelGatewayAndServiceTaskScenario method startProcessAsyncServiceTaskCompleteUserTask.
@DescribesScenario("init.async.complete")
@Times(1)
public static ScenarioSetup startProcessAsyncServiceTaskCompleteUserTask() {
return new ScenarioSetup() {
@Override
public void execute(ProcessEngine engine, String scenarioName) {
ProcessInstance procInst = engine.getRuntimeService().startProcessInstanceByKey(PROCESS_DEF_KEY_2, scenarioName);
Task task = engine.getTaskService().createTaskQuery().processInstanceId(procInst.getId()).singleResult();
engine.getTaskService().complete(task.getId());
}
};
}
use of org.camunda.bpm.qa.upgrade.DescribesScenario in project camunda-bpm-platform by camunda.
the class CreateProcessInstanceWithJsonVariablesScenario method initProcessInstance.
@DescribesScenario("initProcessInstanceWithDifferentVariables")
public static ScenarioSetup initProcessInstance() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
// given
ProcessInstance processInstance = engine.getRuntimeService().startProcessInstanceByKey("Process", "processWithJsonVariables");
// when
Execution execution = engine.getRuntimeService().createExecutionQuery().processInstanceId(processInstance.getId()).singleResult();
engine.getRuntimeService().setVariable(execution.getId(), "objectVariable", createObjectVariable());
engine.getRuntimeService().setVariable(execution.getId(), "plainTypeArrayVariable", createPlainTypeArray());
engine.getRuntimeService().setVariable(execution.getId(), "notGenericObjectListVariable", createNotGenericObjectList());
engine.getRuntimeService().setVariable(execution.getId(), "serializedMapVariable", createSerializedMap());
}
};
}
Aggregations