예제 #1
0
        protected internal virtual void ValidateSingleInstruction(IValidatingMigrationInstruction instruction,
                                                                  ValidatingMigrationInstructions instructions, MigrationInstructionValidationReportImpl report)
        {
            var targetActivity = instruction.TargetActivity;
            var instructionsToTargetGateway = instructions.GetInstructionsByTargetScope(targetActivity);

            if (instructionsToTargetGateway.Count > 1)
            {
                report.AddFailure("Only one gateway can be mapped to gateway '" + targetActivity.Id + "'");
            }
        }
        public virtual void Validate(IValidatingMigrationInstruction instruction,
                                     ValidatingMigrationInstructions instructions, MigrationInstructionValidationReportImpl report)
        {
            ActivityImpl targetActivity = (ActivityImpl)instruction.TargetActivity;

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

                if (instructions.GetInstructionsByTargetScope(innerActivity).Count == 0)
                {
                    report.AddFailure("Must map the inner activity of a multi-instance body when the body is mapped");
                }
            }
        }