Provides details of the ScheduleActivityTask decision.

Access Control

You can use IAM policies to control this decision's access to Amazon SWF in much the same way as for the regular API:

  • Use a Resource element with the domain name to limit the decision to only specified domains.
  • Use an Action element to allow or deny permission to specify this decision.
  • Constrain the following parameters by using a Condition element with the appropriate keys.
    • activityType.name : String constraint. The key is “swf:activityType.name”.
    • activityType.version : String constraint. The key is “swf:activityType.version”.
    • taskList : String constraint. The key is “swf:taskList.name”.

If the caller does not have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's cause parameter will be set to OPERATION_NOT_PERMITTED. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows .

Example #1
0
 public Decision WithScheduleActivityTaskDecisionAttributes(ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes)
 {
     this.scheduleActivityTaskDecisionAttributes = scheduleActivityTaskDecisionAttributes;
     return this;
 }
Example #2
0
 /// <summary>
 /// Sets the ScheduleActivityTaskDecisionAttributes property
 /// </summary>
 /// <param name="scheduleActivityTaskDecisionAttributes">The value to set for the ScheduleActivityTaskDecisionAttributes property </param>
 /// <returns>this instance</returns>
 public Decision WithScheduleActivityTaskDecisionAttributes(ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes)
 {
     this.scheduleActivityTaskDecisionAttributes = scheduleActivityTaskDecisionAttributes;
     return(this);
 }
        /// <summary>
        /// Helper method to schedule an activity task
        /// </summary>
        /// <param name="activityContext">Activity setup context.</param>
        /// <returns>Properly set up decision completed request.</returns>
        protected RespondDecisionTaskCompletedRequest ScheduleActivityTask(WorkflowActivitySetupContext activityContext)
        {
            var attributes = new ScheduleActivityTaskDecisionAttributes
            {
                ActivityId = activityContext.ActivityId,
                ActivityType = new ActivityType
                {
                    Name = activityContext.ActivityName,
                    Version = activityContext.ActivityVersion
                },
                Control = activityContext.Control,
                HeartbeatTimeout = activityContext.HeartbeatTimeout,
                Input = activityContext.Input,
                ScheduleToCloseTimeout = activityContext.ScheduleToCloseTimeout,
                ScheduleToStartTimeout = activityContext.ScheduleToStartTimeout,
                StartToCloseTimeout = activityContext.StartToCloseTimeout,
                TaskList = new TaskList
                    {
                        Name = activityContext.TaskList
                    }
            };

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

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