Пример #1
0
        public void StartProcessTest()
        {
            IProcessInstance processInstance = null;
            Thread.CurrentPrincipal = new PrincipalUserAdapter("ae");

            ProcessExecutionService processExecutionApplicationService = new ProcessExecutionService();

            try
            {
                IDictionary attributeValues = new Hashtable();

                processInstance = processExecutionApplicationService.StartProcessInstance(1L, attributeValues);
                //這時已經在First State
                Assert.IsNotNull(processInstance);
            }
            catch (ExecutionException e)
            {
                Assert.Fail("ExcecutionException while starting a new holiday request: " + e.Message);
            }
            finally
            {
                //      loginUtil.logout();
            }
        }
Пример #2
0
        public void StartProcessTest()
        {
            IProcessInstance processInstance = null;
            Thread.CurrentPrincipal = new PrincipalUserAdapter("ae");

            MyProcessDefinitionService myProcessDefinitionService = new MyProcessDefinitionService();
            ProcessExecutionService processExecutionService = new ProcessExecutionService();

            try
            {
                IDictionary attributeValues = new Hashtable();

                processInstance = processExecutionService.StartProcessInstance(1L, attributeValues);

                //這時已經在First State
                Assert.IsNotNull(processInstance);
                //會產生基本的Root Flow
                Assert.IsNotNull(processInstance.RootFlow);
                //root flow進入了ActivityState,Id=3
                Assert.AreEqual(3, processInstance.RootFlow.Node.Id);
                //root flow的actor是ae
                Assert.AreEqual("ae", processInstance.RootFlow.GetActor().Id);
                /*
                 select *from [dbo].[NBPM_PROCESSINSTANCE]
                 select *from [dbo].[NBPM_FLOW]
                 select *from [dbo].[NBPM_LOG]
                 select *from [dbo].[NBPM_LOGDETAIL]
                 */
            }
            catch (ExecutionException e)
            {
                Assert.Fail("ExcecutionException while starting a new holiday request: " + e.Message);
            }
            finally
            {
                //      loginUtil.logout();
            }
        }
Пример #3
0
        public void StartProcessTest()
        {
            IProcessInstance processInstance = null;
            Thread.CurrentPrincipal = new PrincipalUserAdapter("af");

            MyProcessDefinitionService myProcessDefinitionService = new MyProcessDefinitionService();
            ProcessExecutionService processExecutionService = new ProcessExecutionService();

            try
            {
                IDictionary attributeValues = new Hashtable();
                attributeValues.Add("start date", new DateTime(2016, 3, 1));
                attributeValues.Add("end date", new DateTime(2016, 3, 2));

                processInstance = processExecutionService.StartProcessInstance(1L, attributeValues);

                Assert.IsNotNull(processInstance);
                Assert.IsNotNull(processInstance.RootFlow);

                /*
                 select *from [dbo].[NBPM_PROCESSINSTANCE] --1
                 select *from [dbo].[NBPM_FLOW] --1
                 select *from [dbo].[NBPM_LOG] --3
                 select *from [dbo].[NBPM_LOGDETAIL] --6
                 select * from [dbo].[NBPM_ATTRIBUTEINSTANCE] --7
                 */
            }
            catch (ExecutionException e)
            {
                Assert.Fail("ExcecutionException while starting a new holiday request: " + e.Message);
            }
            finally
            {
                //      loginUtil.logout();
            }
        }