Am trying to print the names of services invoked in a FlowService using a java program. Am able to print the names of services using below code:
import com.wm.app.b2b.server.InvokeState;
...
...
...
InvokeState invkState = InvokeState.getCurrentState();
//below line prints all service names which are invoked in a flow service
System.out.println(invkState.getCallStack());
However, when am using transformers and trying to invoke a custom service (which I created), the above code doesn’t print the services which are invoked via transformer. And if, I happened to use a pub service, then it displays service name but not in the case of custom service.
Yes, you were right. I tried mapping my output to the pipeline after which my code starting display service name which was invoked using transformer.
Really appreciate your answer. Thanks a ton.
But there comes another question. What if the service which am invoking via transformer does not have any output i.e. pub.file:readerToFile or pub.file:StringToFile are used in transformer which does not have any output in which case I cannot map these services output to Pipeline of the step.
Under these situations, how do I get my transformer service executed?
Transformers get executed via multi threads on the go, which will let me invoke multiple services at once. Using invoke for my project consumes more time and hence, I was in need of transformers.
But now, I realized that my transformer only works if its output is mapped with the Pipeline out.
However, as posted in one of my previous comments, was wondering if we can get to invoke services via transformer which does not return any output such as pub.file:StringToFile etc.
in this case you can create a wrapper flow service for “invoking” the service you want and provide an output as i.e. “success” being set in the wrapper service.
You can then call this service as a transformer by mapping the success output to your pipeline and drop it afterwards.
My custom services such as write to file, delete file and few other services have consumed less time when used these in transformers compared to the usage in flow service. And all these services input & output are independent of one another.
Considering your advice, am creating a wrapper flow service with an output and invoking my custom services via transformers.