コード例 #1
0
 public ActivitiWorker(IProcessDefinitionService processDefinitionService, IProcessInstanceService processInstanceService, ITaskService taskService, ITaskFormService taskFormService)
 {
     _processDefinitionService = processDefinitionService;
     _processInstanceService   = processInstanceService;
     _taskService     = taskService;
     _taskFormService = taskFormService;
 }
コード例 #2
0
        public void ContainerTest()
        {
            container = new WindsorContainer(TestHelper.GetConfigDir() + "WindsorContainerTest.xml");

            IOrganisationService organisationSession = (IOrganisationService)container["OrganisationSession"];

            Assert.IsNotNull(organisationSession);
            organisationSession = (IOrganisationService)container[typeof(IOrganisationService)];
            Assert.IsNotNull(organisationSession);

            ISchedulerSessionLocal schedulerSession = (ISchedulerSessionLocal)container["SchedulerSession"];

            Assert.IsNotNull(schedulerSession);
            schedulerSession = (ISchedulerSessionLocal)container[typeof(ISchedulerSessionLocal)];
            Assert.IsNotNull(schedulerSession);

            IProcessDefinitionService definitionSession = (IProcessDefinitionService)container["DefinitionSession"];

            Assert.IsNotNull(definitionSession);
            definitionSession = (IProcessDefinitionService)container[typeof(IProcessDefinitionService)];
            Assert.IsNotNull(definitionSession);

            IExecutionApplicationService executionSession = (IExecutionApplicationService)container["ExecutionSession"];

            Assert.IsNotNull(executionSession);
            executionSession = (IExecutionApplicationService)container[typeof(IExecutionApplicationService)];
            Assert.IsNotNull(executionSession);

            ILogSessionLocal logSession = (ILogSessionLocal)container["LogSession"];

            Assert.IsNotNull(logSession);
            logSession = (ILogSessionLocal)container[typeof(ILogSessionLocal)];
            Assert.IsNotNull(logSession);
        }
コード例 #3
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();
                }
            }
        }
コード例 #4
0
 public void SetContainer()
 {
     //configure the container
     _container          = new NetBpmContainer(new XmlInterpreter("WindsorConfig.xml"));
     servicelocator      = ServiceLocator.Instance;
     definitionComponent = servicelocator.GetService(typeof(IProcessDefinitionService)) as IProcessDefinitionService;
     executionComponent  = servicelocator.GetService(typeof(IExecutionApplicationService)) as IExecutionApplicationService;
 }
コード例 #5
0
ファイル: BaseTest.cs プロジェクト: JackWangCUMT/netbpm
 public void SetContainer()
 {
     //configure the container
     _container = new NetBpmContainer(new XmlInterpreter("WindsorConfig.xml"));
     servicelocator = ServiceLocator.Instance;
     processDefinitionService = servicelocator.GetService(typeof(IProcessDefinitionService)) as IProcessDefinitionService;
     executionComponent = servicelocator.GetService(typeof(IExecutionApplicationService)) as IExecutionApplicationService;
 }
コード例 #6
0
        public void DisposeContainer()
        {
            servicelocator.Release(definitionComponent);
            definitionComponent = null;
            servicelocator.Release(executionComponent);
            executionComponent = null;

            _container.Dispose();
            _container = null;
        }
コード例 #7
0
ファイル: DefinitionTest.cs プロジェクト: JackWangCUMT/netbpm
        public void DisposeContainer()
        {
            servicelocator.Release(definitionComponent);
            definitionComponent = null;
            servicelocator.Release(executionComponent);
            executionComponent = null;

            _container.Dispose();
            _container = null;
        }
コード例 #8
0
 public void SetContainer()
 {
     //configure the container
     _container          = new NetBpmContainer(new XmlInterpreter(TestHelper.GetConfigDir() + "app_config.xml"));
     testUtil            = new TestUtil();
     servicelocator      = ServiceLocator.Instance;
     definitionComponent = servicelocator.GetService(typeof(IProcessDefinitionService)) as IProcessDefinitionService;
     executionComponent  = servicelocator.GetService(typeof(IExecutionApplicationService)) as IExecutionApplicationService;
     testUtil.LoginUser("ae");
 }
コード例 #9
0
 public AccountController(
     IAccountService accountService, IAuthInfoProvider authInfoProvider, IUserService userService,
     IProcessDefinitionService processDefinitionService
     )
 {
     _processDefinitionService = processDefinitionService;
     _accountService           = accountService;
     _authInfoProvider         = authInfoProvider;
     _userService = userService;
 }
コード例 #10
0
		public void SetContainer()
		{
			//configure the container
			_container = new NetBpmContainer(new XmlInterpreter(TestHelper.GetConfigDir()+"app_config.xml"));
			testUtil = new TestUtil();
			servicelocator = ServiceLocator.Instance;
			definitionComponent = servicelocator.GetService(typeof (IProcessDefinitionService)) as IProcessDefinitionService;
			executionComponent = servicelocator.GetService(typeof (IExecutionApplicationService)) as IExecutionApplicationService;
			testUtil.LoginUser("ae");

		}
コード例 #11
0
        public void StressTest()
        {
            IProcessDefinitionService definitionComponent = null;

            for (int i = 1; i < 20; i++)
            {
                definitionComponent = ServiceLocator.Instance.GetService(typeof(IProcessDefinitionService)) as IProcessDefinitionService;
                IList definitions = definitionComponent.GetProcessDefinitions(null);
                Assert.IsNotNull(definitions);
                ServiceLocator.Instance.Release(definitionComponent);
            }
        }
コード例 #12
0
        public void StressTest()
        {
            container = new WindsorContainer(TestHelper.GetConfigDir() + "WindsorContainerTest.xml");
            IProcessDefinitionService definitionSession = null;

            for (int i = 1; i < 20; i++)
            {
                definitionSession = (IProcessDefinitionService)container["DefinitionSession"];
                Assert.IsNotNull(definitionSession);
                definitionSession = (IProcessDefinitionService)container[typeof(IProcessDefinitionService)];
                Assert.IsNotNull(definitionSession);
                container.Release(definitionSession);
                definitionSession = null;
            }
        }
コード例 #13
0
        public void ServiceLocatorStressTest()
        {
            for (int i = 1; i < 5; i++)
            {
                //configure the container
                NetBpmContainer           container           = new NetBpm.NetBpmContainer(new XmlInterpreter(TestHelper.GetConfigDir() + "app_config.xml"));
                IProcessDefinitionService definitionComponent = null;

                definitionComponent = ServiceLocator.Instance.GetService(typeof(IProcessDefinitionService)) as IProcessDefinitionService;
                IList definitions = definitionComponent.GetProcessDefinitions(null);

                Assert.IsNotNull(definitions);

                ServiceLocator.Instance.Release(definitionComponent);
                container.Dispose();
                container = null;
            }
        }
コード例 #14
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);
        }
コード例 #15
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);

		}
コード例 #16
0
 public ProcessDefinitionController(IWfEngine wfEngine, IProcessDefinitionService processDefinitionService)
 {
     _processProvider          = wfEngine.GetDefinitionProvider();
     _processDefinitionService = processDefinitionService;
 }