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

📄 ppmexport.cs

📁 基于DotNet的开源工作流引擎
💻 CS
字号:
using System.Threading;
using Castle.Windsor.Configuration.Interpreters;
using NAnt.Core;
using NAnt.Core.Attributes;
using NetBpm.Ext.NAnt.EComp;
using NetBpm.Workflow.Organisation;

namespace NetBpm.Ext.NAnt
{
	/// <summary>
	/// This task export all processdata for PPM.
	/// </summary>
	[TaskName("ppmexport")]
	public class PPMExport : Task
	{
		private string configfile;
		private string user;
		private string exportPath;

		[TaskAttribute("configfile", Required=true)]
		public string ConfigFile
		{
			get { return configfile; }
			set { configfile = value; }
		}

		[TaskAttribute("user", Required=true)]
		public string User
		{
			get { return user; }
			set { user = value; }
		}

		[TaskAttribute("exportpath", Required=true)]
		public string ExportPath
		{
			get { return exportPath; }
			set { exportPath = value; }
		}

		protected override void ExecuteTask()
		{
			NetBpmContainer container=null;
			try
			{
				//configure the container
				container = new NetBpmContainer(new XmlInterpreter(ConfigFile));
				Thread.CurrentPrincipal = new PrincipalUserAdapter(user);
				IPPMSessionLocal ppmComponent=(IPPMSessionLocal)container["PPMSession"];
				ppmComponent.ExportPPMFile(ExportPath);
			} 
			finally
			{
				if (container!=null)
				{
					container.Dispose();
				}
			}
		}

	}
}

⌨️ 快捷键说明

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