Hi Rohit Jose,
I spend more time to do some research about your question, and get the information below, hope it helps.
webMethods will compile all the sub-nodes of a Map step, and put them into three queues:nonorder, order, deletes. When execute, execute nonorder queue one by one first, then sort order queue using a method called lazySort and execute them, finally the deletes queue got executed.
For a transformer it could be put into a nonorder or order queue or none of them, based on the rules below:
- If there is no output maps defined for this transformer, it would be put into nonorder queue. Usually it won’t happen. Output maps mean the element defined in flow.xml, Developer will generate an empty one for you like below:
- Else if there is an empty output maps defined, like the sample above, it would be ignored, service won’t be invoked.
- Else if there are output maps for this transformer, then for each output map, try to get the target absolute position, if pos is null then put this map(not transformer it self) into nonorder queue, else put this map into order queue. Usually pos is not null if you use Developer or Designer, it’s another topic and I won’t explain here.
Let’s consider all the transformers would be put into order queue, so we need to discuss about lazySort now.
LazySort is a little complex, but let’s simply understand it as execute transformer map to the closer to the top the sooner.
So since we already know everything behind it, we could find a way to control the transformer order now.
Generate some reserved fields in the pipeline out, and map the output of transformer to these fields.
I have uploaded my test package.
TestTransformerSort:transformer1 will log “It’s transformer 1” in server log
TestTransformerSort:transformer2 will log “It’s transformer 2” in server log
TestTransformerSort:service1 will invoke transformer1 then transformer2
TestTransformerSort:service2 will invoke transformer2 then transformer1
TestTransformerSort.zip (10.1 KB)
#Flow-and-Java-services#Integration-Server-and-ESB#webMethods