Beispiel #1
0
        protected override void ExecuteTask()
        {
            NetBpmContainer           container           = null;
            IProcessDefinitionService definitionComponent = null;

            try
            {
                //configure the container
                container           = new NetBpmContainer(new XmlInterpreter(ConfigFile));
                definitionComponent = ServiceLocator.Instance.GetService(typeof(IProcessDefinitionService)) as IProcessDefinitionService;
                if (definitionComponent == null)
                {
                    throw new ArgumentException("Can’t create definition component. Container is not configured please check the configfile:" + ConfigFile);
                }
                Thread.CurrentPrincipal = new PrincipalUserAdapter(user);

                FileInfo   parFile = new FileInfo(ParFile);
                FileStream fstream = parFile.OpenRead();
                byte[]     b       = new byte[parFile.Length];
                fstream.Read(b, 0, (int)parFile.Length);
                definitionComponent.DeployProcessArchive(b);
            } finally
            {
                if (container != null)
                {
                    if (definitionComponent != null)
                    {
                        container.Release(definitionComponent);
                    }
                    container.Dispose();
                }
            }
        }
Beispiel #2
0
        public void DeployProcessTest()
        {
            FileInfo   parFile = new FileInfo("ExamplePar/helloworld4.par");
            FileStream fstream = parFile.OpenRead();

            byte[] b = new byte[parFile.Length];
            fstream.Read(b, 0, (int)parFile.Length);
            definitionComponent.DeployProcessArchive(b);
        }
Beispiel #3
0
        private void DeployParFile(string parFileName)
        {
            FileInfo   parFile = new FileInfo(TestHelper.GetExampleDir() + parFileName);
            FileStream fstream = parFile.OpenRead();

            byte[] b = new byte[parFile.Length];
            fstream.Read(b, 0, (int)parFile.Length);
            definitionComponent.DeployProcessArchive(b);
        }
Beispiel #4
0
        public void SetContainer()
        {
            //configure the container
            _container            = new NetBpmContainer(new XmlInterpreter("app_config.xml"));
            testUtil              = new TestUtil();
            servicelocator        = ServiceLocator.Instance;
            definitionComponent   = servicelocator.GetService(typeof(IProcessDefinitionService)) as IProcessDefinitionService;
            executionComponent    = servicelocator.GetService(typeof(IExecutionApplicationService)) as IExecutionApplicationService;
            schedulerComponent    = servicelocator.GetService(typeof(ISchedulerSessionLocal)) as ISchedulerSessionLocal;
            organisationComponent = servicelocator.GetService(typeof(IOrganisationService)) as IOrganisationService;
            testUtil.LoginUser("ae");

            // Par是一個壓縮檔,除了有定義檔之外,還有可以用來展出Web-UI定義及相關圖形
            FileInfo   parFile = new FileInfo(TestHelper.GetExampleDir() + GetParArchiv());
            FileStream fstream = parFile.OpenRead();

            byte[] b = new byte[parFile.Length];
            fstream.Read(b, 0, (int)parFile.Length);
            //此處在解壓縮Par
            definitionComponent.DeployProcessArchive(b);
        }
		public void SetContainer()
		{
			//configure the container
			_container = new NetBpmContainer(new XmlInterpreter("app_config.xml"));
			testUtil = new TestUtil();
			servicelocator = ServiceLocator.Instance;
			definitionComponent = servicelocator.GetService(typeof (IProcessDefinitionService)) as IProcessDefinitionService;
			executionComponent = servicelocator.GetService(typeof (IExecutionApplicationService)) as IExecutionApplicationService;
			schedulerComponent = servicelocator.GetService(typeof (ISchedulerSessionLocal)) as ISchedulerSessionLocal;
			organisationComponent = servicelocator.GetService(typeof (IOrganisationService)) as IOrganisationService;
			testUtil.LoginUser("ae");

			// Par是一個壓縮檔,除了有定義檔之外,還有可以用來展出Web-UI定義及相關圖形
			FileInfo parFile = new FileInfo(TestHelper.GetExampleDir()+GetParArchiv());
			FileStream fstream = parFile.OpenRead();
			byte[] b = new byte[parFile.Length];
			fstream.Read(b, 0, (int) parFile.Length);
            //此處在解壓縮Par
			definitionComponent.DeployProcessArchive(b);

		}