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); }
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()); }
[Deployment]//TODO 表达式解析相关 public virtual void TestParseSignalStartEvent() { ActivityImpl signalStartActivity = FindActivityInDeployedProcessDefinition("start"); Assert.AreEqual(ActivityTypes.StartEventSignal, signalStartActivity.GetProperty("type")); Assert.AreEqual(typeof(NoneStartEventActivityBehavior), signalStartActivity.ActivityBehavior.GetType()); }
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); } }
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)); }