protected internal virtual IValidatingMigrationInstruction GetClosestPreservedAncestorScopeMigrationInstruction(
            IValidatingMigrationInstruction instruction, ValidatingMigrationInstructions instructions)
        {
            var parent = instruction.SourceActivity.FlowScope;

            while ((parent != null) && (instructions.GetInstructionsBySourceScope(parent).Count == 0))
            {
                parent = parent.FlowScope;
            }

            if (parent != null)
            {
                return(instructions.GetInstructionsBySourceScope(parent)[0]);
            }
            return(null);
        }
Esempio n. 2
0
        public virtual void Validate(IValidatingMigrationInstruction instruction,
                                     ValidatingMigrationInstructions instructions, MigrationInstructionValidationReportImpl report)
        {
            IPvmScope sourceActivity = instruction.SourceActivity;
            var       instructionsForSourceActivity = instructions.GetInstructionsBySourceScope(sourceActivity);

            if (instructionsForSourceActivity.Count > 1)
            {
//addFailure(sourceActivity.Id, instructionsForSourceActivity, report);
            }
        }
        protected internal virtual void ValidateParentScopeMigrates(IValidatingMigrationInstruction instruction,
                                                                    ValidatingMigrationInstructions instructions, MigrationInstructionValidationReportImpl report)
        {
            var sourceActivity = instruction.SourceActivity;
            var flowScope      = sourceActivity.FlowScope;

            if (flowScope != flowScope.ProcessDefinition)
            {
                if (instructions.GetInstructionsBySourceScope(flowScope).Count == 0)
                {
                    report.AddFailure("The gateway's flow scope '" + flowScope.Id + "' must be mapped");
                }
            }
        }
Esempio n. 4
0
        public virtual void Validate(IValidatingMigrationInstruction instruction,
                                     ValidatingMigrationInstructions instructions, MigrationInstructionValidationReportImpl report)
        {
            ActivityImpl sourceActivity = (ActivityImpl)instruction.SourceActivity;

            if (IsMultiInstance(sourceActivity))
            {
                var innerActivity = GetInnerActivity(sourceActivity);

                if (instructions.GetInstructionsBySourceScope(innerActivity).Count == 0)
                {
                    report.AddFailure(
                        "Cannot remove the inner activity of a multi-instance body when the body is mapped");
                }
            }
        }
Esempio n. 5
0
 protected internal virtual IPvmScope FindMappedEventScope(ScopeImpl sourceEventScope,
                                                           IValidatingMigrationInstruction instruction, ValidatingMigrationInstructions instructions)
 {
     if (sourceEventScope != null)
     {
         if (sourceEventScope == sourceEventScope.ProcessDefinition)
         {
             return((ScopeImpl)instruction.TargetActivity.ProcessDefinition);
         }
         var eventScopeInstructions = instructions.GetInstructionsBySourceScope(sourceEventScope);
         if (eventScopeInstructions.Count > 0)
         {
             return(eventScopeInstructions[0].TargetActivity);
         }
     }
     return(null);
 }