Available as of Camel 2.13
The Simple Workflow component supports managing workflows from Amazon's Simple Workflow service.
![]() | Note |
|---|---|
You must have a valid Amazon Web Services developer account, and be signed up to use Amazon Simple Workflow. More information are available at Amazon Simple Workflow. |
aws-swf://<workflow|activity>[?options]
You can append query options to the URI in the following format, ?options=value&option2=value&...
Name |
Default Value |
Context |
Description |
|---|---|---|---|
|
|
All | A reference to a com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient in the Registry. |
|
|
All |
Amazon AWS Access Key. |
|
|
All |
Amazon AWS Secret Key. |
|
|
All |
Properties to set on AmazonSimpleWorkflowClient in use. |
|
|
All |
Properties to set on ClientConfiguration in use. |
|
|
Workflow/Producer |
Properties to set on useStartWorkflowOptions in use. |
|
START |
Workflow/Producer |
The operation to perform on the workflow. Supported operations are: |
|
null |
All |
The workflow domain to use. |
|
null |
Activity/Consumer |
The list name to consume activities from. |
workflowList |
null |
Workflow/Consumer |
The list name to consume workflows from. |
eventName |
null |
All | The workflow or activity event name to use. |
version |
null |
All | The workflow or activity event version to use. |
signalName |
null |
Workflow/Producer | The name of the signal to send to the workflow. |
childPolicy |
null |
Workflow/Producer | The policy to use on child workflows when terminating a workflow. |
terminationReason |
null |
Workflow/Producer | The reason for terminating a workflow. |
stateResultType |
Object |
Workflow/Producer | The type of the result when a workflow state is queried. |
terminationDetails |
null |
Workflow/Producer | Details for terminating a workflow. |
dataConverter |
JsonDataConverter |
All | An instance of
com.amazonaws.services.simpleworkflow.flow.DataConverter to
use for serializing/deserializing the data. |
activitySchedulingOptions |
null |
Activity/Producer | An instance of
ActivitySchedulingOptions used to specify different timeout
options. |
activityTypeExecutionOptions |
null |
Activity/Consumer | An instance of
ActivityTypeExecutionOptions. |
activityTypeRegistrationOptions |
null |
Activity/Consumer | An instance of
ActivityTypeRegistrationOptions. |
workflowTypeRegistrationOptions |
null |
Workflow/Consumer | An instance of
WorkflowTypeRegistrationOptions. |
![]() | Note |
|---|---|
You have to provide the amazonSWClient in the Registry or your accessKey and secretKey to access the Amazon's Simple Workflow Service. |
A workflow producer allows interacting with a workflow. It can start a new workflow execution, query its state, send signals to a running workflow, or terminate and cancel it.
Header |
Type |
Description |
|---|---|---|
|
|
The operation to perform on the workflow. Supported operations are: SIGNAL, CANCEL, TERMINATE, GET_STATE, START, DESCRIBE, GET_HISTORY. |
|
|
A workflow ID to use. |
|
|
A worfklow run ID to use. |
|
|
The type of the result when a workflow state is queried. |
|
|
The workflow or activity event name to use. |
|
|
The workflow or activity event version to use. |
|
|
The reason for terminating a workflow. |
|
|
Details for terminating a workflow. |
|
|
The policy to use on child workflows when terminating a workflow. |
Header |
Type |
Description |
|---|---|---|
|
|
The worfklow ID used or newly generated. |
|
|
The worfklow run ID used or generated. |
A workflow consumer represents the workflow logic. When it is started, it will start polling workflow decision tasks and process them. In addition to processing decision tasks, a workflow consumer route, will also receive signals (send from a workflow producer) or state queries. The primary purpose of a workflow consumer is to schedule activity tasks for execution using activity producers. Actually activity tasks can be scheduled only from a thread started by a workflow consumer.
Header |
Type |
Description |
|---|---|---|
|
|
Indicates what type is the current event: CamelSWFActionExecute, CamelSWFSignalReceivedAction or CamelSWFGetStateAction. |
|
|
Indicates whether the current decision task is a replay or not. |
|
|
The time of the start event for this decision task. |
An activity producer allows scheduling activity tasks. An activity producer can be used only from a thread started by a workflow consumer ie, it can process synchronous exchanges started by a workflow consumer.
Header |
Type |
Description |
|---|---|---|
|
|
The activity name to schedule. |
|
|
The activity version to schedule. |
Header |
Type |
Description |
|---|---|---|
|
|
The task token that is required to report task completion for manually completed tasks. |
If you need more control over the AmazonSimpleWorkflowClient instance configuration you can create your own instance and refer to it from the URI:
The #client refers to a AmazonSimpleWorkflowClient in the Registry.
For example if your Camel Application is running behind a firewall:
AWSCredentials awsCredentials = new BasicAWSCredentials("myAccessKey", "mySecretKey");
ClientConfiguration clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost("http://myProxyHost");
clientConfiguration.setProxyPort(8080);
AmazonSimpleWorkflowClient client = new AmazonSimpleWorkflowClient(awsCredentials, clientConfiguration);
registry.bind("client", client);Maven users will need to add the following dependency to their pom.xml.
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-aws</artifactId>
<version>${camel-version}</version>
</dependency>where ${camel-version} must be replaced by the actual version of Camel (2.13
or higher).