private Rule makeRuleAnnotation(TDecisionRule rule, int ruleIndex) { return new Rule(ruleIndex, basicDMNTransformer.annotationEscapedText(rule)); }
@Override public void endRule(DRGElement element, Rule rule, Object output) { if (logger.isDebugEnabled()) { logger.debug(String.format("Rule %d fired with output '%s'", rule.getIndex(), output)); } } }
private Rule makeRuleAnnotation(TDecisionRule rule, int ruleIndex) { return new Rule(ruleIndex, basicDMNTransformer.annotationEscapedText(rule)); }
@Override public void endRule(DRGElement element, Rule rule, Object output) { if (logger.isDebugEnabled()) { logger.debug(String.format("Rule %d fired with output '%s'", rule.getIndex(), output)); } } }
@com.gs.dmn.runtime.annotation.Rule(index = 0, annotation = "") public com.gs.dmn.runtime.RuleOutput rule0(String c, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(0, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule ListGen4RuleOutput output_ = new ListGen4RuleOutput(false); if (Boolean.TRUE == true) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setListGen4("a"); // Add annotation annotationSet_.addAnnotation("listGen4", 0, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 2, annotation = "") public com.gs.dmn.runtime.RuleOutput rule2(String c, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(2, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule ListGen4RuleOutput output_ = new ListGen4RuleOutput(false); if (Boolean.TRUE == true) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setListGen4("c"); // Add annotation annotationSet_.addAnnotation("listGen4", 2, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "") public com.gs.dmn.runtime.RuleOutput rule1(String c, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule ListGen4RuleOutput output_ = new ListGen4RuleOutput(false); if (Boolean.TRUE == true) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setListGen4("b"); // Add annotation annotationSet_.addAnnotation("listGen4", 1, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 0, annotation = "") public com.gs.dmn.runtime.RuleOutput rule0(javax.xml.datatype.XMLGregorianCalendar dateD, javax.xml.datatype.XMLGregorianCalendar dateE, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(0, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule DateCompare2RuleOutput output_ = new DateCompare2RuleOutput(false); if (Boolean.TRUE == (dateGreaterThan(dateD, dateE))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setDateCompare2(Boolean.TRUE); // Add annotation annotationSet_.addAnnotation("dateCompare2", 0, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "") public com.gs.dmn.runtime.RuleOutput rule1(javax.xml.datatype.XMLGregorianCalendar dateD, javax.xml.datatype.XMLGregorianCalendar dateE, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule DateCompare2RuleOutput output_ = new DateCompare2RuleOutput(false); if (Boolean.TRUE == (dateLessEqualThan(dateD, dateE))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setDateCompare2(Boolean.FALSE); // Add annotation annotationSet_.addAnnotation("dateCompare2", 1, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "") public com.gs.dmn.runtime.RuleOutput rule1(String preBureauRiskCategory, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule BureauCallTypeTableRuleOutput output_ = new BureauCallTypeTableRuleOutput(false); if (Boolean.TRUE == (stringEqual(preBureauRiskCategory, "LOW"))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setBureauCallTypeTable("MINI"); // Add annotation annotationSet_.addAnnotation("BureauCallTypeTable", 1, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "") public com.gs.dmn.runtime.RuleOutput rule1(String preBureauRiskCategory, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule BureauCallTypeTableRuleOutput output_ = new BureauCallTypeTableRuleOutput(false); if (Boolean.TRUE == (stringEqual(preBureauRiskCategory, "LOW"))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setBureauCallTypeTable("MINI"); // Add annotation annotationSet_.addAnnotation("BureauCallTypeTable", 1, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "") public com.gs.dmn.runtime.RuleOutput rule1(java.math.BigDecimal numB, java.math.BigDecimal numC, com.gs.dmn.tck.cl3_0017_tableTests.type.TA structA, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule PriceInRangeRuleOutput output_ = new PriceInRangeRuleOutput(false); if (Boolean.TRUE == true) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setPriceInRange("Not in range"); output_.setPriceInRangePriority(1); // Add annotation annotationSet_.addAnnotation("priceInRange", 1, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 2, annotation = "string(-)") public com.gs.dmn.runtime.RuleOutput rule2(java.math.BigDecimal compareAgainstLendingThreshold, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(2, "string(-)"); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule MakeCreditDecisionRuleOutput output_ = new MakeCreditDecisionRuleOutput(false); if (Boolean.TRUE == (numericGreaterThan(compareAgainstLendingThreshold, number("0.1")))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setMakeCreditDecision("Accept"); // Add annotation annotationSet_.addAnnotation("makeCreditDecision", 2, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "") public com.gs.dmn.runtime.RuleOutput rule1(javax.xml.datatype.XMLGregorianCalendar dateD, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule DateCompare1RuleOutput output_ = new DateCompare1RuleOutput(false); if (Boolean.TRUE == (dateLessEqualThan(dateD, date("2016-10-01")))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setDateCompare1(Boolean.FALSE); // Add annotation annotationSet_.addAnnotation("dateCompare1", 1, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "") public com.gs.dmn.runtime.RuleOutput rule1(String riskCategory, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule CreditContingencyFactorTableRuleOutput output_ = new CreditContingencyFactorTableRuleOutput(false); if (Boolean.TRUE == (stringEqual(riskCategory, "MEDIUM"))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setCreditContingencyFactorTable(number("0.7")); // Add annotation annotationSet_.addAnnotation("CreditContingencyFactorTable", 1, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "string(\"Error: threshold undefined\")") public com.gs.dmn.runtime.RuleOutput rule1(java.math.BigDecimal assessApplicantAge, java.math.BigDecimal assessIssueRisk, java.math.BigDecimal lendingThreshold, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, "string(\"Error: threshold undefined\")"); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule CompareAgainstLendingThresholdRuleOutput output_ = new CompareAgainstLendingThresholdRuleOutput(false); if (Boolean.TRUE == (lendingThreshold == null)) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setCompareAgainstLendingThreshold(number("0")); // Add annotation annotationSet_.addAnnotation("compareAgainstLendingThreshold", 1, string("Error: threshold undefined")); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "string(\"Error: threshold undefined\")") public com.gs.dmn.runtime.RuleOutput rule1(java.math.BigDecimal assessApplicantAge, java.math.BigDecimal assessIssueRisk, java.math.BigDecimal lendingThreshold, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, "string(\"Error: threshold undefined\")"); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule CompareAgainstLendingThresholdRuleOutput output_ = new CompareAgainstLendingThresholdRuleOutput(false); if (Boolean.TRUE == (lendingThreshold == null)) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setCompareAgainstLendingThreshold(number("0")); // Add annotation annotationSet_.addAnnotation("compareAgainstLendingThreshold", 1, string("Error: threshold undefined")); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 1, annotation = "") public com.gs.dmn.runtime.RuleOutput rule1(String riskCategory, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(1, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule CreditContingencyFactorTableRuleOutput output_ = new CreditContingencyFactorTableRuleOutput(false); if (Boolean.TRUE == (stringEqual(riskCategory, "MEDIUM"))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setCreditContingencyFactorTable(number("0.7")); // Add annotation annotationSet_.addAnnotation("CreditContingencyFactorTable", 1, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 2, annotation = "string(-)") public com.gs.dmn.runtime.RuleOutput rule2(java.math.BigDecimal compareAgainstLendingThreshold, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(2, "string(-)"); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule MakeCreditDecisionRuleOutput output_ = new MakeCreditDecisionRuleOutput(false); if (Boolean.TRUE == (numericGreaterThan(compareAgainstLendingThreshold, number("0.1")))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setMakeCreditDecision("Accept"); // Add annotation annotationSet_.addAnnotation("makeCreditDecision", 2, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }
@com.gs.dmn.runtime.annotation.Rule(index = 0, annotation = "") public com.gs.dmn.runtime.RuleOutput rule0(javax.xml.datatype.XMLGregorianCalendar dateD, com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_, com.gs.dmn.runtime.listener.EventListener eventListener_, com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_) { // Rule metadata com.gs.dmn.runtime.listener.Rule drgRuleMetadata = new com.gs.dmn.runtime.listener.Rule(0, ""); // Rule start eventListener_.startRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Apply rule DateCompare1RuleOutput output_ = new DateCompare1RuleOutput(false); if (Boolean.TRUE == (dateGreaterThan(dateD, date("2016-10-01")))) { // Rule match eventListener_.matchRule(DRG_ELEMENT_METADATA, drgRuleMetadata); // Compute output output_.setMatched(true); output_.setDateCompare1(Boolean.TRUE); // Add annotation annotationSet_.addAnnotation("dateCompare1", 0, ""); } // Rule end eventListener_.endRule(DRG_ELEMENT_METADATA, drgRuleMetadata, output_); return output_; }