public virtual ForkImpl CreateFork()
		{
			ForkImpl fork = new ForkImpl(_processDefinition);
			this._fork = fork;
			this.AddNode(fork);
			return fork;
		}
Exemple #2
0
        public virtual ForkImpl CreateFork()
        {
            ForkImpl fork = new ForkImpl(_processDefinition);

            this._fork = fork;
            this.AddNode(fork);
            return(fork);
        }
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);
            }
        }
        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);
            }
        }