public virtual void execute(PvmExecutionImpl execution) { ExecutionStartContext executionStartContext = execution.ExecutionStartContext; InstantiationStack instantiationStack = executionStartContext.InstantiationStack; IList <PvmActivity> activityStack = instantiationStack.Activities; PvmActivity currentActivity = activityStack.RemoveAt(0); PvmExecutionImpl propagatingExecution = execution; if (currentActivity.Scope) { propagatingExecution = execution.createExecution(); execution.Active = false; propagatingExecution.setActivity(currentActivity); propagatingExecution.initialize(); } else { propagatingExecution.setActivity(currentActivity); } // notify listeners for the instantiated activity propagatingExecution.performOperation(operationOnScopeInitialization); }
protected internal override void eventNotificationsCompleted(PvmExecutionImpl execution) { base.eventNotificationsCompleted(execution); execution.activityInstanceStarted(); ExecutionStartContext startContext = execution.ExecutionStartContext; InstantiationStack instantiationStack = startContext.InstantiationStack; PvmExecutionImpl propagatingExecution = execution; ActivityImpl activity = execution.getActivity(); if (activity.ActivityBehavior is ModificationObserverBehavior) { ModificationObserverBehavior behavior = (ModificationObserverBehavior)activity.ActivityBehavior; IList <ActivityExecution> concurrentExecutions = behavior.initializeScope(propagatingExecution, 1); propagatingExecution = (PvmExecutionImpl)concurrentExecutions[0]; } // if the stack has been instantiated if (instantiationStack.Activities.Count == 0 && instantiationStack.TargetActivity != null) { // as if we are entering the target activity instance id via a transition propagatingExecution.ActivityInstanceId = null; // execute the target activity with this execution startContext.applyVariables(propagatingExecution); propagatingExecution.setActivity(instantiationStack.TargetActivity); propagatingExecution.performOperation(PvmAtomicOperation_Fields.ACTIVITY_START_CREATE_SCOPE); } else if (instantiationStack.Activities.Count == 0 && instantiationStack.TargetTransition != null) { // as if we are entering the target activity instance id via a transition propagatingExecution.ActivityInstanceId = null; // execute the target transition with this execution PvmTransition transition = instantiationStack.TargetTransition; startContext.applyVariables(propagatingExecution); propagatingExecution.setActivity(transition.Source); propagatingExecution.setTransition((TransitionImpl)transition); propagatingExecution.performOperation(PvmAtomicOperation_Fields.TRANSITION_START_NOTIFY_LISTENER_TAKE); } else { // else instantiate the activity stack further propagatingExecution.setActivity(null); propagatingExecution.performOperation(PvmAtomicOperation_Fields.ACTIVITY_INIT_STACK); } }
public Void callback(PvmExecutionImpl execution) { ProcessInstanceStartContext processInstanceStartContext = execution.ProcessInstanceStartContext; InstantiationStack instantiationStack = processInstanceStartContext.InstantiationStack; if (instantiationStack.Activities.Count == 0) { execution.setActivity(instantiationStack.TargetActivity); execution.performOperation(PvmAtomicOperation_Fields.ACTIVITY_START_CREATE_SCOPE); } else { // initialize the activity instance id execution.ActivityInstanceId = execution.Id; execution.performOperation(PvmAtomicOperation_Fields.ACTIVITY_INIT_STACK); } return(null); }
protected internal override void eventNotificationsCompleted(PvmExecutionImpl execution) { base.eventNotificationsCompleted(execution); ExecutionStartContext startContext = execution.ExecutionStartContext; InstantiationStack instantiationStack = startContext.InstantiationStack; // if the stack has been instantiated if (instantiationStack.Activities.Count == 0) { // done return; } else { // else instantiate the activity stack further execution.setActivity(null); execution.performOperation(PvmAtomicOperation_Fields.ACTIVITY_INIT_STACK_AND_RETURN); } }