Example #1
0
        public virtual void OnParseMigratingInstance(MigratingInstanceParseContext parseContext,
                                                     MigratingActivityInstance migratingInstance)
        {
            var execution = migratingInstance.ResolveRepresentativeExecution();

            foreach (ExternalTaskEntity task in execution.ExternalTasks)
            {
                var migratingTask = new MigratingExternalTaskInstance(task, migratingInstance);
                migratingInstance.AddMigratingDependentInstance(migratingTask);
                parseContext.Consume(task);
                parseContext.Submit(migratingTask);
            }
        }
Example #2
0
        public virtual void OnParseMigratingInstance(MigratingInstanceParseContext parseContext, MigratingActivityInstance migratingInstance)
        {
            ActivityImpl callActivity = (ActivityImpl)migratingInstance.SourceScope;

            // A call activity is typically scope and since we guarantee stability of scope executions during migration,
            // the superExecution link does not have to be maintained during migration.
            // There are some exceptions, though: A multi-instance call activity is not scope and therefore
            // does not have a dedicated scope execution. In this case, the link to the super execution
            // must be maintained throughout migration
            if (!callActivity.IsScope)
            {
                ExecutionEntity callActivityExecution = migratingInstance.ResolveRepresentativeExecution();
                ExecutionEntity calledProcessInstance = callActivityExecution.SubProcessInstance as ExecutionEntity;
                migratingInstance.AddMigratingDependentInstance(new MigratingCalledProcessInstance(calledProcessInstance));
            }
        }
Example #3
0
        public virtual void onParseMigratingInstance(MigratingInstanceParseContext parseContext, MigratingActivityInstance migratingInstance)
        {
            ExecutionEntity scopeExecution = migratingInstance.resolveRepresentativeExecution();

            IList <ActivityExecution> concurrentInActiveExecutions = scopeExecution.findInactiveChildExecutions(getInnerActivity((ActivityImpl)migratingInstance.SourceScope));

            // variables on ended inner instance executions need not be migrated anywhere
            // since they are also not represented in the tree of migrating instances, we remove
            // them from the parse context here to avoid a validation exception
            foreach (ActivityExecution execution in concurrentInActiveExecutions)
            {
                foreach (VariableInstanceEntity variable in ((ExecutionEntity)execution).VariablesInternal)
                {
                    parseContext.consume(variable);
                }
            }
        }
Example #4
0
        public virtual void onParseMigratingInstance(MigratingInstanceParseContext parseContext, MigratingActivityInstance migratingInstance)
        {
            ExecutionEntity execution = migratingInstance.resolveRepresentativeExecution();

            foreach (TaskEntity task in execution.Tasks)
            {
                migratingInstance.addMigratingDependentInstance(new MigratingUserTaskInstance(task, migratingInstance));
                parseContext.consume(task);

                ICollection <VariableInstanceEntity> variables = task.VariablesInternal;

                if (variables != null)
                {
                    foreach (VariableInstanceEntity variable in variables)
                    {
                        // we don't need to represent task variables in the migrating instance structure because
                        // they are migrated by the MigratingTaskInstance as well
                        parseContext.consume(variable);
                    }
                }
            }
        }