コード例 #1
0
ファイル: Task.cs プロジェクト: timbarrass/redis.workflow
        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();
        }
コード例 #2
0
ファイル: Workflow.cs プロジェクト: timbarrass/redis.workflow
        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);
        }