Decision Management & Intelligence (ODM, DI)

 View Only

 Decision Trace with Java XOM ruleapp

T. Ibis's profile image
T. Ibis posted Mon November 10, 2025 05:59 AM

Hello,

we are currently converting our ruleapps from XML XOM to Java-based XOM. 

When we enable tracing via the Rule Execution Server, a trace is generated. However, the trace does not include the input or output data that was sent and received. It only shows the name of some objects, which is unusual. 

Example:

Is this a known issue, or do we need to configure a specific setting when building Java XOM rule apps?

Thank you

Mike Hammack's profile image
Mike Hammack

It is unable to transform the data elements into XML for display in the trace, so all it is showing is the names of the Java objects. We have that problem when there is a mismatch between the deployed XOM resource and the BOM in the ruleset. Something in the Java definition of the objects may not be matching the BOM. What corrects this for us is to synchronize the BOM and XOM (getting the correct Java code and doing a BOM update), and re-deploying the XOM resource and the ruleset.

T. Ibis's profile image
T. Ibis

Hello Mike,
unfortunately this was not the solution.

I synchronized the BOM and XOM and redeployed the ruleset, but the Decision Trace is still empty, as shown above.

The input and output data only appear when I switch the Decision Trace view to “BOM format”. However, in that case the data is displayed as a kind of pseudo‑XML representation, not in the original JSON structure.

My rules are invoked via REST using JSON input, and the response returned by the Rule Execution Server is also JSON.

Is there any supported way in IBM ODM (8.11.x) to display the Decision Trace input and output in JSON format?  If not, is there a recommended workaround or best practice for tracing JSON request/response payloads when using REST-based rule execution?

Alain Robert's profile image
Alain Robert

the trace is either printing the BOM serialization or the toString() of the object. If you implement a toString method in your java objects that is what will be displayed in the trace 

import com.fasterxml.jackson.databind.ObjectMapper;

public class MyObject {
    private String name;
    private int value;

    // Getters and Setters required by Jackson

    @Override
    public String toString() {
        try {
            return new ObjectMapper().writeValueAsString(this);
        } catch (Exception e) {
            return super.toString(); // Fallback to default
        }
    }
}
T. Ibis's profile image
T. Ibis

This worked, thank you once again Alain 🙂