Search in sources :

Example 1 with DDTATable

use of org.kie.dmn.validation.dtanalysis.model.DDTATable in project drools by kiegroup.

the class DMNDTAnalyser method dmnDTAnalysis.

private DTAnalysis dmnDTAnalysis(DMNModel model, DecisionTable dt, Set<Validation> flags) {
    DDTATable ddtaTable = new DDTATable();
    compileTableInputClauses(model, dt, ddtaTable);
    compileTableOutputClauses(model, dt, ddtaTable);
    compileTableRules(dt, ddtaTable);
    compileTableComputeColStringMissingEnum(model, dt, ddtaTable);
    printDebugTableInfo(ddtaTable);
    DTAnalysis analysis = new DTAnalysis(dt, ddtaTable);
    analysis.computeOutputInLOV();
    if (!dt.getHitPolicy().equals(HitPolicy.COLLECT)) {
        if (ddtaTable.getColIDsStringWithoutEnum().isEmpty()) {
            LOG.debug("findGaps");
            findGaps(analysis, ddtaTable, 0, new Interval[ddtaTable.inputCols()], Collections.emptyList());
        } else {
            LOG.debug("findGaps Skipped because getColIDsStringWithoutEnum is not empty: {}", ddtaTable.getColIDsStringWithoutEnum());
        }
        LOG.debug("findOverlaps");
        findOverlaps(analysis, ddtaTable, 0, new Interval[ddtaTable.inputCols()], Collections.emptyList());
    } else {
        LOG.debug("findGaps(), findOverlaps() are Skipped because getHitPolicy is COLLECT.");
    }
    LOG.debug("computeMaskedRules");
    analysis.computeMaskedRules();
    LOG.debug("computeMisleadingRules");
    analysis.computeMisleadingRules();
    LOG.debug("normalize");
    analysis.normalize();
    LOG.debug("computeSubsumptions");
    analysis.computeSubsumptions();
    LOG.debug("computeContractions");
    analysis.computeContractions();
    LOG.debug("compute1stNFViolations");
    analysis.compute1stNFViolations();
    LOG.debug("compute2ndNFViolations");
    analysis.compute2ndNFViolations();
    LOG.debug("computeHitPolicyRecommender");
    analysis.computeHitPolicyRecommender();
    if (flags.contains(Validation.COMPUTE_DECISION_TABLE_MCDC)) {
        LOG.debug("mcdc.");
        List<PosNegBlock> selectedBlocks = new MCDCAnalyser(ddtaTable, dt).compute();
        analysis.setMCDCSelectedBlocks(selectedBlocks);
    }
    return analysis;
}
Also used : DDTATable(org.kie.dmn.validation.dtanalysis.model.DDTATable) PosNegBlock(org.kie.dmn.validation.dtanalysis.mcdc.MCDCAnalyser.PosNegBlock) MCDCAnalyser(org.kie.dmn.validation.dtanalysis.mcdc.MCDCAnalyser) DTAnalysis(org.kie.dmn.validation.dtanalysis.model.DTAnalysis)

Aggregations

MCDCAnalyser (org.kie.dmn.validation.dtanalysis.mcdc.MCDCAnalyser)1 PosNegBlock (org.kie.dmn.validation.dtanalysis.mcdc.MCDCAnalyser.PosNegBlock)1 DDTATable (org.kie.dmn.validation.dtanalysis.model.DDTATable)1 DTAnalysis (org.kie.dmn.validation.dtanalysis.model.DTAnalysis)1