Search in sources :

Example 1 with ExtendsScenario

use of org.camunda.bpm.qa.upgrade.ExtendsScenario in project camunda-bpm-platform by camunda.

the class ParallelMultiInstanceCompensationScenario method singleActivityHandlerThrowCompensate.

@DescribesScenario("singleActivityHandler.beforeCompensate.throwCompensate")
@ExtendsScenario("singleActivityHandler.beforeCompensate")
@Times(3)
public static ScenarioSetup singleActivityHandlerThrowCompensate() {
    return new ScenarioSetup() {

        public void execute(ProcessEngine engine, String scenarioName) {
            Task beforeCompensateTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).singleResult();
            engine.getTaskService().complete(beforeCompensateTask.getId());
        }
    };
}
Also used : Task(org.camunda.bpm.engine.task.Task) ScenarioSetup(org.camunda.bpm.qa.upgrade.ScenarioSetup) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) DescribesScenario(org.camunda.bpm.qa.upgrade.DescribesScenario) Times(org.camunda.bpm.qa.upgrade.Times) ExtendsScenario(org.camunda.bpm.qa.upgrade.ExtendsScenario)

Example 2 with ExtendsScenario

use of org.camunda.bpm.qa.upgrade.ExtendsScenario in project camunda-bpm-platform by camunda.

the class ParallelMultiInstanceCompensationScenario method defaultHandlerThrowCompensate.

@DescribesScenario("defaultHandler.beforeCompensate.throwCompensate")
@ExtendsScenario("defaultHandler.beforeCompensate")
@Times(3)
public static ScenarioSetup defaultHandlerThrowCompensate() {
    return new ScenarioSetup() {

        public void execute(ProcessEngine engine, String scenarioName) {
            Task beforeCompensateTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).singleResult();
            engine.getTaskService().complete(beforeCompensateTask.getId());
        }
    };
}
Also used : Task(org.camunda.bpm.engine.task.Task) ScenarioSetup(org.camunda.bpm.qa.upgrade.ScenarioSetup) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) DescribesScenario(org.camunda.bpm.qa.upgrade.DescribesScenario) Times(org.camunda.bpm.qa.upgrade.Times) ExtendsScenario(org.camunda.bpm.qa.upgrade.ExtendsScenario)

Example 3 with ExtendsScenario

use of org.camunda.bpm.qa.upgrade.ExtendsScenario 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());
        }
    };
}
Also used : Task(org.camunda.bpm.engine.task.Task) ScenarioSetup(org.camunda.bpm.qa.upgrade.ScenarioSetup) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) DescribesScenario(org.camunda.bpm.qa.upgrade.DescribesScenario) Times(org.camunda.bpm.qa.upgrade.Times) ExtendsScenario(org.camunda.bpm.qa.upgrade.ExtendsScenario)

Example 4 with ExtendsScenario

use of org.camunda.bpm.qa.upgrade.ExtendsScenario in project camunda-bpm-platform by camunda.

the class SequentialMultiInstanceCompensationScenario method defaultHandlerThrowCompensate.

@DescribesScenario("defaultHandler.beforeCompensate.throwCompensate")
@ExtendsScenario("defaultHandler.beforeCompensate")
@Times(3)
public static ScenarioSetup defaultHandlerThrowCompensate() {
    return new ScenarioSetup() {

        public void execute(ProcessEngine engine, String scenarioName) {
            Task beforeCompensateTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).singleResult();
            engine.getTaskService().complete(beforeCompensateTask.getId());
        }
    };
}
Also used : Task(org.camunda.bpm.engine.task.Task) ScenarioSetup(org.camunda.bpm.qa.upgrade.ScenarioSetup) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) DescribesScenario(org.camunda.bpm.qa.upgrade.DescribesScenario) Times(org.camunda.bpm.qa.upgrade.Times) ExtendsScenario(org.camunda.bpm.qa.upgrade.ExtendsScenario)

Example 5 with ExtendsScenario

use of org.camunda.bpm.qa.upgrade.ExtendsScenario in project camunda-bpm-platform by camunda.

the class SingleActivityConcurrentCompensationScenario 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().taskDefinitionKey("beforeCompensate").processInstanceBusinessKey(scenarioName).singleResult();
            engine.getTaskService().complete(beforeCompensateTask.getId());
        }
    };
}
Also used : Task(org.camunda.bpm.engine.task.Task) ScenarioSetup(org.camunda.bpm.qa.upgrade.ScenarioSetup) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) DescribesScenario(org.camunda.bpm.qa.upgrade.DescribesScenario) Times(org.camunda.bpm.qa.upgrade.Times) ExtendsScenario(org.camunda.bpm.qa.upgrade.ExtendsScenario)

Aggregations

ProcessEngine (org.camunda.bpm.engine.ProcessEngine)18 Task (org.camunda.bpm.engine.task.Task)18 DescribesScenario (org.camunda.bpm.qa.upgrade.DescribesScenario)18 ExtendsScenario (org.camunda.bpm.qa.upgrade.ExtendsScenario)18 ScenarioSetup (org.camunda.bpm.qa.upgrade.ScenarioSetup)18 Times (org.camunda.bpm.qa.upgrade.Times)18