Retrieve the decision table in readable format from ODM Decision Center using Java code/API

832 views Asked by At

I need to extract the contents of a decision table in a readable/tabular format from the IBM ODM Decision Center Business Console using Java and ODM APIs provided.

This has to be an automated process and hence I cannot use the existing Import/Export feature provided by ODM.

Does anyone have any sample code or have implemented such a requirement?

Version: ODM 8.10.1

2

There are 2 answers

1
arahant On BEST ANSWER

Step 1: Query the decision center for the decision table (see here for instructions)

Step 2:

                if (rule.getType().equals("brm.DecisionTable")) {
                        IlrDecisionTable dTable = (IlrDecisionTable) rule;
                        IlrDTController controller = IlrSessionHelper.getDTController(session, dTable, new Locale(dTable.getLocale()));
                        String tableHtml = IlrDTHelper.getHTMLTable(controller, false, false);//getHTMLTable(IlrDTController controller, boolean showEmptyRow, boolean includeCSS)
                        ...
                    }
0
Emmanuel B. On

if you synchronise your Rule Designer rules with Decision Center, you can use REST API to extract your Decision Table as an excel file from Decision Center.

https://www.ibm.com/docs/en/odm/8.10?topic=api-rest

REST API export Excel

Hope this helps, Emmanuel