/// <summary>
        /// Helper method to create a new child workflow decision.
        /// </summary>
        /// <param name="workflowContext">Workflow setup context.</param>
        /// <returns>Properly set up decision completed request.</returns>
        protected RespondDecisionTaskCompletedRequest StartChildWorkflowExecution(WorkflowSetupContext workflowContext)
        {
            var attributes = new StartChildWorkflowExecutionDecisionAttributes
            {
                WorkflowId   = workflowContext.WorkflowId,
                WorkflowType = new WorkflowType
                {
                    Name    = workflowContext.WorkflowName,
                    Version = workflowContext.WorkflowVersion
                },
                ChildPolicy = workflowContext.ChildPolicy,
                Control     = workflowContext.Control,
                ExecutionStartToCloseTimeout = workflowContext.ExecutionStartToCloseTimeout,
                Input    = workflowContext.Input,
                TagList  = workflowContext.TagList,
                TaskList = new TaskList
                {
                    Name = workflowContext.TaskList
                },
                TaskStartToCloseTimeout = workflowContext.TaskStartToCloseTimeout,
            };

            var decisionRequest = new RespondDecisionTaskCompletedRequest
            {
                Decisions = new List <Decision>
                {
                    new Decision
                    {
                        DecisionType = "StartChildWorkflowExecution",
                        StartChildWorkflowExecutionDecisionAttributes = attributes
                    }
                }
            };

            Debug.WriteLine(">>> Decision: StartChildWorkflowExecution" +
                            attributes.WorkflowType.Name + " (" + attributes.WorkflowType.Version + ")");
            return(decisionRequest);
        }
        /// <summary>
        /// Helper method to create a new child workflow decision. 
        /// </summary>
        /// <param name="workflowContext">Workflow setup context.</param>
        /// <returns>Properly set up decision completed request.</returns>
        protected RespondDecisionTaskCompletedRequest StartChildWorkflowExecution(WorkflowSetupContext workflowContext)
        {
            var attributes = new StartChildWorkflowExecutionDecisionAttributes
            {
                WorkflowId = workflowContext.WorkflowId,
                WorkflowType = new WorkflowType
                {
                    Name = workflowContext.WorkflowName,
                    Version = workflowContext.WorkflowVersion
                },
                ChildPolicy = workflowContext.ChildPolicy,
                Control = workflowContext.Control,
                ExecutionStartToCloseTimeout = workflowContext.ExecutionStartToCloseTimeout,
                Input = workflowContext.Input,
                TagList = workflowContext.TagList,
                TaskList = new TaskList
                    {
                        Name = workflowContext.TaskList
                    },
                TaskStartToCloseTimeout = workflowContext.TaskStartToCloseTimeout,
            };

            var decisionRequest = new RespondDecisionTaskCompletedRequest
            {
                Decisions = new List<Decision>
                    {
                        new Decision
                            {
                                DecisionType = "StartChildWorkflowExecution",
                                StartChildWorkflowExecutionDecisionAttributes = attributes
                            }
                    }
            };

            Debug.WriteLine(">>> Decision: StartChildWorkflowExecution" +
                attributes.WorkflowType.Name + " (" + attributes.WorkflowType.Version + ")");
            return decisionRequest;
        }