Exemple #1
0
        private void fork(XmlElement forkElement, ForkImpl forkImpl, ProcessBlockImpl currentProcessBlock)
        {
            this.node(forkElement, forkImpl, currentProcessBlock);

            if ((Object)forkElement.GetAttribute("handler") != null)
            {
                forkImpl.ForkDelegation = new DelegationImpl();
                this.delegation <ForkImpl>(forkElement, forkImpl.ForkDelegation);
            }
        }
Exemple #2
0
        private void concurrentBlock(XmlElement concurrentElement, ConcurrentBlockImpl concurrentBlock, ProcessBlockImpl currentProcessBlock)
        {
            concurrentBlock.ProcessDefinition = ProcessDefinition;
            this.processBlock(concurrentElement, concurrentBlock);

            JoinImpl joinImpl = concurrentBlock.CreateJoin();
            ForkImpl forkImpl = concurrentBlock.CreateFork();

            XmlElement joinElement = concurrentElement.GetChildElement("join");

            this.join(joinElement, joinImpl, concurrentBlock);
            XmlElement forkElement = concurrentElement.GetChildElement("fork");

            this.fork(forkElement, forkImpl, concurrentBlock);

            this.addReferencableObject(joinImpl.Name, currentProcessBlock, typeof(INode), joinImpl);
            this.addReferencableObject(forkImpl.Name, currentProcessBlock, typeof(INode), forkImpl);
        }
Exemple #3
0
        public void ProcessFork(ForkImpl fork, FlowImpl flow, DbSession dbSession)
        {
            // First initialize the children of the flow to be forked
            flow.Children = new ListSet();

            DelegationImpl     delegation  = fork.ForkDelegation;
            IList <ForkedFlow> forkedFlows = new List <ForkedFlow>();

            if (delegation != null)
            {
                //delegationHelper.DelegateFork(fork.ForkDelegation, executionContext);
            }
            else
            {
                // execute the default fork behaviour
                IEnumerator iter = fork.LeavingTransitions.GetEnumerator();
                while (iter.MoveNext())
                {
                    TransitionImpl transition = (TransitionImpl)iter.Current;
                    forkedFlows.Add(this.ForkFlow(transition, flow, null));
                }
            }


            IEnumerator iter2 = forkedFlows.GetEnumerator();

            while (iter2.MoveNext())
            {
                ForkedFlow forkedFlow = (ForkedFlow)iter2.Current;
            }

            // loop over all flows that were forked in the ForkHandler implementation
            iter2 = forkedFlows.GetEnumerator();
            while (iter2.MoveNext())
            {
                ForkedFlow forkedFlow = (ForkedFlow)iter2.Current;

                ProcessTransition(forkedFlow.Transition, forkedFlow.Flow, dbSession);
            }
        }
Exemple #4
0
        public void ProcessFork(ForkImpl fork, ExecutionContextImpl executionContext, DbSession dbSession)
        {
            log.Debug("forking flow " + executionContext.GetFlow());

            // First initialize the children of the flow to be forked
            FlowImpl flow = (FlowImpl)executionContext.GetFlow();

            flow.Children = new ListSet();

            // Then initialise the forked flows in the execution context
            executionContext.ForkedFlows = new ArrayList();

            DelegationImpl delegation = fork.ForkDelegation;

            if (delegation != null)
            {
                delegationHelper.DelegateFork(fork.ForkDelegation, executionContext);
            }
            else
            {
                // execute the default fork behaviour
                IEnumerator iter = fork.LeavingTransitions.GetEnumerator();
                while (iter.MoveNext())
                {
                    TransitionImpl transition = (TransitionImpl)iter.Current;
                    executionContext.ForkFlow(transition, null);
                }
            }

            // create the fork event & remember the parent flow
            FlowImpl parentFlow = (FlowImpl)executionContext.GetFlow();

            executionContext.CreateLog(EventType.FORK);

            // log the event
            executionContext.SetFlow(parentFlow);
            IList       forkedFlows = executionContext.ForkedFlows;
            IEnumerator iter2       = forkedFlows.GetEnumerator();

            while (iter2.MoveNext())
            {
                ForkedFlow forkedFlow = (ForkedFlow)iter2.Current;
                log.Debug("adding object reference [" + forkedFlow.Flow + "] to flow [" + parentFlow + "]");
                executionContext.AddLogDetail(new ObjectReferenceImpl(forkedFlow.Flow));
            }

            // loop over all flows that were forked in the ForkHandler implementation
            iter2 = forkedFlows.GetEnumerator();
            while (iter2.MoveNext())
            {
                ForkedFlow forkedFlow = (ForkedFlow)iter2.Current;

                // trigger actions, scheduled after the creation and setting of the attributeValues
                // but before the fork is being processed
                delegationService.RunActionsForEvent(EventType.FORK, fork.Id, executionContext, dbSession);

                // then process the forked flow transition
                executionContext.SetFlow(forkedFlow.Flow);
                ProcessTransition(forkedFlow.Transition, executionContext, dbSession);
            }
        }