Package org.drools.workbench.models.guided.dtree.shared.model.values

Examples of org.drools.workbench.models.guided.dtree.shared.model.values.Value


        if ( sfc.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_LITERAL ) {
            final String operator = sfc.getOperator();
            final boolean isValueRequired = OperatorsOracle.isValueRequired( operator );
            if ( isValueRequired ) {
                final Value value = getValue( className,
                                              fieldName,
                                              model,
                                              dmo,
                                              messages,
                                              sfc.getValue() );
                if ( value != null ) {
                    node = new ConstraintNodeImpl( className,
                                                   fieldName,
                                                   operator,
                                                   value );
                }
            } else {
                node = new ConstraintNodeImpl( className,
                                               fieldName );
            }

        } else if ( sfc.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_ENUM ) {
            final String operator = sfc.getOperator();
            final boolean isValueRequired = OperatorsOracle.isValueRequired( operator );
            if ( isValueRequired ) {
                final Value value = getValue( className,
                                              fieldName,
                                              model,
                                              dmo,
                                              messages,
                                              sfc.getValue() );
View Full Code Here


                if ( afv.getNature() != FieldNatureType.TYPE_LITERAL ) {
                    messages.add( new UnsupportedFieldNatureTypeParserMessage() );
                    return nodes;
                }
                final String fieldName = afv.getField();
                final Value value = getValue( aif.getFactType(),
                                              afv.getField(),
                                              model,
                                              dmo,
                                              messages,
                                              afv.getValue() );
                if ( value != null ) {
                    final ActionFieldValue _afv = new ActionFieldValueImpl( fieldName,
                                                                            value );
                    aun.getFieldValues().add( _afv );
                }
            }
            nodes.add( aun );
            return nodes;

        } else if ( a instanceof ActionInsertFact ) {
            final ActionInsertFact aif = (ActionInsertFact) a;
            final ActionInsertNode aun = new ActionInsertNodeImpl( aif.getFactType() );
            aun.setLogicalInsertion( false );
            for ( org.drools.workbench.models.datamodel.rule.ActionFieldValue afv : aif.getFieldValues() ) {
                if ( afv.getNature() != FieldNatureType.TYPE_LITERAL ) {
                    messages.add( new UnsupportedFieldNatureTypeParserMessage() );
                    return nodes;
                }
                final String fieldName = afv.getField();
                final Value value = getValue( aif.getFactType(),
                                              afv.getField(),
                                              model,
                                              dmo,
                                              messages,
                                              afv.getValue() );
                if ( value != null ) {
                    final ActionFieldValue _afv = new ActionFieldValueImpl( fieldName,
                                                                            value );
                    aun.getFieldValues().add( _afv );
                }
            }
            nodes.add( aun );
            return nodes;

        } else if ( a instanceof ActionUpdateField ) {
            final ActionUpdateField auf = (ActionUpdateField) a;
            final String binding = auf.getVariable();
            for ( TypeNode tn : types ) {
                if ( tn.isBound() ) {
                    if ( tn.getBinding().equals( binding ) ) {
                        final ActionUpdateNode aun = new ActionUpdateNodeImpl( tn );
                        aun.setModify( true );
                        for ( org.drools.workbench.models.datamodel.rule.ActionFieldValue afv : auf.getFieldValues() ) {
                            if ( afv.getNature() != FieldNatureType.TYPE_LITERAL ) {
                                messages.add( new UnsupportedFieldNatureTypeParserMessage() );
                                return nodes;
                            }
                            final String fieldName = afv.getField();
                            final Value value = getValue( tn.getClassName(),
                                                          afv.getField(),
                                                          model,
                                                          dmo,
                                                          messages,
                                                          afv.getValue() );
                            if ( value != null ) {
                                final ActionFieldValue _afv = new ActionFieldValueImpl( fieldName,
                                                                                        value );
                                aun.getFieldValues().add( _afv );
                            }
                        }
                        nodes.add( aun );
                        return nodes;
                    }
                }
            }
            messages.add( new BindingNotFoundParserMessage( binding ) );
            return nodes;

        } else if ( a instanceof ActionSetField ) {
            final ActionSetField asf = (ActionSetField) a;
            final String binding = asf.getVariable();
            for ( TypeNode tn : types ) {
                if ( tn.isBound() ) {
                    if ( tn.getBinding().equals( binding ) ) {
                        final ActionUpdateNode aun = new ActionUpdateNodeImpl( tn );
                        for ( org.drools.workbench.models.datamodel.rule.ActionFieldValue afv : asf.getFieldValues() ) {
                            if ( afv.getNature() != FieldNatureType.TYPE_LITERAL ) {
                                messages.add( new UnsupportedFieldNatureTypeParserMessage() );
                                return nodes;
                            }
                            final String fieldName = afv.getField();
                            final Value value = getValue( tn.getClassName(),
                                                          afv.getField(),
                                                          model,
                                                          dmo,
                                                          messages,
                                                          afv.getValue() );
View Full Code Here

            final Well childWidget = new Well();
            if ( child instanceof ConstraintNode ) {
                childWidget.add( new Label( "Constraint" ) );
                childWidget.add( new Paragraph( "Field: " + ( (ConstraintNode) child ).getFieldName() ) );
                childWidget.add( new Paragraph( "Operator: " + ( (ConstraintNode) child ).getOperator() ) );
                final Value value = ( (ConstraintNode) child ).getValue();
                if ( value instanceof StringValue ) {
                    childWidget.add( new Paragraph( "Value: " + ( (StringValue) value ).getValue() ) );
                } else if ( value instanceof IntegerValue ) {
                    childWidget.add( new Paragraph( "Value: " + ( (IntegerValue) value ).getValue() ) );
                }
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.guided.dtree.shared.model.values.Value

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.