viernes, 17 de mayo de 2024

[JD Edwards] Orchestrator Manipulate Output - Remove node by key (ENG)

Hola JDEFriends,

In this occassion, I'm going to show you how to manipulate the output json of your orchestrator. Well because we want to add or remove some element of it, group, change tags, etc. that we have not been able to do in the orchestration itself.

The first one we should to do is execute our orchestrator and see our json output. Next, we're go to output properties and on the tab "Manipulate output":


Here, we have our json as input and output. In the middle, we can to do custom manipulations in groovy, jruby, etc. script language acoording to your version and preference.

In my case, I want was to remove some json nodes based on an input parameter (in this case, in the exection of the availability application P41202).

Here the code:

availability_grid.reject! do |item|

        if jsonIn['GetTotals'] != "1"
            item['Location'] == 'TOTAL:' || item['Location'] == 'GRAND TOTAL:'
        end
    end

And here, you can do everything you can image and/or need.

You will have to run your orchestrator trial and error, off course, since until now, we have no way to debug or test it individually.

Happy code!

No hay comentarios:

Publicar un comentario