Some TX map rules way readily become complex. A typical example is that of an extraction of a piece of an input data item that is in turn passed through validation tests in order to invoke variant functional maps, themselves often featuring a bunch of arguments. We get a sequence of commas and brackets () that isquite difficult to track visually in order to know which argument goes with which function, especially if the data item references become also quite long as it happens with XML documents.
I was quite disappointed not to find in the Transformation Extender perspective a utility like the auto-indent or formatting facility (ctrl-shft-F) in Eclipse that format nicely your java code or C code or XML document, etc...
That has driven me to develop piece of java code to format a map rule. Then, I wrapped the formatter into an Eclipse plug in. At this stage, this is still a fairly brute plugin (it does not disappear when moving out from the Transformation Extender perspective, of better from a map editor tab), but it is already quite useful, and at a stage that calls for feedback in order to evolve.
Here are the details:
This Eclipse plug-in works both in Websphere Message Broker Toolkit and TX Studio. The plugin displays an an extra icon in the Eclipse menu bar. The plug-in uses indentation and argument counts to enhance the readability of map rules.
Tested with WTX 18.104.22.168 and Message Broker Toolkit 22.214.171.124.
Within theTransformation Extender perspective, edit a map and select a mapping rule in an output card, then click on the icon to format the rule. The format is best viewed by choosing a fixed spacing font for the rule editor (as set via Window > Preferences > Transformation Extender > Map > fonts > Rule Bar View ).
Simply copy the attached jar in the Eclipse plugin directory at stake.
- In the broker Toolkit, the directory is like: \Program Files\IBM\Websphere Broker\plugins
- in TX Studio, the directory is like: \Program Files\IBM\Websphere TX\DesignStudio\wtx_eclipse\eclipse\plugins
Your feedback is solicited.
Was I stupid and missing some readily available facility in TX that can format map rules?