예제 #1
0
        public virtual void TestExecutionTasksMi()
        {
            runtimeService.StartProcessInstanceByKey("testProcess");

            var processInstance = (ExecutionEntity)runtimeService.CreateProcessInstanceQuery().First();

            Assert.AreEqual(0, processInstance.CachedEntityStateRaw);

            var executions = runtimeService.CreateExecutionQuery(c => c.ActivityId == "userTask").ToList();

            foreach (var execution in executions)
            {
                var cachedEntityStateRaw = ((ExecutionEntity)execution).CachedEntityStateRaw;
                if (!((ExecutionEntity)execution).IsScope)
                {
                    Assert.AreEqual(
                        BitMaskUtil.GetMaskForBit(ExecutionEntity.TasksStateBit) |
                        BitMaskUtil.GetMaskForBit(ExecutionEntity.VariablesStateBit), cachedEntityStateRaw);
                }
                else
                {
                    Assert.AreEqual(BitMaskUtil.GetMaskForBit(ExecutionEntity.VariablesStateBit), cachedEntityStateRaw);
                }
            }
        }
예제 #2
0
        public virtual void TestProcessInstanceEventSubscriptions()
        {
            runtimeService.StartProcessInstanceByKey("testProcess");

            var processInstance = (ExecutionEntity)runtimeService.CreateProcessInstanceQuery().First();

            Assert.AreEqual(BitMaskUtil.GetMaskForBit(ExecutionEntity.EventSubscriptionsStateBit),
                            processInstance.CachedEntityStateRaw);
        }
예제 #3
0
        public virtual void TestExecutionExternalTask()
        {
            runtimeService.StartProcessInstanceByKey("oneExternalTaskProcess");

            var execution =
                (ExecutionEntity)runtimeService.CreateExecutionQuery(c => c.ActivityId == "externalTask").First();

            Assert.AreEqual(BitMaskUtil.GetMaskForBit(ExecutionEntity.ExternalTasksBit), execution.CachedEntityStateRaw);
        }
예제 #4
0
        public virtual void TestExecutionTasksParallel()
        {
            runtimeService.StartProcessInstanceByKey("testProcess");

            var processInstance = (ExecutionEntity)runtimeService.CreateProcessInstanceQuery().First();

            Assert.AreEqual(0, processInstance.CachedEntityStateRaw);

            var execution =
                (ExecutionEntity)runtimeService.CreateExecutionQuery(c => c.ActivityId == "userTask").First();

            Assert.AreEqual(BitMaskUtil.GetMaskForBit(ExecutionEntity.TasksStateBit), execution.CachedEntityStateRaw);
        }
예제 #5
0
        public virtual void TestExecutionEventSubscriptionsScope()
        {
            runtimeService.StartProcessInstanceByKey("testProcess");

            var processInstance = (ExecutionEntity)runtimeService.CreateProcessInstanceQuery().First();

            Assert.AreEqual(0, processInstance.CachedEntityStateRaw);

            var execution =
                (ExecutionEntity)
                runtimeService.CreateExecutionQuery(c => c.ActivityId == "IntermediateCatchEvent_1").First();

            Assert.AreEqual(BitMaskUtil.GetMaskForBit(ExecutionEntity.EventSubscriptionsStateBit),
                            execution.CachedEntityStateRaw);
        }
예제 #6
0
        public virtual void TestExecutionIncidentParallel()
        {
            runtimeService.StartProcessInstanceByKey("testProcess");

            var processInstance = (ExecutionEntity)runtimeService.CreateProcessInstanceQuery().First();

            Assert.AreEqual(0, processInstance.CachedEntityStateRaw);

            var execution = (ExecutionEntity)runtimeService.CreateExecutionQuery(c => c.ActivityId == "task").First();

            Assert.AreEqual(0, execution.CachedEntityStateRaw);

            processEngineConfiguration.CommandExecutorTxRequired.Execute(new CommandAnonymousInnerClass2(this, execution));

            var execution2 = (ExecutionEntity)runtimeService.CreateExecutionQuery(c => c.ActivityId == "task").First();

            Assert.AreEqual(BitMaskUtil.GetMaskForBit(ExecutionEntity.IncidentStateBit), execution2.CachedEntityStateRaw);
        }