public ItemsDatasetErrors GetErrors()
 {
     _errores.Clear();
     foreach (ITask _task in _clases)
     {
         _errores.AddAll(_task.GetErrors());
     }
     return(_errores);
 }
Beispiel #2
0
		public virtual bool IsValidForStartProcess()
		{
			_errores.Clear();
			WorkflowValidator validator = new WorkflowValidator();
			long IdTarea = Workflow.GetIdTakByName(_taskName);
			bool IsValid = validator.IsValidForStartProcess(this._processParent.Process.IdProcess,IdTarea, this);
			_errores.AddAll(validator.GetErrors());
			return IsValid;
		}
Beispiel #3
0
        public void StartProcess()
        {
            /*Primero Verificamos si Hay Validacioes q hacer antes de Iniciar el proceso*/
            bool IsValid = true;

            if (this._process.CheckValidOnStart)
            {
                ArrayList sortedTask = SortTasks(TaskStaticInfo.SortOrder.OrderBR);
                foreach (TaskDynamicInfo taskInfo in sortedTask)
                {
                    ITask _taskInstance = (ITask)taskInfo.TaskInstance;
                    IsValid = IsValid && _taskInstance.IsValidForStartProcess();
                }
            }
            if (IsValid)
            {
                _actualTaskIndex = -1;
                ITask firstTask = (ITask)this.NextTask();
                this._state = ProcessState.State.NextState;
                if (OnNextTask != null)
                {
                    OnNextTask(firstTask.GetTaskName());
                }
            }
            else
            {
                ArrayList          sortedTask = SortTasks(TaskStaticInfo.SortOrder.OrderBR);
                ItemsDatasetErrors errors     = new ItemsDatasetErrors();
                foreach (TaskDynamicInfo taskInfo in sortedTask)
                {
                    ITask _taskInstance = (ITask)taskInfo.TaskInstance;
                    errors.AddAll(_taskInstance.GetErrors());
                }
                if (OnProcessErrorsOnStart != null)
                {
                    OnProcessErrorsOnStart(errors);
                }
            }
        }