To call a simple method we should have two object
- dispatach context object
- map context
we can get dispatch contex object by
GenericDispatcher dispatcher = (GenericDispatcher)request.getAttribute("dispatcher");
DispatchContext dctx = dispatcher.getDispatchContext();
In Java method/event, any service can be invoked by
GenericDispatcher dispatcher = (GenericDispatcher) request.getAttribute("dispatcher");
dispatcher.runSync("SERVICE_NAME", context);
context is map of required IN/IN-OUT parameters to service.This parameters cn be found in webtool > Service Engine > click on SERVICE_NAME
remember this
- runSync —which runs a service synchronously and returns the result
as a map.
- runSyncIgnore —which runs a service synchronously and ignores the result.Nothing is passed back.
- runAsync —which runs a service asynchronously. Again, nothing is passed back.