예제 #1
0
        public void ProcessEndState(EndStateImpl endState, ExecutionContextImpl executionContext, DbSession dbSession)
        {
            delegationService.RunActionsForEvent(EventType.PROCESS_INSTANCE_END, endState.ProcessDefinition.Id, executionContext, dbSession);
            executionContext.CreateLog(EventType.PROCESS_INSTANCE_END);

            FlowImpl rootFlow = (FlowImpl)executionContext.GetFlow();

            rootFlow.ActorId = null;
            rootFlow.End     = DateTime.Now;
            rootFlow.Node    = endState;          // setting the node is not necessary if this method is called
            // from processTransition, but it is necessary if this method is
            // called from cancelProcessInstance in the component-impl.

            ProcessInstanceImpl processInstance  = (ProcessInstanceImpl)executionContext.GetProcessInstance();
            FlowImpl            superProcessFlow = (FlowImpl)processInstance.SuperProcessFlow;

            if (superProcessFlow != null)
            {
                log.Debug("reactivating the super process...");

                // create the execution context for the parent-process
                ExecutionContextImpl superExecutionContext = new ExecutionContextImpl(executionContext.PreviousActorId, superProcessFlow, executionContext.DbSession, executionContext.GetOrganisationComponent());
                superExecutionContext.SetInvokedProcessContext(executionContext);

                // delegate the attributeValues
                ProcessStateImpl processState    = (ProcessStateImpl)superProcessFlow.Node;
                Object[]         completionData  = delegationHelper.DelegateProcessTermination(processState.ProcessInvokerDelegation, superExecutionContext);
                IDictionary      attributeValues = (IDictionary)completionData[0];
                String           transitionName  = (String)completionData[1];
                TransitionImpl   transition      = transitionRepository.GetTransition(transitionName, processState, executionContext.DbSession);

                // process the super process transition
                ProcessTransition(transition, superExecutionContext, dbSession);
            }
        }
예제 #2
0
        public void ProcessEndState(EndStateImpl endState, ExecutionContextImpl executionContext,DbSession dbSession)
        {
            delegationService.RunActionsForEvent(EventType.PROCESS_INSTANCE_END, endState.ProcessDefinition.Id, executionContext,dbSession);
            executionContext.CreateLog(EventType.PROCESS_INSTANCE_END);

            FlowImpl rootFlow = (FlowImpl) executionContext.GetFlow();
            rootFlow.ActorId = null;
            rootFlow.End = DateTime.Now;
            rootFlow.Node = endState; // setting the node is not necessary if this method is called
            // from processTransition, but it is necessary if this method is
            // called from cancelProcessInstance in the component-impl.

            ProcessInstanceImpl processInstance = (ProcessInstanceImpl) executionContext.GetProcessInstance();
            FlowImpl superProcessFlow = (FlowImpl) processInstance.SuperProcessFlow;
            if (superProcessFlow != null)
            {
                log.Debug("reactivating the super process...");

                // create the execution context for the parent-process
                ExecutionContextImpl superExecutionContext = new ExecutionContextImpl(executionContext.PreviousActorId, superProcessFlow, executionContext.DbSession, executionContext.GetOrganisationComponent());
                superExecutionContext.SetInvokedProcessContext(executionContext);

                // delegate the attributeValues
                ProcessStateImpl processState = (ProcessStateImpl) superProcessFlow.Node;
                Object[] completionData = delegationHelper.DelegateProcessTermination(processState.ProcessInvokerDelegation, superExecutionContext);
                IDictionary attributeValues = (IDictionary) completionData[0];
                String transitionName = (String) completionData[1];
                TransitionImpl transition = transitionRepository.GetTransition(transitionName, processState, executionContext.DbSession);

                // process the super process transition
                ProcessTransition(transition, superExecutionContext,dbSession);
            }
        }