respond_decision_task_completed ( $opt )

Used by deciders to tell the service that the DecisionTask identified by the taskToken has successfully completed. The decisions argument specifies the list of decisions made while processing the task.

A DecisionTaskCompleted event is added to the workflow history. The executionContext specified is attached to the event in the workflow execution history.

Access Control

If an IAM policy grants permission to use RespondDecisionTaskCompleted, it can express permissions for the list of decisions in the decisions parameter in the same way as for the regular API. This approach maintains a uniform conceptual model and helps keep policies readable. For more information, see Using IAM to Manage Access to Amazon SWF Workflows.

Access

public

Parameters

Parameter

Type

Required

Description

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • taskToken - string - Required - The taskToken from the DecisionTask.

    The taskToken is generated by the service and should be treated as an opaque value. If the task is passed to another process, its taskToken must also be passed. This enables it to provide its progress and respond with results.

  • decisions - array - Optional - The list of decisions (possibly empty) made by the decider while processing this decision task. See the docs for the Decision structure for details.
    • x - array - Optional - This represents a simple array index.
      • decisionType - string - Required - Specifies the type of the decision. [Allowed values: ScheduleActivityTask, RequestCancelActivityTask, CompleteWorkflowExecution, FailWorkflowExecution, CancelWorkflowExecution, ContinueAsNewWorkflowExecution, RecordMarker, StartTimer, CancelTimer, SignalExternalWorkflowExecution, RequestCancelExternalWorkflowExecution, StartChildWorkflowExecution]
      • scheduleActivityTaskDecisionAttributes - array - Optional - Provides details of the ScheduleActivityTask decision. It is not set for other decision types.
        • activityType - array - Required - The type of the activity task to schedule. This field is required.
          • name - string - Required - The name of this activity.

            The combination of activity type name and version must be unique within a domain.

          • version - string - Required - The version of this activity.

            The combination of activity type name and version must be unique with in a domain.

        • activityId - string - Required - The activityId of the activity task. This field is required. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string “arn”.
        • control - string - Optional - Optional data attached to the event that can be used by the decider in subsequent workflow tasks. This data is not sent to the activity.
        • input - string - Optional - The input provided to the activity task.
        • scheduleToCloseTimeout - string - Optional - The maximum duration for this activity task. The valid values are integers greater than or equal to 0. An integer value can be used to specify the duration in seconds while NONE can be used to specify unlimited duration.

          A schedule-to-close timeout for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default schedule-to-close timeout was specified at registration time then a fault will be returned.

        • taskList - array - Optional - If set, specifies the name of the task list in which to schedule the activity task. If not specified, the defaultTaskList registered with the activity type will be used.

          A task list for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default task list was specified at registration time then a fault will be returned.

          The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string “arn”.
          • name - string - Required - The name of the task list.
        • scheduleToStartTimeout - string - Optional - If set, specifies the maximum duration the activity task can wait to be assigned to a worker. This overrides the default schedule-to-start timeout specified when registering the activity type using RegisterActivityType. The valid values are integers greater than or equal to 0. An integer value can be used to specify the duration in seconds while NONE can be used to specify unlimited duration.

          A schedule-to-start timeout for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default schedule-to-start timeout was specified at registration time then a fault will be returned.

        • startToCloseTimeout - string - Optional - If set, specifies the maximum duration a worker may take to process this activity task. This overrides the default start-to-close timeout specified when registering the activity type using RegisterActivityType. The valid values are integers greater than or equal to 0. An integer value can be used to specify the duration in seconds while NONE can be used to specify unlimited duration.

          A start-to-close timeout for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default start-to-close timeout was specified at registration time then a fault will be returned.

        • heartbeatTimeout - string - Optional - If set, specifies the maximum time before which a worker processing a task of this type must report progress by calling RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task is automatically timed out. If the worker subsequently attempts to record a heartbeat or returns a result, it will be ignored. This overrides the default heartbeat timeout specified when registering the activity type using RegisterActivityType. The valid values are integers greater than or equal to 0. An integer value can be used to specify the duration in seconds while NONE can be used to specify unlimited duration.
      • requestCancelActivityTaskDecisionAttributes - array - Optional - Provides details of the RequestCancelActivityTask decision. It is not set for other decision types.
        • activityId - string - Required - The activityId of the activity task to be canceled.
      • completeWorkflowExecutionDecisionAttributes - array - Optional - Provides details of the CompleteWorkflowExecution decision. It is not set for other decision types.
        • result - string - Optional - The result of the workflow execution. The form of the result is implementation defined.
      • failWorkflowExecutionDecisionAttributes - array - Optional - Provides details of the FailWorkflowExecution decision. It is not set for other decision types.
        • reason - string - Optional - A descriptive reason for the failure that may help in diagnostics.
        • details - string - Optional - Optional details of the failure.
      • cancelWorkflowExecutionDecisionAttributes - array - Optional - Provides details of the CancelWorkflowExecution decision. It is not set for other decision types.
        • details - string - Optional - Optional details of the cancellation.
      • continueAsNewWorkflowExecutionDecisionAttributes - array - Optional - Provides details of the ContinueAsNewWorkflowExecution decision. It is not set for other decision types.
        • input - string - Optional - The input provided to the new workflow execution.
        • executionStartToCloseTimeout - string - Optional - If set, specifies the total duration for this workflow execution. This overrides the defaultExecutionStartToCloseTimeout specified when registering the workflow type. The valid values are integers greater than or equal to 0. An integer value can be used to specify the duration in seconds while NONE can be used to specify unlimited duration.

          An execution start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this field. If neither this field is set nor a default execution start-to-close timeout was specified at registration time then a fault will be returned.

        • taskList - array - Optional - Represents a task list.
          • name - string - Required - The name of the task list.
        • taskStartToCloseTimeout - string - Optional - Specifies the maximum duration of decision tasks for the new workflow execution. This parameter overrides the defaultTaskStartToCloseTimout specified when registering the workflow type using RegisterWorkflowType. The valid values are integers greater than or equal to 0. An integer value can be used to specify the duration in seconds while NONE can be used to specify unlimited duration.

          A task start-to-close timeout for the new workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task start-to-close timeout was specified at registration time then a fault will be returned.

        • childPolicy - string - Optional - If set, specifies the policy to use for the child workflow executions of the new execution if it is terminated by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. This policy overrides the default child policy specified when registering the workflow type using RegisterWorkflowType. The supported child policies are:
          • TERMINATE: the child executions will be terminated.
          • REQUEST_CANCEL: a request to cancel will be attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.
          • ABANDON: no action will be taken. The child executions will continue to run.

          A child policy for the new workflow execution must be specified either as a default registered for its workflow type or through this field. If neither this field is set nor a default child policy was specified at registration time then a fault will be returned.

          [Allowed values: TERMINATE, REQUEST_CANCEL, ABANDON]
        • tagList - string|array - Optional - The list of tags to associate with the new workflow execution. A maximum of 5 tags can be specified. You can list workflow executions with a specific tag by calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and specifying a TagFilter. Pass a string for a single value, or an indexed array for multiple values.
        • workflowTypeVersion - string - Optional -
      • recordMarkerDecisionAttributes - array - Optional - Provides details of the RecordMarker decision. It is not set for other decision types.
        • markerName - string - Required - The name of the marker. This file is required.
        • details - string - Optional - Optional details of the marker.
      • startTimerDecisionAttributes - array - Optional - Provides details of the StartTimer decision. It is not set for other decision types.
        • timerId - string - Required - The unique Id of the timer. This field is required. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string “arn”.
        • control - string - Optional - Optional data attached to the event that can be used by the decider in subsequent workflow tasks.
        • startToFireTimeout - string - Required - The duration to wait before firing the timer. This field is required. The duration is specified in seconds. The valid values are integers greater than or equal to 0.
      • cancelTimerDecisionAttributes - array - Optional - Provides details of the CancelTimer decision. It is not set for other decision types.
        • timerId - string - Required - The unique Id of the timer to cancel. This field is required.
      • signalExternalWorkflowExecutionDecisionAttributes - array - Optional - Provides details of the SignalExternalWorkflowExecution decision. It is not set for other decision types.
        • workflowId - string - Required - The workflowId of the workflow execution to be signaled. This field is required.
        • runId - string - Optional - The runId of the workflow execution to be signaled.
        • signalName - string - Required - The name of the signal.The target workflow execution will use the signal name and input to process the signal. This field is required.
        • input - string - Optional - Optional input to be provided with the signal.The target workflow execution will use the signal name and input to process the signal.
        • control - string - Optional - Optional data attached to the event that can be used by the decider in subsequent decision tasks.
      • requestCancelExternalWorkflowExecutionDecisionAttributes - array - Optional - Provides details of the RequestCancelExternalWorkflowExecution decision. It is not set for other decision types.
        • workflowId - string - Required - The workflowId of the external workflow execution to cancel. This field is required.
        • runId - string - Optional - The runId of the external workflow execution to cancel.
        • control - string - Optional - Optional data attached to the event that can be used by the decider in subsequent workflow tasks.
      • startChildWorkflowExecutionDecisionAttributes - array - Optional - Provides details of the StartChildWorkflowExecution decision. It is not set for other decision types.
        • workflowType - array - Required - The type of the workflow execution to be started. This field is required.
          • name - string - Required - The name of the workflow type. This field is required.

            The combination of workflow type name and version must be unique with in a domain.

          • version - string - Required - The version of the workflow type. This field is required.

            The combination of workflow type name and version must be unique with in a domain.

        • workflowId - string - Required - The workflowId of the workflow execution. This field is required. The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string “arn”.
        • control - string - Optional - Optional data attached to the event that can be used by the decider in subsequent workflow tasks. This data is not sent to the child workflow execution.
        • input - string - Optional - The input to be provided to the workflow execution.
        • executionStartToCloseTimeout - string - Optional - The total duration for this workflow execution. This overrides the defaultExecutionStartToCloseTimeout specified when registering the workflow type. The valid values are integers greater than or equal to 0. An integer value can be used to specify the duration in seconds while NONE can be used to specify unlimited duration.

          An execution start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default execution start-to-close timeout was specified at registration time then a fault will be returned.

        • taskList - array - Optional - The name of the task list to be used for decision tasks of the child workflow execution.

          A task list for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task list was specified at registration time then a fault will be returned.

          The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string “arn”.
          • name - string - Required - The name of the task list.
        • taskStartToCloseTimeout - string - Optional - Specifies the maximum duration of decision tasks for this workflow execution. This parameter overrides the defaultTaskStartToCloseTimout specified when registering the workflow type using RegisterWorkflowType. The valid values are integers greater than or equal to 0. An integer value can be used to specify the duration in seconds while NONE can be used to specify unlimited duration.

          A task start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task start-to-close timeout was specified at registration time then a fault will be returned.

        • childPolicy - string - Optional - If set, specifies the policy to use for the child workflow executions if the workflow execution being started is terminated by calling the TerminateWorkflowExecution action explicitly or due to an expired timeout. This policy overrides the default child policy specified when registering the workflow type using RegisterWorkflowType. The supported child policies are:
          • TERMINATE: the child executions will be terminated.
          • REQUEST_CANCEL: a request to cancel will be attempted for each child execution by recording a WorkflowExecutionCancelRequested event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.
          • ABANDON: no action will be taken. The child executions will continue to run.

          A child policy for the workflow execution being started must be specified either as a default registered for its workflow type or through this field. If neither this field is set nor a default child policy was specified at registration time then a fault will be returned.

          [Allowed values: TERMINATE, REQUEST_CANCEL, ABANDON]
        • tagList - string|array - Optional - The list of tags to associate with the child workflow execution. A maximum of 5 tags can be specified. You can list workflow executions with a specific tag by calling ListOpenWorkflowExecutions or ListClosedWorkflowExecutions and specifying a TagFilter. Pass a string for a single value, or an indexed array for multiple values.
  • executionContext - string - Optional - User defined context to add to workflow execution.
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Source

Method defined in services/swf.class.php | Toggle source view (12 lines) | View on GitHub

public function respond_decision_task_completed($opt = null)
{
    if (!$opt) $opt = array();
    
    // List (non-map)
    if (isset($opt['decisions']))
    {
        $opt['decisions'] = (is_array($opt['decisions']) ? $opt['decisions'] : array($opt['decisions']));
    }

    return $this->authenticate('RespondDecisionTaskCompleted', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback