Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.

SWF Component

Available as of Camel 2.13

The Simple Workflow component supports managing workflows from Amazon's Simple Workflow service.

Prerequisites

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.

URI Format

aws-swf://<workflow|activity>[?options]

You can append query options to the URI in the following format, ?options=value&option2=value&...

URI Options

Name

Default Value

Context

Description

amazonSWClient

null

All

A reference to a com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient in the Registry.

accessKey

null

All

Amazon AWS Access Key.

secretKey

null

All

Amazon AWS Secret Key.

sWClient.XXX

null

All

Properties to set on AmazonSimpleWorkflowClient in use.

clientConfiguration.XXX

null

All

Properties to set on ClientConfiguration in use.

startWorkflowOptions.XXX

null

Workflow/Producer

Properties to set on useStartWorkflowOptions in use.

operation

START

Workflow/Producer

The operation to perform on the workflow. Supported operations are: SIGNAL, CANCEL, TERMINATE, GET_STATE, START, DESCRIBE, GET_HISTORY.

domainName

null

All

The workflow domain to use.

activityList

null

Activity/Consumer

The list name to consume activities from.

workflowListnull

Workflow/Consumer

The list name to consume workflows from.

eventNamenullAllThe workflow or activity event name to use.
versionnullAllThe workflow or activity event version to use.
signalNamenullWorkflow/ProducerThe name of the signal to send to the workflow.
childPolicynullWorkflow/ProducerThe policy to use on child workflows when terminating a workflow.
terminationReasonnullWorkflow/ProducerThe reason for terminating a workflow.
stateResultTypeObjectWorkflow/ProducerThe type of the result when a workflow state is queried.
terminationDetailsnullWorkflow/ProducerDetails for terminating a workflow.
dataConverterJsonDataConverterAllAn instance of com.amazonaws.services.simpleworkflow.flow.DataConverter to use for serializing/deserializing the data.
activitySchedulingOptionsnullActivity/ProducerAn instance of ActivitySchedulingOptions used to specify different timeout options.
activityTypeExecutionOptionsnullActivity/ConsumerAn instance of ActivityTypeExecutionOptions.
activityTypeRegistrationOptionsnullActivity/ConsumerAn instance of ActivityTypeRegistrationOptions.
workflowTypeRegistrationOptionsnullWorkflow/ConsumerAn instance of WorkflowTypeRegistrationOptions.

Required SWF component options

You have to provide the amazonSWClient in the Registry or your accessKey and secretKey to access the Amazon's Simple Workflow Service.

Usage

Message headers evaluated by the SWF Workflow Producer

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

CamelSWFOperation

String

The operation to perform on the workflow. Supported operations are:
SIGNAL, CANCEL, TERMINATE, GET_STATE, START, DESCRIBE, GET_HISTORY.

CamelSWFWorkflowId

String

A workflow ID to use.

CamelAwsDdbKeyCamelSWFRunId

String

A worfklow run ID to use.

CamelSWFStateResultType

String

The type of the result when a workflow state is queried.

CamelSWFEventName

String

The workflow or activity event name to use.

CamelSWFVersion

String

The workflow or activity event version to use.

CamelSWFReason

String

The reason for terminating a workflow.

CamelSWFDetails

String

Details for terminating a workflow.

CamelSWFChildPolicy

String

The policy to use on child workflows when terminating a workflow.

CamelSWFTags

List<String>Camel 2.18.0 : Tags associated with a workflow execution which can be used later to query/filter executions in SWF console

Message headers set by the SWF Workflow Producer

Header

Type

Description

CamelSWFWorkflowId

String

The worfklow ID used or newly generated.

CamelAwsDdbKeyCamelSWFRunId

String

The worfklow run ID used or generated.

Message headers set by the SWF Workflow Consumer

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

CamelSWFAction

String

Indicates what type is the current event: CamelSWFActionExecute, CamelSWFSignalReceivedAction or CamelSWFGetStateAction.

CamelSWFWorkflowReplaying

boolean

Indicates whether the current decision task is a replay or not.

CamelSWFWorkflowStartTime

long

The time of the start event for this decision task.

Message headers set by the SWF Activity Producer

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

CamelSWFEventName

{{String}

The activity name to schedule.

CamelSWFVersion

String

The activity version to schedule.

Message headers set by the SWF Activity Consumer

Header

Type

Description

CamelSWFTaskToken

String

The task token that is required to report task completion for manually completed tasks.

Advanced amazonSWClient configuration

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);

Dependencies

Maven users will need to add the following dependency to their pom.xml.

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).

AWS Component

© 2004-2015 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram