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. Each of the decisions has one or more parameters, much like a regular API call. To allow for policies to be as readable as possible, you can express permissions on decisions as if they were actual API calls, including applying conditions to some parameters. For more information, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
Parameters:
-
task_token
(TaskToken)
–
The taskToken from the DecisionTask.
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
(Optional[DecisionList], default:
None
)
–
The list of decisions (possibly empty) made by the decider while processing this decision task. See the docs for the Decision structure for details.
-
execution_context
(Optional[Data], default:
None
)
–
User defined context to add to workflow execution.
-
task_list
(Optional[TaskList], default:
None
)
–
The task list to use for the future decision tasks of this workflow execution. This list overrides the original task list you specified while starting the workflow execution.
-
task_list_schedule_to_start_timeout
(Optional[DurationInSecondsOptional], default:
None
)
–
Specifies a timeout (in seconds) for the task list override. When this parameter is missing, the task list override is permanent. This parameter makes it possible to temporarily override the task list. If a decision task scheduled on the override task list is not started within the timeout, the decision task will time out. Amazon SWF will revert the override and schedule a new decision task to the original task list.
If a decision task scheduled on the override task list is started within the timeout, but not completed within the start-to-close timeout, Amazon SWF will also revert the override and schedule a new decision task to the original task list.
Raises:
-
OperationNotPermittedFault
–
Returned when the caller doesn't have sufficient permissions to invoke the action.
-
UnknownResourceFault
–
Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_swf/_services/swf.py
| def respond_decision_task_completed(
self,
task_token: "capo_swf.types.task_token.TaskToken",
*,
config_overrides: Optional[SWFClientConfig] = None,
decisions: Optional["capo_swf.types.decision_list.DecisionList"] = None,
execution_context: Optional["capo_swf.types.data.Data"] = None,
task_list: Optional["capo_swf.types.task_list.TaskList"] = None,
task_list_schedule_to_start_timeout: Optional[
"capo_swf.types.duration_in_seconds_optional.DurationInSecondsOptional"
] = None,
) -> None:
"""<p>Used by deciders to tell the service that the <a>DecisionTask</a> identified by the <code>taskToken</code> has successfully completed. The <code>decisions</code> argument specifies the list of decisions made while processing the task.</p> <p>A <code>DecisionTaskCompleted</code> event is added to the workflow history. The <code>executionContext</code> specified is attached to the event in the workflow execution history.</p> <p> <b>Access Control</b> </p> <p>If an IAM policy grants permission to use <code>RespondDecisionTaskCompleted</code>, it can express permissions for the list of decisions in the <code>decisions</code> parameter. Each of the decisions has one or more parameters, much like a regular API call. To allow for policies to be as readable as possible, you can express permissions on decisions as if they were actual API calls, including applying conditions to some parameters. For more information, see <a href="https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access to Amazon SWF Workflows</a> in the <i>Amazon SWF Developer Guide</i>.</p>
Args:
task_token: <p>The <code>taskToken</code> from the <a>DecisionTask</a>.</p> <important> <p> <code>taskToken</code> is generated by the service and should be treated as an opaque value. If the task is passed to another process, its <code>taskToken</code> must also be passed. This enables it to provide its progress and respond with results.</p> </important>
decisions: <p>The list of decisions (possibly empty) made by the decider while processing this decision task. See the docs for the <a>Decision</a> structure for details.</p>
execution_context: <p>User defined context to add to workflow execution.</p>
task_list: <p>The task list to use for the future decision tasks of this workflow execution. This list overrides the original task list you specified while starting the workflow execution. </p>
task_list_schedule_to_start_timeout: <p>Specifies a timeout (in seconds) for the task list override. When this parameter is missing, the task list override is permanent. This parameter makes it possible to temporarily override the task list. If a decision task scheduled on the override task list is not started within the timeout, the decision task will time out. Amazon SWF will revert the override and schedule a new decision task to the original task list.</p> <p>If a decision task scheduled on the override task list is started within the timeout, but not completed within the start-to-close timeout, Amazon SWF will also revert the override and schedule a new decision task to the original task list.</p>
Raises:
capo_swf.errors.operation_not_permitted_fault.OperationNotPermittedFault: <p>Returned when the caller doesn't have sufficient permissions to invoke the action.</p>
capo_swf.errors.unknown_resource_fault.UnknownResourceFault: <p>Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.</p>
capo_swf.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_swf.types.respond_decision_task_completed_input.RespondDecisionTaskCompletedInput]",
) -> OperationResponse[None]:
import capo_swf._operations.simple_workflow_service.respond_decision_task_completed
output, http_response = (
capo_swf._operations.simple_workflow_service.respond_decision_task_completed.respond_decision_task_completed(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("RespondDecisionTaskCompleted")
)
input_: capo_swf.types.respond_decision_task_completed_input.RespondDecisionTaskCompletedInput = {
"task_token": task_token
}
if decisions is not None:
input_["decisions"] = decisions
if execution_context is not None:
input_["execution_context"] = execution_context
if task_list is not None:
input_["task_list"] = task_list
if task_list_schedule_to_start_timeout is not None:
input_["task_list_schedule_to_start_timeout"] = (
task_list_schedule_to_start_timeout
)
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|