Package org.drools.spi

Examples of org.drools.spi.AlphaNodeFieldConstraint


     * Constraint's evaluator string
     *
     * @return evaluator string
     */
    public String getEvaluator() {
        AlphaNodeFieldConstraint constraint = this.node.getConstraint();
        if (constraint instanceof MvelConstraint) {
          MvelConstraint mvelConstraint = (MvelConstraint) constraint;
            return mvelConstraint.toString();
        }
        return null;
View Full Code Here


     * Constraint field string
     *
     * @return field string
     */
    public String getValue() {
        AlphaNodeFieldConstraint constraint = this.node.getConstraint();
        if (constraint instanceof MvelConstraint) {
          MvelConstraint mvelConstraint = (MvelConstraint) constraint;
            return mvelConstraint.getField().toString();
        }
        return null;
View Full Code Here

    }

    public void addObjectSink(final ObjectSink sink) {
        if ( sink instanceof AlphaNode ) {
            final AlphaNode alphaNode = (AlphaNode) sink;
            final AlphaNodeFieldConstraint fieldConstraint = alphaNode.getConstraint();

            if ( fieldConstraint instanceof LiteralConstraint ) {
                final LiteralConstraint literalConstraint = (LiteralConstraint) fieldConstraint;
                final Evaluator evaluator = literalConstraint.getEvaluator();
View Full Code Here

    }

    public void removeObjectSink(final ObjectSink sink) {
        if ( sink instanceof AlphaNode ) {
            final AlphaNode alphaNode = (AlphaNode) sink;
            final AlphaNodeFieldConstraint fieldConstraint = alphaNode.getConstraint();

            if ( fieldConstraint instanceof LiteralConstraint ) {
                final LiteralConstraint literalConstraint = (LiteralConstraint) fieldConstraint;
                final Evaluator evaluator = literalConstraint.getEvaluator();
                final FieldValue value = literalConstraint.getField();
View Full Code Here

        ObjectSinkNode currentSink = this.hashableSinks.getFirst();

        while ( currentSink != null ) {
            final AlphaNode alphaNode = (AlphaNode) currentSink;
            final AlphaNodeFieldConstraint fieldConstraint = alphaNode.getConstraint();
            final LiteralConstraint literalConstraint = (LiteralConstraint) fieldConstraint;

            // position to the next sink now because alphaNode may be removed if the index is equal. If we were to do this
            // afterwards, currentSink.nextNode would be null
            currentSink = currentSink.getNextObjectSinkNode();
View Full Code Here

    /* (non-Javadoc)
     * @see org.drools.reteoo.BaseNodeVertex#getHtml()
     */
    public String getHtml() {
        AlphaNodeFieldConstraint constraint = this.node.getConstraint();
        if (constraint instanceof LiteralConstraint) {
            LiteralConstraint literalConstraint = (LiteralConstraint) constraint;
            InternalReadAccessor accessor = literalConstraint.getFieldExtractor();
            if (accessor instanceof ClassFieldReader) {
                ClassFieldReader classFieldReader = (ClassFieldReader) accessor;
View Full Code Here

     * it.
     *
     * @return field name
     */
    public String getFieldName() {
        AlphaNodeFieldConstraint constraint = this.node.getConstraint();
        if (constraint instanceof LiteralConstraint) {
            LiteralConstraint literalConstraint = (LiteralConstraint) constraint;
            InternalReadAccessor accessor = literalConstraint.getFieldExtractor();
            if (accessor instanceof ClassFieldReader) {
                return ((ClassFieldReader) accessor).getFieldName();
View Full Code Here

     * Constraint's evaluator string
     *
     * @return evaluator string
     */
    public String getEvaluator() {
        AlphaNodeFieldConstraint constraint = this.node.getConstraint();
        if (constraint instanceof LiteralConstraint) {
            LiteralConstraint literalConstraint = (LiteralConstraint) constraint;
            return literalConstraint.getEvaluator().toString();
        }
        return null;
View Full Code Here

     * Constraint field string
     *
     * @return field string
     */
    public String getValue() {
        AlphaNodeFieldConstraint constraint = this.node.getConstraint();
        if (constraint instanceof LiteralConstraint) {
            LiteralConstraint literalConstraint = (LiteralConstraint) constraint;
            return literalConstraint.getField().toString();
        }
        return null;
View Full Code Here

        context.setObjectSource( (ObjectSource) utils.attachNode( context,
                                                                  otn ) );

        for ( final Iterator<Constraint> it = alphaConstraints.iterator(); it.hasNext(); ) {
            final AlphaNodeFieldConstraint constraint = (AlphaNodeFieldConstraint) it.next();

            context.pushRuleComponent( constraint );
            context.setObjectSource( (ObjectSource) utils.attachNode( context,
                                                                      new AlphaNode( context.getNextId(),
                                                                                     (AlphaNodeFieldConstraint) constraint,
View Full Code Here

TOP

Related Classes of org.drools.spi.AlphaNodeFieldConstraint

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.