Ejemplo n.º 1
0
        internal Task(WorkflowName workflowId, TaskName name, IEnumerable<TaskName> parents, IEnumerable<TaskName> children, Payload payload, TaskType type, TaskPriority priority)
        {
            Workflow = workflowId;
            Name = name;
            Payload = payload;
            Type = type;
            Priority = priority;

            _parents = parents.ToArray();

            _children = children.ToArray();
        }
Ejemplo n.º 2
0
        public void AddTask(TaskName name, Payload payload, TaskType type, TaskPriority priority, IEnumerable<TaskName> parents, IEnumerable<TaskName> children)
        {
            if (!_defined.Add(name))
            {
                throw new WorkflowException(string.Format("Task '{0}' has already been declared.", name));
            }

            foreach (var parent in parents) _parents.Add(parent);

            foreach (var child in children) _children.Add(child);

            var task = new Task(Name, name, parents, children, payload, type, priority);

            _tasks.Add(task);
        }