Compile a summary of managed decision tables into rules

I am wondering how I could use the managed decision table from the Drools Workbench toolkit inside a Java application using runtime runoles. The idea is that the user will work on defining the rules, processes, and some decision tables in the workbench that will be selected during the saliva run.

However, for some reason I cannot figure out how to do this in drools, as it stores the table as a gdst file and does not seem to compile drooling it.

With saliva, is there a way: - to execute a gdst file, as with the Excel solution table? - or compile the gdst file in the rules?

I was looking for a solution, but I can not find a specific example ...: /

+8
java compilation rule-engine drools kie-workbench
source share
1 answer

Okay, so basically, we could easily generate drooling rules from a managed decision table. For example:

// load the data from the GDST file, for example: String decisionTableXml = new String ( Files.readAllBytes( Paths.get("./someDecisionTable.gdst") ) ); // parse the table model GuidedDecisionTable52 model = GuidedDTXMLPersistence.getInstance().unmarshal( decisionTableXml ); // compile it into drools rules String droolsRules = GuidedDTDRLPersistence.getInstance().marshal( model ); // next, save droolsRules into a file and/or load it into drools as a normal rule 

This is a simple example for managed decision tables, but the same utils probably exist for decision trees ... From there, you can organize any Drools Workbench tool using the Drools Expert runtime. Best solutions are always welcome;)

+4
source share

All Articles