Пример #1
0
        public virtual void Validate(MigratingTransitionInstance migratingInstance,
                                     MigratingProcessInstance migratingProcessInstance,
                                     MigratingTransitionInstanceValidationReportImpl instanceReport)
        {
            var targetActivity = (ActivityImpl)migratingInstance.TargetScope;

            if ((targetActivity != null) && migratingInstance.AsyncAfter)
            {
                var jobInstance = migratingInstance.JobInstance;
                //var config =
                //    (AsyncContinuationJobHandler.AsyncContinuationConfiguration)
                //        jobInstance.JobEntity.JobHandlerConfiguration;
                //var sourceTransitionId = config.TransitionId;

                if (targetActivity.OutgoingTransitions.Count > 1)
                {
                    //if (ReferenceEquals(sourceTransitionId, null))
                    //{
                    //    instanceReport.addFailure("Transition instance is assigned to no sequence flow" +
                    //                              " and target activity has more than one outgoing sequence flow");
                    //}
                    //else
                    //{
                    //    var matchingOutgoingTransition = targetActivity.findOutgoingTransition(sourceTransitionId);
                    //    if (matchingOutgoingTransition == null)
                    //    {
                    //        instanceReport.addFailure("Transition instance is assigned to a sequence flow" +
                    //                                  " that cannot be matched in the target activity");
                    //    }
                    //}
                }
            }
        }
 public virtual void Validate(MigratingTransitionInstance migratingInstance,
                              MigratingProcessInstance migratingProcessInstance,
                              MigratingTransitionInstanceValidationReportImpl instanceReport)
 {
     if (IsInvalid(migratingInstance))
     {
         instanceReport.AddFailure("There is no migration instruction for this instance's activity");
     }
 }
Пример #3
0
        public virtual void Validate(MigratingTransitionInstance migratingInstance,
                                     MigratingProcessInstance migratingProcessInstance,
                                     MigratingTransitionInstanceValidationReportImpl instanceReport)
        {
            var targetActivity = (ActivityImpl)migratingInstance.TargetScope;

            if (targetActivity != null)
            {
                if (IsProcessStartJob(migratingInstance.JobInstance.JobEntity) && !IsTopLevelActivity(targetActivity))
                {
                    instanceReport.AddFailure(
                        "A transition instance that instantiates the process can only be migrated to a process-level flow node");
                }
            }
        }
Пример #4
0
        public virtual void Validate(MigratingTransitionInstance migratingInstance,
                                     MigratingProcessInstance migratingProcessInstance,
                                     MigratingTransitionInstanceValidationReportImpl instanceReport)
        {
            var targetActivity = (ActivityImpl)migratingInstance.TargetScope;

            if (targetActivity != null)
            {
                if (migratingInstance.AsyncAfter)
                {
                    if (!targetActivity.AsyncAfter)
                    {
                        instanceReport.AddFailure("Target activity is not asyncAfter");
                    }
                }
                else
                {
                    if (!targetActivity.AsyncBefore)
                    {
                        instanceReport.AddFailure("Target activity is not asyncBefore");
                    }
                }
            }
        }