Beispiel #1
0
 protected internal virtual IList <JobEntity> collectActivityInstanceJobs(MigratingActivityInstance migratingInstance)
 {
     if (migratingInstance.SourceScope.Scope)
     {
         return(migratingInstance.resolveRepresentativeExecution().Jobs);
     }
     else
     {
         return(Collections.emptyList());
     }
 }
Beispiel #2
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);
                }
            }
        }
Beispiel #3
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);
                    }
                }
            }
        }
Beispiel #4
0
        protected internal virtual IList <VariableInstanceEntity> collectActivityInstanceVariables(MigratingActivityInstance instance)
        {
            IList <VariableInstanceEntity> variables = new List <VariableInstanceEntity>();
            ExecutionEntity representativeExecution  = instance.resolveRepresentativeExecution();
            ExecutionEntity parentExecution          = representativeExecution.Parent;

            // decide for representative execution and parent execution whether to none/all/concurrentLocal variables
            // belong to this activity instance
            bool addAllRepresentativeExecutionVariables = instance.SourceScope.Scope || representativeExecution.Concurrent;

            if (addAllRepresentativeExecutionVariables)
            {
                ((IList <VariableInstanceEntity>)variables).AddRange(representativeExecution.VariablesInternal);
            }
            else
            {
                ((IList <VariableInstanceEntity>)variables).AddRange(getConcurrentLocalVariables(representativeExecution));
            }

            bool addAnyParentExecutionVariables = parentExecution != null && instance.SourceScope.Scope;

            if (addAnyParentExecutionVariables)
            {
                bool addAllParentExecutionVariables = parentExecution.Concurrent;

                if (addAllParentExecutionVariables)
                {
                    ((IList <VariableInstanceEntity>)variables).AddRange(parentExecution.VariablesInternal);
                }
                else
                {
                    ((IList <VariableInstanceEntity>)variables).AddRange(getConcurrentLocalVariables(parentExecution));
                }
            }

            return(variables);
        }