Web service actions

Each individual FSM action should be short-running so as not to block the flow coordinator processing thread. If a web service is hosted locally, and is known to be short-running, it can be called directly from within an action subflow. However, it is more likely that FSM actions should not call a web service directly. Instead, create a call a web service flow, which receives requests to call a web service from a queue and places the web service response on another queue. The following figure shows the call a web service flow.

Therefore, if it is required to call a web service as part of an FSM action, the action should put the web service request onto the call a web service queue and there should be an extra state, Awaiting Web Service Response, added.

When the call a web service flow receives a response, it should raise an event so that the appropriate transition occurs on the FSM to move the object to the next state.

Figure 1. Call a web service flow
CallWebServiceflow.jpg

However, if it is certain that the web service call will be executed quickly, the HTTP request node may be put directly into the action subflow itself.