use of org.camunda.bpm.qa.upgrade.ScenarioSetup 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);
}
};
}
use of org.camunda.bpm.qa.upgrade.ScenarioSetup in project camunda-bpm-platform by camunda.
the class DeployUserWithoutSaltForPasswordHashingScenario method initUser.
@DescribesScenario("initUser")
@Times(1)
public static ScenarioSetup initUser() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
// given
IdentityService identityService = engine.getIdentityService();
User user = identityService.newUser(USER_NAME);
user.setPassword(USER_PWD);
// when
identityService.saveUser(user);
}
};
}
use of org.camunda.bpm.qa.upgrade.ScenarioSetup in project camunda-bpm-platform by camunda.
the class CreateProcessInstanceWithVariableScenario method initProcessInstance.
@DescribesScenario("initProcessInstance")
public static ScenarioSetup initProcessInstance() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
// given
ProcessInstance processInstance = engine.getRuntimeService().startProcessInstanceByKey("Process", "process");
// when
Execution execution = engine.getRuntimeService().createExecutionQuery().processInstanceId(processInstance.getId()).singleResult();
engine.getRuntimeService().setVariable(execution.getId(), "foo", "bar");
}
};
}
use of org.camunda.bpm.qa.upgrade.ScenarioSetup in project camunda-bpm-platform by camunda.
the class NestedNonInterruptingBoundaryEventOnOuterSubprocessScenario method initTimer.
@DescribesScenario("initTimer")
@Times(7)
public static ScenarioSetup initTimer() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
ProcessInstance instance = engine.getRuntimeService().startProcessInstanceByKey("NestedNonInterruptingTimerBoundaryEventOnOuterSubprocessScenario", scenarioName);
Job job = engine.getManagementService().createJobQuery().processInstanceId(instance.getId()).singleResult();
engine.getManagementService().executeJob(job.getId());
}
};
}
use of org.camunda.bpm.qa.upgrade.ScenarioSetup in project camunda-bpm-platform by camunda.
the class InterruptingEventSubprocessCompensationScenario 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());
}
};
}
Aggregations