Looking for some suggestions or alternatives.
I'm currently at a client assisting them with migrating their internally built process engine over to Orchestration. They are taking small steps, and migrating small modules at a time, instead of a fork-lift implementation. In the meantime, this process engine needs to call Orchestration using the external API (REST) to execute a specific module. If everything works well, they are satisfied with a 200-OK response. If there is an error or other processing failure (such as bad data passed), the client is looking to get some message back to the process engine to indicate the failure.
Is there a good way to do this?
At this time, the only solution I can think of is:
- Start the session and pass data
- In the SCXML, Regardless of the branch taken, update a variable with the result - a result code, message, etc
- In the SCXML, enter an SCXML state block to pause execution with specific transitions built (such as "Success" and "Failure")
- From the original calling process, send a RESTful query and examine the message/result code to see the status
- Based on the status, send to Orchestration an event to allow it to transition off the SCXML state.
I can see this possibly encountering timing issues, so looking for suggestions.
I know there is also the Request option for the external interface, but I can't find any examples illustrating it's use.
http://<server:port>/scxml/session/<session id>/request/<name>