简体   繁体   中英

Amazon SWF Beginner- how to start execution of one workflow loop

I was looking through the samples available for Amazon SWF with Flow Framework (ie Java)-- in the samples I noticed that there is one class with a "main" that initiates workflow execution- there are also other similar classes with "main" that initiate workflow worker and activity worker (ie Workflow host and Activity Host).

Does this mean that to run a workflow, I have to put the execution code of all 3 classes into my void main? Ie do I have to initiate the workflow host, activity host and start the workflow myself? Or do I just have to define WorkFlow Host and Activity Host classes in specified format, and then just initiate the workflow using Workflow client factory?

There are three components in a SWF workflow - Worker, Activity and Client. Workflow host class initiates workflow workers, while activity host initiates activity workers. Workflow and Activity workers must always be up and running to work on the various workflow tasks. For this reason you have to include these classes in your void main .

Client (using workflow client factory) can make a request to start a workflow whenever it needs to.

Examples, for simplicity might have included all three classes in same main method, but ideally Client should be part of different application/main which can make call to start/end workflow whenever it wants, while activities and workers should run continuously.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM