Transformer Execution Order

If I have defined multiple transformers in a map step how is the execution order of these transformers determined? Is there anyway we can specify the execution order for the transformers?
For example: In the attached diagram the transformers under the map step are concat and addFloats. Is there any method by which I can make the addFloats to execute first everytime followed by the concat transformer?


the execution order is neither defined nor guaranteed.

You should always consider the execution being parallel (although it isn’t) and make sure the transformers produce distinct outputs.



1 Like

At run time there is no order of execution for transformers in a MAP step. The are executed simultaneously (at the same time)

If you want to execute in order try using invoke step and call the respective services.

1 Like

You could use two different map steps. :slight_smile:

Yes, there is.
You can modify the flow.xml manually to specify the order of transformer, Develop or Designer doesn’t support that.

Sorry, I tried but it won’t work. Please ignore what I said above.Even there is a parameter named INVOKE-ORDER but it won’t affect the order of transformer.

1 Like

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:

  1. 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:

  2. Else if there is an empty output maps defined, like the sample above, it would be ignored, service won’t be invoked.
  3. 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 (10.1 KB)

1 Like

Once again I would highly recommend not to rely on or expect a defined order in the execution of transformers inside a single map step. Even if you can find one, it may change with the next release. Relying on it may lead to unforeseen results. Most probably the resulting problem will be difficult to trace or even recognize.
If you need a defined execution order in transformers, use the proposal made by Ramakrishna, use different consecutive map steps.