Reputation: 6596
I have started learning amazon web services with simple workflow service. I have completed the eclipse setup for development and successfully completed the hello world workflow application from here.
For using the same application on web platform, I tried creating AWS web project and calling the workflow methods from servlet. The servlet runs without any error and output is printed to console. If I want the workflow to return the string message which is printed on console, what changes are needed?
Upvotes: 2
Views: 1424
Reputation: 3250
The step that you need to do to return a value from a workflow are:
Below is an example of all of those changes applied to the HelloWorld example provided by AWS. The HelloWorld example below returns a value from the workflow and prints the value in the client.
https://github.com/aquesnel/aws-sdk-java/commit/87a80b5946f02283faecaa7436828ecd1c43921c
Upvotes: 2
Reputation: 1946
Same question posted at amazon aws forums . Their is no clear documentation on AWS Simple Workflow Framework. You can check here
AWS Workflow executes Asynchronously so that why generated code return type is void. IF you want then you can get by using
GetWorkflowExecutionHistoryRequest historyRequest = new GetWorkflowExecutionHistoryRequest();
historyRequest.setDomain(domain);
historyRequest.setExecution(workflowExecution);
historyRequest.setReverseOrder(true);
History workflowExecutionHistory = service.getWorkflowExecutionHistory(historyRequest);
If you want result then Just create a thread and when result populates in method you will get data . But this is not good way to run thread continuously.
Upvotes: 2
Reputation: 6870
What is your use case? Workflow returning a value is usually a bad idea (unless it is a child workflow) as workflow is asynchronous and long running. Console application that started it should be able to exit without affecting workflow execution.
Upvotes: -1