Beispiel #1
0
        /// <summary>
        ///     Cancels an execution which is both concurrent and scope. This can only happen if
        ///     (a) the process instance has been migrated from a previous version to a new version of the process engine
        ///     See: javadoc of this class for note about concurrent scopes.
        /// </summary>
        /// <param name="execution"> the concurrent scope execution to destroy </param>
        /// <param name="cancellingActivity">
        ///     the activity that cancels the execution; it must hold that
        ///     cancellingActivity's event scope is the scope the execution is responsible for
        /// </param>
        public static void CancelConcurrentScope(IActivityExecution execution, IPvmActivity cancelledScopeActivity)
        {
            EnsureConcurrentScope(execution);
            Log.DebugCancelConcurrentScopeExecution(execution);

            execution.Interrupt("Scope " + cancelledScopeActivity + " cancelled.");
            // <!> HACK set to event scope activity and leave activity instance
            execution.Activity = (ActivityImpl)(cancelledScopeActivity);
            execution.LeaveActivityInstance();
            execution.Interrupt("Scope " + cancelledScopeActivity + " cancelled.");
            execution.Destroy();
        }