Records a WorkflowExecutionSignaled
event in the workflow execution history and
creates a decision task for the workflow execution identified by the given domain, workflowId
and runId. The event is recorded with the specified user defined signalName and input (if
provided).
If a runId is not specified, then the WorkflowExecutionSignaled
event is recorded
in the history of the current open workflow with the matching workflowId in the domain.
If the specified workflow execution is not open, this method fails with
UnknownResource
.
Access Control
You can use IAM policies to control this action’s access to Amazon SWF resources as follows:
- Use a
Resource
element with the domain name to limit the action to only specified domains. - Use an
Action
element to allow or deny permission to call this action. - You cannot use an IAM policy to constrain this action’s parameters.
If the caller does not have sufficient permissions to invoke the action, or the parameter
values fall outside the specified constraints, the action fails by throwing
OperationNotPermitted
. For details and example IAM policies, see Using IAM to
Manage Access to Amazon SWF Workflows.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Signal and Cancel a Workflow Execution
Shows an example of signaling and canceling a workflow execution.
This sample uses anonymous functions, which are only available in PHP 5.3+. For PHP 5.2 users, you must used named functions instead of anonymous ones.
$swf = new AmazonSWF(); // Setup $timestamp = time(); $workflow_domain = 'my-domain' . $timestamp; $workflow_type_name = 'my-workflow-type'; $activity_type_name = 'my-activity-type'; //-----------------------------------------------------------------// // Signal the workflow with an event and new data echo '# Signaling the workflow with an event and new data...' . PHP_EOL; $signal = $swf->signal_workflow_execution(array( 'domain' => $workflow_domain, 'workflowId' => 'my-workflow-execution', 'runId' => $run_id, 'signalName' => 'my-test-signal', 'input' => 'data for my test signal' )); if ($signal->isOK()) { echo 'Successfully signaled the workflow with an event and new data.' . PHP_EOL; } else { echo 'Failed to signal the workflow an new event.' . PHP_EOL; } echo PHP_EOL; //-----------------------------------------------------------------// // Cancel a workflow execution echo '# Canceling the workflow execution...' . PHP_EOL; $cancel = $swf->request_cancel_workflow_execution(array( 'domain' => $workflow_domain, 'workflowId' => 'my-workflow-execution', 'runId' => $run_id )); if ($cancel->isOK()) { echo 'Successfully canceled the workflow.' . PHP_EOL; } else { echo 'Failed to cancel the workflow.' . PHP_EOL; } echo PHP_EOL;
Source
Method defined in services/swf.class.php | Toggle source view (6 lines) | View on GitHub