AWS-SWF: ExternalWorkflowStarter

When writing a distributed AWS-SWF app; you may want to have a separate module just for starting a workflow.

AWS guide suggests the following:

MyWorkflowClientExternalFactory factory = new MyWorkflowClientExternalFactoryImpl();
MyWorkflowClientExternal client = factory.getClient();
client.start();

Since my settings are somewhat different (I am using Spring); it results in the following error (source code of the seed app on which this is based is on github):

Problem

java.lang.IllegalStateException: The required property genericClient is null. It could be caused by instantiating the factory through the default constructor instead of the one that takes service and domain arguments.

Solution

Just as a well designed error message have suggested; the problem was with using the wrong factory instantiating method.  Fixed this by adding the following:

    @Inject
    AmazonSimpleWorkflow workflow;

    @Inject
    String domain;

...

        AIConductorWorkflowClientExternalFactory factory = new AIConductorWorkflowClientExternalFactoryImpl(workflow, domain);

 

 

keywords: external workflow starter externalworkflowstarter aws simple work flow workflow

About Neil Rubens

see http://ActiveIntelligence.org
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*