public virtual void Validate(MigratingCompensationEventSubscriptionInstance migratingInstance,
                              MigratingProcessInstance migratingProcessInstance,
                              MigratingActivityInstanceValidationReportImpl ancestorInstanceReport)
 {
     // Compensation start event subscriptions are MigratingEventScopeInstances
     // because they reference an event scope execution
 }
        public virtual void Validate(MigratingActivityInstance migratingInstance,
                                     MigratingProcessInstance migratingProcessInstance,
                                     MigratingActivityInstanceValidationReportImpl instanceReport)
        {
            var sourceScope = migratingInstance.SourceScope;
            var targetScope = migratingInstance.TargetScope;

            if (migratingInstance.Migrates())
            {
                var becomesNonScope = sourceScope.IsScope && !targetScope.IsScope;
                if (becomesNonScope)
                {
                    var dependentVariablesByName = GetMigratingVariableInstancesByName(migratingInstance);
                    foreach (var variableName in dependentVariablesByName.Keys)
                    {
                        if (dependentVariablesByName[variableName].Count > 1)
                        {
                            instanceReport.AddFailure("The variable '" + variableName +
                                                      "' exists in both, this scope and " +
                                                      "concurrent local in the parent scope. " +
                                                      "Migrating to a non-scope activity would overwrite one of them.");
                        }
                    }
                }
            }
        }
 public virtual void Validate(MigratingActivityInstance migratingInstance,
                              MigratingProcessInstance migratingProcessInstance,
                              MigratingActivityInstanceValidationReportImpl instanceReport)
 {
     if (IsInvalid(migratingInstance))
     {
         instanceReport.AddFailure("There is no migration instruction for this instance's activity");
     }
 }
 public virtual void Validate(MigratingEventScopeInstance migratingInstance,
                              MigratingProcessInstance migratingProcessInstance,
                              MigratingActivityInstanceValidationReportImpl ancestorInstanceReport)
 {
     if (IsInvalid(migratingInstance))
     {
         ancestorInstanceReport.AddFailure("Cannot migrate subscription for compensation handler '" +
                                           migratingInstance.EventSubscription.SourceScope.Id + "'. " +
                                           "There is no migration instruction for the compensation start event");
     }
 }
        public virtual void Validate(MigratingEventScopeInstance migratingInstance,
                                     MigratingProcessInstance migratingProcessInstance,
                                     MigratingActivityInstanceValidationReportImpl ancestorInstanceReport)
        {
            var eventSubscription = migratingInstance.EventSubscription;

            var eventHandlerActivity = (ActivityImpl)eventSubscription.SourceScope;

            // note: compensation event scopes without children are already handled by NoUnmappedLeafInstanceValidator
            if (eventHandlerActivity.TriggeredByEvent && (eventSubscription.TargetScope == null) &&
                (migratingInstance.Children.Count > 0))
            {
                ancestorInstanceReport.AddFailure("Cannot migrate subscription for compensation handler '" +
                                                  eventSubscription.SourceScope.Id + "'. " +
                                                  "There is no migration instruction for the compensation start event");
            }
        }
        public virtual void Validate(MigratingActivityInstance migratingInstance,
                                     MigratingProcessInstance migratingProcessInstance,
                                     MigratingActivityInstanceValidationReportImpl instanceReport)
        {
            var sourceScope = migratingInstance.SourceScope;

            if (sourceScope != sourceScope.ProcessDefinition)
            {
                var sourceActivity = (ActivityImpl)migratingInstance.SourceScope;

                if (!SupportedActivityValidator.Instance.IsSupportedActivity(sourceActivity))
                {
                    instanceReport.AddFailure(
                        "The type of the source activity is not supported for activity instance migration");
                }
            }
        }