use of org.camunda.bpm.qa.upgrade.DescribesScenario in project camunda-bpm-platform by camunda.
the class InterruptingEventSubProcessCompensationScenario method instantiateThrowCompensate.
@DescribesScenario("init.throwCompensate")
@Times(4)
public static ScenarioSetup instantiateThrowCompensate() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
engine.getRuntimeService().startProcessInstanceByKey("InterruptingEventSubProcessCompensationScenario", scenarioName);
// trigger the event subprocess
engine.getRuntimeService().correlateMessage("EventSubProcessMessage");
// complete the task to compensate and then throw compensation
Task eventSubProcessTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).singleResult();
engine.getTaskService().complete(eventSubProcessTask.getId());
}
};
}
use of org.camunda.bpm.qa.upgrade.DescribesScenario in project camunda-bpm-platform by camunda.
the class NestedParallelNonInterruptingEventSubprocessScenario method completeSubprocessTask.
@DescribesScenario("init.innerTask")
@ExtendsScenario("init")
@Times(5)
public static ScenarioSetup completeSubprocessTask() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
Task task = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).taskDefinitionKey("innerTask").singleResult();
engine.getTaskService().complete(task.getId());
}
};
}
use of org.camunda.bpm.qa.upgrade.DescribesScenario in project camunda-bpm-platform by camunda.
the class AuthorizationScenario method startProcessInstance.
@DescribesScenario("startProcessInstance")
public static ScenarioSetup startProcessInstance() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
IdentityService identityService = engine.getIdentityService();
// create an user
String userId = "test";
User user = identityService.newUser(userId);
identityService.saveUser(user);
// create group
String groupId = "accounting";
Group group = identityService.newGroup(groupId);
identityService.saveGroup(group);
// create membership
identityService.createMembership("test", "accounting");
// start a process instance
engine.getRuntimeService().startProcessInstanceByKey("oneTaskProcess", scenarioName);
}
};
}
use of org.camunda.bpm.qa.upgrade.DescribesScenario in project camunda-bpm-platform by camunda.
the class InterruptingEventSubprocessCompensationScenario method instantiate.
@DescribesScenario("init")
@Times(3)
public static ScenarioSetup instantiate() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
engine.getRuntimeService().startProcessInstanceByKey("InterruptingEventSubprocessCompensationScenario", scenarioName);
// enter the event subprocess
engine.getRuntimeService().correlateMessage("Message", 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 SubprocessParallelThrowCompensationScenario method instantiate.
@DescribesScenario("init")
@Times(3)
public static ScenarioSetup instantiate() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
engine.getRuntimeService().startProcessInstanceByKey("SubprocessParallelThrowCompensationScenario", scenarioName);
// create the compensation event subscription and wait before throwing compensation
Task userTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).singleResult();
engine.getTaskService().complete(userTask.getId());
}
};
}
Aggregations