Exemplo n.º 1
0
        public virtual void noHistoryUpdateOnSameStructureMigration()
        {
            // given
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ONE_BOUNDARY_TASK);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ONE_BOUNDARY_TASK);

            MigrationPlan migrationPlan = rule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapEqualActivities().build();

            ProcessInstance processInstance = runtimeService.startProcessInstanceById(sourceProcessDefinition.Id);
            ExecutionTree   executionTreeBeforeMigration = ExecutionTree.forExecution(processInstance.Id, rule.ProcessEngine);

            ExecutionTree scopeExecution = executionTreeBeforeMigration.Executions[0];

            runtimeService.setVariableLocal(scopeExecution.Id, "foo", 42);

            // when
            testHelper.migrateProcessInstance(migrationPlan, processInstance);

            // then there is still one historic variable instance
            Assert.assertEquals(1, historyService.createHistoricVariableInstanceQuery().count());

            // and no additional historic details
            Assert.assertEquals(1, historyService.createHistoricDetailQuery().count());
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testVariableAtScopeExecutionInScopeActivity()
        public virtual void testVariableAtScopeExecutionInScopeActivity()
        {
            // given
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ONE_BOUNDARY_TASK);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ONE_BOUNDARY_TASK);

            MigrationPlan migrationPlan = rule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapEqualActivities().build();

            ProcessInstance processInstance = runtimeService.startProcessInstanceById(sourceProcessDefinition.Id);
            ExecutionTree   executionTreeBeforeMigration = ExecutionTree.forExecution(processInstance.Id, rule.ProcessEngine);

            ExecutionTree scopeExecution = executionTreeBeforeMigration.Executions[0];

            runtimeService.setVariableLocal(scopeExecution.Id, "foo", 42);

            // when
            testHelper.migrateProcessInstance(migrationPlan, processInstance);

            // then
            VariableInstance beforeMigration = testHelper.snapshotBeforeMigration.getSingleVariable("foo");

            Assert.assertEquals(1, testHelper.snapshotAfterMigration.getVariables().Count);
            testHelper.assertVariableMigratedToExecution(beforeMigration, beforeMigration.ExecutionId);
        }