Beispiel #1
0
        public Workflow(WorkflowJobGroup wfGroup)
        {
            this.RootWorkflowJobGroup = wfGroup;

            GetAllJobs().ForEach(t =>
            {
                t.QueueJob.WorkflowId = this.WorkflowId;
            });
        }
Beispiel #2
0
        //public WorkflowJobGroup ContinueWithGroup(params WorkflowJob[] workflowJobs)
        //{
        //    foreach (var job in workflowJobs)
        //    {
        //        this.NextJobs.Add(job);
        //    }
        //    return new WorkflowJobGroup() { Jobs = workflowJobs.ToList() };
        //}

        public WorkflowJob ContinueWithGroup(WorkflowJobGroup workflowJobGroup)
        {
            foreach (var job in workflowJobGroup.Jobs)
            {
                if (this.TempId == job.TempId)
                {
                    throw new Exception("Job cannot continue with it self!");
                }
                this.NextJobs.Add(job);
            }
            return(this);
        }
Beispiel #3
0
 public Workflow(WorkflowJob rootWorkflowJob, WorkflowJobGroup rootWorkflowJobGroup)
 {
     if (rootWorkflowJob != null)
     {
         this.RootWorkflowJob = rootWorkflowJob;
     }
     else if (rootWorkflowJobGroup != null)
     {
         this.RootWorkflowJobGroup = rootWorkflowJobGroup;
     }
     else
     {
         throw new Exception("Root Workflow job or Workflow group not set!");
     }
     GetAllJobs().ForEach(t =>
     {
         t.QueueJob.WorkflowId = this.WorkflowId;
     });
 }