Question: How can I tell what is happening in my macro when it runs on the server?Sometimes, when working with Rational HATS macros, you need more information when debugging. When it runs on the server, you really don't see much in the SystemOut.log (the WAS console file). I've got some suggestions for you that will help you better understand what's happening in your macro.
Run WAS in debugFirst, to help you see where the macro is, or what is happening on the screen you can enable the HOD applet to display in your local WAS environment. To do that either restart the WAS server in debug mode, or change the runtime properties file. When starting in debug mode, the HATS runtime will use the runtime-debug.properties file (located in your EAR project). This however, can mean some slow performance. It also does not give you much benefit if you don't have any custom Java code such as Integration Objects, Business Logic, or Custom Widgets.
Enable the HOD appletInstead, you can simply enable the HOD applet in runtime.properties (also in the EAR project). Just look for the following line:
Change this value to 1 to enable the host terminal when the runtime starts. This will help your debugging sessions. As soon as the application starts, you'll see the applet start up in a separate window. You can resize it to full screen if you like. Its fully interactive - if the macro gets stuck on a screen, you can 'push' it along.
Add tracing to your macroAnother nifty thing you can do is add trace statements to your macro. Add the following inside the <action> xml element in the source. Note, that you can do this using the Advanced Editor or the source view, but NOT in the host terminal, nor the visual macro editor. This is a bit of a hidden gem, and you'll need to get your hands dirty in source code to use it.
<trace type="SYSOUT" value="'Executing xxx action now'"/>
Note that the type attribute can accept a few different values. SYSOUT sends the trace to the SystemOut.log file of WAS. You can also use HODTRACE which will write the comment to the HATS tracing file, usually found in the installedApps/HATS_EAR/logs folder of your WAS environment. The last option is USER, which allows you to send it to a user tracing facility. The last one I have not used, but plan to experiment on. If your sysadmin has disabled sysout statements on your production WAS environment, you will not see it (and that is a best practice). In a production environemtn, after you test your macros, you should instead change these to HODTRACE, or USER if you find you are able to write to another tracing facility. Currently it will not write to the java.util.logging interface but we have requested that as a feature in a future release.
For the value attribute, notice that the string is in single quotes. You can also append macro variables such as $strCustId$, where strCustId is a macro variable. This allows you to see what the state of the value is at runtime in the system console.
Labels: HATS, rational