Example #1
0
        public void ProcessActivityTest()
        {
            Thread.CurrentPrincipal = new PrincipalUserAdapter("ae");

            ProcessExecutionService processExecutionApplicationService = new ProcessExecutionService();

            try
            {
                var taskLists = processExecutionApplicationService.GetTaskList("ae");
                IList flows = null;
                foreach (IFlow task in taskLists)
                {
                    //跑完進入End State,因為
                    flows = processExecutionApplicationService.PerformActivity(task.Id);
                }

            }
            catch (ExecutionException e)
            {
                Assert.Fail("ExcecutionException while starting a new holiday request: " + e.Message);
            }
            finally
            {
                //      loginUtil.logout();
            }
        }
Example #2
0
        public void ProcessActivityTest()
        {
            Thread.CurrentPrincipal = new PrincipalUserAdapter("ae");

            ProcessExecutionService processExecutionService = new ProcessExecutionService();

            try
            {
                //af申請的,ae是af的主管,登入者要換成ae
                var taskLists = processExecutionService.GetTaskList("ae");

                IDictionary attributeValues = new Hashtable();
                attributeValues.Add("evaluation result", Evaluation.APPROVE);

                foreach (IFlow task in taskLists)
                {
                    //出現一個無法處理的錯誤
                    processExecutionService.PerformActivity(task.Id, attributeValues);
                }
            }
            catch (ExecutionException e)
            {
                Assert.Fail("ExcecutionException while starting a new holiday request: " + e.Message);
            }
            finally
            {
                //      loginUtil.logout();
            }
        }
Example #3
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();
            }
        }
Example #4
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();
            }
        }
Example #5
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();
            }
        }