Hi Diptendu, On Mon, Mar 11, 2019 at 2:06 AM Diptendu Dutta <dutta.dipte...@gmail.com> wrote: > > Is it possible to use the <send> tag to call a REST API?
Possible. > > How would one specify the various attributes such as method (GET/POST), > headers, body, etc.? You can pass any data in <send> to the target, and your EventDispatcher may interpret the data to invoke an external service. > > Is there any example code that I can consult? WizardsTest.java [1], to handle a custom type of send event used in wizard-02.xml [2], registers a custom EventDispatcher which can read type, target and data, and possibly invoke an external service. FWIW, this is beyond the question, but it might be interesting to implement a generic EventDispatcher to integrate with Apache Camel, simply dispatching to a specific route based on <send> attributes. e.g, type="camel" data="...", where data is passed to a Camel route as message body. Regards, Woonsan [1] https://github.com/apache/commons-scxml/blob/master/src/test/java/org/apache/commons/scxml2/WizardsTest.java#L62 [2] https://github.com/apache/commons-scxml/blob/master/src/test/java/org/apache/commons/scxml2/env/jexl/wizard-02.xml#L43 > > Regards, > > Diptendu Dutta --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org