⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 forkimpl.cs

📁 基于DotNet的开源工作流引擎
💻 CS
字号:
using System;
using System.Collections;
using NetBpm.Util.Xml;
using NetBpm.Workflow.Delegation.Impl;

namespace NetBpm.Workflow.Definition.Impl
{
	public class ForkImpl : NodeImpl, IFork
	{
		[NonSerialized()] private DelegationImpl _forkDelegation = null;

		public DelegationImpl ForkDelegation
		{
			get { return _forkDelegation; }
			set { this._forkDelegation = value; }
		}

		public ForkImpl()
		{
		}

		public ForkImpl(IProcessDefinition processDefinition) : base(processDefinition)
		{
		}

		public DelegationImpl CreateForkDelegation()
		{
			_forkDelegation = new DelegationImpl(_processDefinition);
			return _forkDelegation;
		}

		public override void ReadProcessData(XmlElement xmlElement, CreationContext creationContext)
		{
			base.ReadProcessData(xmlElement, creationContext);

			if ((Object) xmlElement.GetAttribute("handler") != null)
			{
				creationContext.DelegatingObject = this;
				this._forkDelegation = new DelegationImpl();
				this._forkDelegation.ReadProcessData(xmlElement, creationContext);
				creationContext.DelegatingObject = null;
			}
		}

		public override void Validate(ValidationContext validationContext)
		{
			base.Validate(validationContext);

			// verify that all transitions leaving a fork have a name
			// this is required because this name is assigned to the flow and
			// it serves as an id for the ForkHandler's
			IEnumerator iter = _leavingTransitions.GetEnumerator();
			while (iter.MoveNext())
			{
				TransitionImpl transition = (TransitionImpl) iter.Current;
				validationContext.Check(((Object) transition.Name != null), "one of the transitions leaving the fork does not have a name");
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -