Example #1
0
        protected internal virtual TransitionInstanceImpl CreateTransitionInstance(PvmExecutionImpl execution)
        {
            TransitionInstanceImpl transitionInstance = new TransitionInstanceImpl();

            // can use execution id as persistent ID for transition as an execution
            // can execute as most one transition at a time.
            transitionInstance.Id = execution.Id;
            transitionInstance.ParentActivityInstanceId = execution.ParentActivityInstanceId;
            transitionInstance.ProcessInstanceId        = execution.ProcessInstanceId;
            transitionInstance.ProcessDefinitionId      = execution.ProcessDefinitionId;
            transitionInstance.ExecutionId = execution.Id;
            transitionInstance.ActivityId  = execution.ActivityId;

            ActivityImpl activity = (ActivityImpl)execution.Activity;

            if (activity != null)
            {
                string name = activity.Name;
                if (string.IsNullOrEmpty(name))
                {
                    name = (string)activity.GetProperty("name");
                }
                transitionInstance.ActivityName = name;
                transitionInstance.ActivityType = (string)activity.GetProperty("type");
            }

            return(transitionInstance);
        }
Example #2
0
        public virtual void TestParseCompensationEndEvent()
        {
            ActivityImpl endEvent = FindActivityInDeployedProcessDefinition("end");

            Assert.AreEqual(ActivityTypes.EndEventCompensation, endEvent.GetProperty("type"));
            Assert.AreEqual(true, endEvent.GetProperty(BpmnParse.PropertynameThrowsCompensation));
            Assert.AreEqual(typeof(CompensationEventActivityBehavior), endEvent.ActivityBehavior.GetType());
        }
Example #3
0
        [Deployment]//TODO 表达式解析相关
        public virtual void TestParseSignalStartEvent()
        {
            ActivityImpl signalStartActivity = FindActivityInDeployedProcessDefinition("start");

            Assert.AreEqual(ActivityTypes.StartEventSignal, signalStartActivity.GetProperty("type"));
            Assert.AreEqual(typeof(NoneStartEventActivityBehavior), signalStartActivity.ActivityBehavior.GetType());
        }
Example #4
0
 public virtual void ParseIntermediateCatchEvent(Element intermediateEventElement, ScopeImpl scope,
                                                 ActivityImpl activity)
 {
     // do not write history for link events
     if ((string)activity.GetProperty("type") != ActivityTypes.IntermediateEventLink)
     {
         addActivityHandlers(activity);
     }
 }
Example #5
0
        public virtual void TestParseCompensationStartEvent()
        {
            ActivityImpl compensationStartEvent = FindActivityInDeployedProcessDefinition("compensationStartEvent");

            Assert.AreEqual(ActivityTypes.StartEventCompensation, compensationStartEvent.GetProperty("type"));
            Assert.AreEqual(typeof(EventSubProcessStartEventActivityBehavior), compensationStartEvent.ActivityBehavior.GetType());

            ActivityImpl compensationEventSubProcess = (ActivityImpl)compensationStartEvent.FlowScope;

            Assert.AreEqual(true, compensationEventSubProcess.GetProperty(BpmnParse.PropertynameIsForCompensation));

            ScopeImpl subprocess = compensationEventSubProcess.FlowScope;

            Assert.AreEqual(compensationEventSubProcess.ActivityId, subprocess.GetProperty(BpmnParse.PropertynameCompensationHandlerId));
        }