Examples of RuleContext


Examples of org.kie.api.runtime.rule.RuleContext

        HardSoftBigDecimalScoreHolder scoreHolder = new HardSoftBigDecimalScoreHolder(constraintMatchEnabled);

        scoreHolder.addHardConstraintMatch(createRuleContext("scoreRule1"),
                new BigDecimal("-10.00")); // Rule match added

        RuleContext ruleContext2 = createRuleContext("scoreRule2");
        scoreHolder.addHardConstraintMatch(ruleContext2, new BigDecimal("-2.00")); // Rule match added
        callUnMatch(ruleContext2); // Rule match removed

        RuleContext ruleContext3 = createRuleContext("scoreRule3");
        scoreHolder.addSoftConstraintMatch(ruleContext3, new BigDecimal("-0.30")); // Rule match added
        scoreHolder.addSoftConstraintMatch(ruleContext3, new BigDecimal("-0.03")); // Rule match modified

        assertEquals(HardSoftBigDecimalScore.valueOf(new BigDecimal("-10.00"), new BigDecimal("-0.03")),
                scoreHolder.extractScore());
View Full Code Here

Examples of org.kie.api.runtime.rule.RuleContext

    public void addConstraintMatch(boolean constraintMatchEnabled) {
        HardSoftDoubleScoreHolder scoreHolder = new HardSoftDoubleScoreHolder(constraintMatchEnabled);

        scoreHolder.addHardConstraintMatch(createRuleContext("scoreRule1"), -10.00); // Rule match added

        RuleContext ruleContext2 = createRuleContext("scoreRule2");
        scoreHolder.addHardConstraintMatch(ruleContext2, -2.00); // Rule match added
        callUnMatch(ruleContext2); // Rule match removed

        RuleContext ruleContext3 = createRuleContext("scoreRule3");
        scoreHolder.addSoftConstraintMatch(ruleContext3, -0.30); // Rule match added
        scoreHolder.addSoftConstraintMatch(ruleContext3, -0.06); // Rule match modified

        assertEquals(HardSoftDoubleScore.valueOf(-10.00, -0.06), scoreHolder.extractScore());
        if (constraintMatchEnabled) {
View Full Code Here

Examples of org.kie.api.runtime.rule.RuleContext

    public void addConstraintMatch(boolean constraintMatchEnabled) {
        HardSoftLongScoreHolder scoreHolder = new HardSoftLongScoreHolder(constraintMatchEnabled);

        scoreHolder.addHardConstraintMatch(createRuleContext("scoreRule1"), -1000L); // Rule match added

        RuleContext ruleContext2 = createRuleContext("scoreRule2");
        scoreHolder.addHardConstraintMatch(ruleContext2, -200L); // Rule match added
        callUnMatch(ruleContext2); // Rule match removed

        RuleContext ruleContext3 = createRuleContext("scoreRule3");
        scoreHolder.addSoftConstraintMatch(ruleContext3, -30L); // Rule match added
        scoreHolder.addSoftConstraintMatch(ruleContext3, -3L); // Rule match modified

        assertEquals(HardSoftLongScore.valueOf(-1000L, -3L), scoreHolder.extractScore());
        if (constraintMatchEnabled) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.