Search in sources :

Example 51 with ScenarioSetup

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

the class NestedNonInterruptingBoundaryEventOnInnerSubprocessScenario 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("NestedNonInterruptingTimerBoundaryEventOnInnerSubprocessScenario", scenarioName);
            Job job = engine.getManagementService().createJobQuery().processInstanceId(instance.getId()).singleResult();
            engine.getManagementService().executeJob(job.getId());
        }
    };
}
Also used : ScenarioSetup(org.camunda.bpm.qa.upgrade.ScenarioSetup) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Job(org.camunda.bpm.engine.runtime.Job) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) DescribesScenario(org.camunda.bpm.qa.upgrade.DescribesScenario) Times(org.camunda.bpm.qa.upgrade.Times)

Example 52 with ScenarioSetup

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

the class NonInterruptingBoundaryEventScenario method initTimer.

@DescribesScenario("initTimer")
@Times(5)
public static ScenarioSetup initTimer() {
    return new ScenarioSetup() {

        public void execute(ProcessEngine engine, String scenarioName) {
            ProcessInstance instance = engine.getRuntimeService().startProcessInstanceByKey("NonInterruptingTimerBoundaryEventScenario", scenarioName);
            Job job = engine.getManagementService().createJobQuery().processInstanceId(instance.getId()).singleResult();
            engine.getManagementService().executeJob(job.getId());
        }
    };
}
Also used : ScenarioSetup(org.camunda.bpm.qa.upgrade.ScenarioSetup) ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) Job(org.camunda.bpm.engine.runtime.Job) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) DescribesScenario(org.camunda.bpm.qa.upgrade.DescribesScenario) Times(org.camunda.bpm.qa.upgrade.Times)

Example 53 with ScenarioSetup

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

the class SubprocessParallelCreateCompensationScenario method instantiate.

@DescribesScenario("init")
@Times(2)
public static ScenarioSetup instantiate() {
    return new ScenarioSetup() {

        public void execute(ProcessEngine engine, String scenarioName) {
            engine.getRuntimeService().startProcessInstanceByKey("SubprocessParallelCreateCompensationScenario", scenarioName);
            // create the compensation event subscription for the first user task
            // execution continues from userTask1 to afterUserTask1
            Task userTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).taskDefinitionKey("userTask1").singleResult();
            engine.getTaskService().complete(userTask.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)

Example 54 with ScenarioSetup

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

the class TransactionCancelCompensationScenario 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 by executing the cancel end event;
            // the compensation handler for userTask should then be active
            Task beforeCancelTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).singleResult();
            engine.getTaskService().complete(beforeCancelTask.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 55 with ScenarioSetup

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

the class TransactionCancelCompensationScenario method instantiate.

@DescribesScenario("init")
@Times(3)
public static ScenarioSetup instantiate() {
    return new ScenarioSetup() {

        public void execute(ProcessEngine engine, String scenarioName) {
            engine.getRuntimeService().startProcessInstanceByKey("TransactionCancelCompensationScenario", scenarioName);
            // create the compensation event subscription and wait before throwing cancel end event
            Task userTask = engine.getTaskService().createTaskQuery().processInstanceBusinessKey(scenarioName).singleResult();
            engine.getTaskService().complete(userTask.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)

Aggregations

ProcessEngine (org.camunda.bpm.engine.ProcessEngine)60 DescribesScenario (org.camunda.bpm.qa.upgrade.DescribesScenario)60 ScenarioSetup (org.camunda.bpm.qa.upgrade.ScenarioSetup)60 Times (org.camunda.bpm.qa.upgrade.Times)52 Task (org.camunda.bpm.engine.task.Task)46 ExtendsScenario (org.camunda.bpm.qa.upgrade.ExtendsScenario)18 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)11 CaseService (org.camunda.bpm.engine.CaseService)4 Job (org.camunda.bpm.engine.runtime.Job)4 IdentityService (org.camunda.bpm.engine.IdentityService)3 User (org.camunda.bpm.engine.identity.User)3 Group (org.camunda.bpm.engine.identity.Group)2 CaseExecutionQuery (org.camunda.bpm.engine.runtime.CaseExecutionQuery)2 CaseInstance (org.camunda.bpm.engine.runtime.CaseInstance)2 Execution (org.camunda.bpm.engine.runtime.Execution)2 Connection (java.sql.Connection)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 SqlSession (org.apache.ibatis.session.SqlSession)1