Decision engines · Export
PYD ENTERPRISES and Drools
Run extracted legacy rules on the Drools DMN engine in Java services, with DMN files packaged alongside the code and verified against legacy fixtures.
Drools
Decision engines
1DMNRuntime runtime = KieServices.Factory.get()2 .getKieClasspathContainer().newKieSession().getKieRuntime(DMNRuntime.class);3DMNModel model = runtime.getModel("https://pydenterprises.com/dmn/ddafee01", "Maintenance fee");45for (Fixture f : Fixtures.load("fixtures/ddafee01.json")) {6 DMNContext ctx = runtime.newContext();7 ctx.set("tier", f.input("tier"));8 ctx.set("avgBalance", f.decimal("avgBalance"));9 DMNResult r = runtime.evaluateAll(model, ctx);10 assertEquals(f.decimal("fee"), r.getDecisionResultByName("Maintenance fee").getResult(), f.ruleId());11}
A natural target for Java modernization
Many COBOL-to-Java and EJB-to-Spring programs choose Drools, the open source rules engine from the KIE community, for decision logic that business owners need to see and change. Drools includes a DMN engine, so the decision tables PYD ENTERPRISES extracts can run inside a Java service without being translated into hand-written if chains or into DRL rules.
PYD ENTERPRISES exports each approved decision as a DMN file with typed inputs and outputs, FEEL unary tests, a hit policy and a decision requirements graph where decisions depend on each other. Place the files in your project's resources, and the Drools DMN runtime can evaluate them by namespace and decision name. Each rule keeps its PYD ENTERPRISES rule ID and source location as a description, so a failing evaluation in production can be traced to the COBOL or PL/SQL lines it came from.
Types and precision
Legacy decision logic is full of packed decimal amounts. A field declared PIC S9(7)V99 COMP-3 holds an exact two-decimal amount in 5 bytes; comparing it against 1500.00 in COBOL is an exact decimal comparison. FEEL numbers are decimal, not binary floating point, which suits these comparisons. PYD ENTERPRISES still declares item definitions with the original precision and scale recorded in annotations, and flags any rule whose COBOL arithmetic truncated rather than rounded, because the target service must replicate that truncation explicitly before calling the decision.
- 88-level condition names become string or boolean inputs with allowed values listed in the item definition.
- Dates stored as
PIC 9(8)in yyyymmdd form become FEELdateinputs, with the conversion documented. - Inputs that the legacy program read from VSAM or DB2 mid-decision are lifted to explicit decision inputs.
Verifying the engine matches the mainframe
Exported decisions come with the fixtures the behavioral test generator produced for them: inputs at and around every boundary in the table, and the outputs the legacy code produces for each. A small JUnit harness evaluates the DMN model in the Drools runtime against those fixtures, which gives you an equivalence check at the decision level before the surrounding service exists. PYD ENTERPRISES writes the fixtures; your team owns the harness and the build.
FAQ
Drools questions.
Does PYD ENTERPRISES generate DRL rules?
No. PYD ENTERPRISES exports DMN, which Drools executes through its DMN engine. DMN keeps the rules readable by analysts in the same table form they reviewed.
Will decimal amounts behave the same as COMP-3?
FEEL numbers are decimal, so comparisons and arithmetic do not suffer binary floating point drift. Truncation versus rounding still has to match the legacy code, and PYD ENTERPRISES flags every rule where that matters.
Can business users edit the decisions after export?
Yes, with any DMN editor your team uses. PYD ENTERPRISES can compare an edited file to the extracted baseline so intentional changes are visible and deliberate.
RELATED INTEGRATIONS
See the Drools flow on your own code.
Run PYD ENTERPRISES on 100,000 lines of COBOL or Java in your private VPC and review OpenAPI specs and DMN tables tomorrow.