示例#1
0
        /// <summary>
        /// Adds a sub-workflow into the workflow definition
        /// </summary>
        /// <param name="workflow">Workflow to add</param>
        public IWorkflow <T> Do(IWorkflow <T> workflow)
        {
            Check.IsNotNull(workflow, "workflow");
            WorkflowBuilder.AddOperation(workflow);

            return(this);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="function"></param>
        /// <param name="branch"></param>
        /// <returns></returns>
        public IWorkflow <T> Do(Func <T, T> function, IDeclaredOperation branch)
        {
            Check.IsNotNull(function, "function");

            WorkflowBuilder.AddOperation(function, branch);
            return(this);
        }
示例#3
0
        /// <summary>
        /// Adds a function into the workflow definition
        /// </summary>
        /// <param name="function">Function to add</param>
        /// <param name="constraint">constraint defines if function will be executed</param>
        public IWorkflow <T> Do(Func <T, T> function, ICheckConstraint constraint)
        {
            Check.IsNotNull(function, "function");
            Check.IsNotNull(constraint, "constraint");

            WorkflowBuilder.AddOperation(function, constraint);
            return(this);
        }
示例#4
0
        /// <summary>
        /// Adds a function into the execution path
        /// </summary>
        /// <param name="function">The funciton to add</param>
        /// <param name="constraint">constraint that determines if the operation is executed</param>
        /// <param name="branchPoint"></param>
        public virtual IWorkflow <T> Do(Func <T, T> function, ICheckConstraint constraint, IDeclaredOperation branchPoint)
        {
            Check.IsNotNull(function, "function");
            Check.IsNotNull(constraint, "constraint");

            WorkflowBuilder.AddOperation(function, constraint, branchPoint);
            return(this);
        }
示例#5
0
        /// <summary>
        /// Adds a sub-workflow into the workflow definition
        /// </summary>
        /// <param name="workflow">Workflow to add</param>
        /// <param name="constraint">pre-condition for execution</param>
        public IWorkflow <T> Do(IWorkflow <T> workflow, ICheckConstraint constraint)
        {
            Check.IsNotNull(workflow, "workflow");
            Check.IsNotNull(constraint, "constraint");

            WorkflowBuilder.AddOperation(workflow, constraint);

            return(this);
        }
示例#6
0
        /// <summary>
        /// Adds an operation into the workflow definition
        /// </summary>
        /// <param name="operation">The operation to execute as a generic of IOperation</param>
        /// <remarks>Operations must inherit from the BasicOperation class</remarks>
        public virtual IWorkflow <T> Do(IOperation <T> operation)
        {
            Check.IsNotNull(operation, "operation");
            Check.IsInstanceOf <BasicOperation <T> >(operation, "operation");

            WorkflowBuilder.AddOperation(operation);

            return(this);
        }
示例#7
0
        /// <summary>
        /// Adds an operation into the workflow definition given the constraint.  The constraint runs if
        /// the constraint evaluates to true.
        /// </summary>
        /// <param name="operation">The operation to execute as a generic of IOperation</param>
        /// <param name="constraint">The constraint to evaluate</param>
        /// <remarks>Operations must inherit from the BasicOperation class</remarks>
        public virtual IWorkflow <T> Do(IOperation <T> operation, ICheckConstraint constraint)
        {
            Check.IsNotNull(operation, "operation");
            Check.IsNotNull(constraint, "constraint");
            Check.IsInstanceOf <BasicOperation <T> >(operation, "operation");

            WorkflowBuilder.AddOperation(operation, constraint);

            return(this);
        }
示例#8
0
        /// <summary>
        /// Registers an instance of the type specified in the workflow
        /// </summary>
        /// <typeparam name="TOperation">Type that inherits from BasicOperation of T</typeparam>
        /// <param name="constraint">The constraint to evaluate</param>
        public IWorkflow <T> Do <TOperation>(ICheckConstraint constraint) where TOperation : BasicOperation <T>
        {
            WorkflowBuilder.AddOperation <TOperation>(constraint);

            return(this);
        }
示例#9
0
        /// <summary>
        /// Registers an instance of the type specified in the workflow
        /// </summary>
        /// <typeparam name="TOperation">Type that inherits from BasicOperation of T</typeparam>
        public IWorkflow <T> Do <TOperation>() where TOperation : BasicOperation <T>
        {
            WorkflowBuilder.AddOperation <TOperation>();

            return(this);
        }