Package org.drools.workbench.models.datamodel.rule

Examples of org.drools.workbench.models.datamodel.rule.InterpolationVariable


    private Map<InterpolationVariable, Integer> getInterpolationVariables() {
        Map<InterpolationVariable, Integer> result = new HashMap<InterpolationVariable, Integer>();
        new RuleModelVisitor( result ).visit( this );

        InterpolationVariable id = new InterpolationVariable( ID_COLUMN_NAME,
                                                              DataType.TYPE_NUMERIC_LONG );
        result.put( id,
                    result.size() );
        return result;
    }
View Full Code Here


        putInSync();

        String[][] ret = new String[ rowsCount ][ table.size() - 1 ];
        Map<InterpolationVariable, Integer> vars = getInterpolationVariables();
        for ( Map.Entry<InterpolationVariable, Integer> entry : vars.entrySet() ) {
            InterpolationVariable var = entry.getKey();
            String varName = var.getVarName();
            if ( ID_COLUMN_NAME.equals( varName ) ) {
                continue;
            }
            int idx = entry.getValue();
            for ( int row = 0; row < rowsCount; row++ ) {
View Full Code Here

                                    pos + 2 );
            if ( end != -1 ) {
                final String varName = text.substring( pos + 2,
                                                       end );
                pos = end + 1;
                InterpolationVariable var = new InterpolationVariable( varName,
                                                                       DataType.TYPE_OBJECT );
                if ( !vars.contains( var ) ) {
                    vars.add( var );
                }
            }
View Full Code Here

    //ActionInsertFact, ActionSetField, ActionpdateField
    private void visitActionFieldList( final ActionInsertFact afl ) {
        String factType = afl.getFactType();
        for ( ActionFieldValue afv : afl.getFieldValues() ) {
            InterpolationVariable var = new InterpolationVariable( afv.getValue(),
                                                                   afv.getType(),
                                                                   factType,
                                                                   afv.getField() );
            if ( afv.getNature() == FieldNatureType.TYPE_TEMPLATE && !vars.contains( var ) ) {
                vars.add( var );
View Full Code Here

    }

    private void visitActionFieldList( final ActionSetField afl ) {
        String factType = model.getLHSBindingType( afl.getVariable() );
        for ( ActionFieldValue afv : afl.getFieldValues() ) {
            InterpolationVariable var = new InterpolationVariable( afv.getValue(),
                                                                   afv.getType(),
                                                                   factType,
                                                                   afv.getField() );
            if ( afv.getNature() == FieldNatureType.TYPE_TEMPLATE && !vars.contains( var ) ) {
                vars.add( var );
View Full Code Here

    }

    private void visitActionFieldList( final ActionUpdateField afl ) {
        String factType = model.getLHSBindingType( afl.getVariable() );
        for ( ActionFieldValue afv : afl.getFieldValues() ) {
            InterpolationVariable var = new InterpolationVariable( afv.getValue(),
                                                                   afv.getType(),
                                                                   factType,
                                                                   afv.getField() );
            if ( afv.getNature() == FieldNatureType.TYPE_TEMPLATE && !vars.contains( var ) ) {
                vars.add( var );
View Full Code Here

            }
        }
    }

    private void visitSingleFieldConstraint( final SingleFieldConstraint sfc ) {
        final InterpolationVariable var = new InterpolationVariable( sfc.getValue(),
                                                                     sfc.getFieldType(),
                                                                     ( factPattern == null ? "" : factPattern.getFactType() ),
                                                                     sfc.getFieldName() );
        if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == sfc.getConstraintValueType() && !vars.contains( var ) ) {
            vars.add( var );
        } else {
            hasNonTemplateOutput = true;
        }

        //Visit Connection constraints
        if ( sfc.getConnectives() != null ) {
            for ( int i = 0; i < sfc.getConnectives().length; i++ ) {
                final ConnectiveConstraint cc = sfc.getConnectives()[ i ];
                InterpolationVariable ccVar = new InterpolationVariable( cc.getValue(),
                                                                         cc.getFieldType(),
                                                                         ( factPattern == null ? "" : factPattern.getFactType() ),
                                                                         cc.getFieldName() );
                if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == cc.getConstraintValueType() && !vars.contains( ccVar ) ) {
                    vars.add( ccVar );
View Full Code Here

        final String genericType = sfexp.getExpressionLeftSide().getGenericType();
        String factType = sfexp.getExpressionLeftSide().getPreviousClassType();
        if ( factType == null ) {
            factType = sfexp.getExpressionLeftSide().getClassType();
        }
        final InterpolationVariable var = new InterpolationVariable( sfexp.getValue(),
                                                                     genericType,
                                                                     factType,
                                                                     sfexp.getFieldName() );
        if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == sfexp.getConstraintValueType() && !vars.contains( var ) ) {
            vars.add( var );
        } else {
            hasNonTemplateOutput = true;
        }

        //Visit Connection constraints
        if ( sfexp.getConnectives() != null ) {
            for ( int i = 0; i < sfexp.getConnectives().length; i++ ) {
                final ConnectiveConstraint cc = sfexp.getConnectives()[ i ];
                InterpolationVariable ccVar = new InterpolationVariable( cc.getValue(),
                                                                         genericType,
                                                                         factType,
                                                                         cc.getFieldName() );
                if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == cc.getConstraintValueType() && !vars.contains( ccVar ) ) {
                    vars.add( ccVar );
View Full Code Here

    private Map<InterpolationVariable, Integer> getInterpolationVariables() {
        Map<InterpolationVariable, Integer> result = new HashMap<InterpolationVariable, Integer>();
        new RuleModelVisitor( result ).visit( this );

        InterpolationVariable id = new InterpolationVariable( ID_COLUMN_NAME,
                                                              DataType.TYPE_NUMERIC_LONG );
        result.put( id,
                    result.size() );
        return result;
    }
View Full Code Here

        putInSync();

        String[][] ret = new String[ rowsCount ][ table.size() - 1 ];
        Map<InterpolationVariable, Integer> vars = getInterpolationVariables();
        for ( Map.Entry<InterpolationVariable, Integer> entry : vars.entrySet() ) {
            InterpolationVariable var = entry.getKey();
            String varName = var.getVarName();
            if ( ID_COLUMN_NAME.equals( varName ) ) {
                continue;
            }
            int idx = entry.getValue();
            for ( int row = 0; row < rowsCount; row++ ) {
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.rule.InterpolationVariable

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.