Package org.drools.spring.metadata

Examples of org.drools.spring.metadata.BasicRuleMetadata


                && ruleAnnotation.duration() == Long.MIN_VALUE
                && ruleAnnotation.loop() == Rule.Loop.DEFAULT;
    }

    private RuleMetadata createRuleMetadataFromDefaultValue(Rule ruleAnnotation) {
        BasicRuleMetadata metadata = new BasicRuleMetadata();
        metadata.setName(ruleAnnotation.value());
        return metadata;
    }
View Full Code Here


    /*
     * This code is ugly because JSR-175 does not allow null values, thus we are
     * forced to use sentinal values.
     */
    private RuleMetadata createRuleMetadataFromNamedValues(Class pojoClass, Rule ruleAnnotation) {
        BasicRuleMetadata metadata = new BasicRuleMetadata();

        if (ruleAnnotation.name().length() > 0) {
            metadata.setName(ruleAnnotation.name());
        } else {
            metadata.setName(pojoClass.getName());
        }
        if (ruleAnnotation.documentation().length() > 0) {
            metadata.setDocumentation(ruleAnnotation.documentation());
        }
        if (ruleAnnotation.salience() != Integer.MIN_VALUE) {
            metadata.setSalience(ruleAnnotation.salience());
        }
        if (ruleAnnotation.duration() != Long.MIN_VALUE) {
            metadata.setDuration(ruleAnnotation.duration());
        }
        if (ruleAnnotation.loop() != Rule.Loop.DEFAULT) {
            metadata.setNoLoop(ruleAnnotation.loop().getValue());
        }

        return metadata;
    }
View Full Code Here

TOP

Related Classes of org.drools.spring.metadata.BasicRuleMetadata

Copyright © 2018 www.massapicom. 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.