use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class SentryScenarioTest method createCaseSentryPartQuery.
// queries /////////////////////////////////
protected CaseSentryPartQueryImpl createCaseSentryPartQuery() {
ProcessEngine processEngine = rule.getProcessEngine();
ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration();
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequiresNew();
return new CaseSentryPartQueryImpl(commandExecutor);
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class AuthorizationTest method setUp.
@Before
public void setUp() {
ProcessEngine processEngine = rule.getProcessEngine();
identityService = processEngine.getIdentityService();
repositoryService = processEngine.getRepositoryService();
runtimeService = processEngine.getRuntimeService();
taskService = processEngine.getTaskService();
historyService = processEngine.getHistoryService();
formService = processEngine.getFormService();
identityService.clearAuthentication();
identityService.setAuthentication("test", Arrays.asList("accounting"));
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class InterruptingEventSubProcessNestedCompensationScenario method instantiateThrowCompensate.
@DescribesScenario("init.throwCompensate")
@Times(4)
public static ScenarioSetup instantiateThrowCompensate() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
engine.getRuntimeService().startProcessInstanceByKey("InterruptingEventSubProcessNestedCompensationScenario", scenarioName);
// trigger the event subprocess
engine.getRuntimeService().correlateMessage("EventSubProcessMessage", scenarioName);
// complete the task to compensate and then throw compensation
Task innerSubProcessTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).singleResult();
engine.getTaskService().complete(innerSubProcessTask.getId());
}
};
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class NestedMultiInstanceCompensationScenario method instantitiateThrowCompensateAfterSubprocess.
@DescribesScenario("init.throwOuter")
@Times(3)
public static ScenarioSetup instantitiateThrowCompensateAfterSubprocess() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
engine.getRuntimeService().startProcessInstanceByKey("NestedMultiInstanceCompensationThrowOuterScenario", scenarioName);
// throw compensation after the mi subprocess has ended
List<Task> subProcessTasks = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).list();
for (Task subProcessTask : subProcessTasks) {
engine.getTaskService().complete(subProcessTask.getId());
}
}
};
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class ParallelMultiInstanceCompensationScenario method singleActivityHandlerBeforeCompensate.
@DescribesScenario("singleActivityHandler.beforeCompensate")
@Times(3)
public static ScenarioSetup singleActivityHandlerBeforeCompensate() {
return new ScenarioSetup() {
public void execute(ProcessEngine engine, String scenarioName) {
engine.getRuntimeService().startProcessInstanceByKey("ParallelMultiInstanceCompensationSingleActivityHandlerScenario", scenarioName);
// complete all mi tasks
List<Task> miTasks = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).list();
for (Task miTask : miTasks) {
engine.getTaskService().complete(miTask.getId());
}
}
};
}
Aggregations