Examples of QualifiedIdentifierRestriction


Examples of org.drools.analytics.components.QualifiedIdentifierRestriction

    String text = descr.getText();
    Variable variable = data.getVariableByRuleAndVariableName(currentRule
        .getRuleName(), text.substring(0, text.indexOf(".")));

    QualifiedIdentifierRestriction restriction = new QualifiedIdentifierRestriction();

    restriction.setRuleId(currentRule.getId());
    restriction.setPatternId(currentPattern.getId());
    restriction.setPatternIsNot(currentPattern.isPatternNot());
    restriction.setConstraintId(currentConstraint.getId());
    restriction.setFieldId(currentConstraint.getFieldId());
    restriction.setEvaluator(descr.getEvaluator());
    restriction.setVariableId(variable.getId());
    restriction.setVariableName(text.substring(0, text.indexOf(".")));
    restriction.setVariablePath(text.substring(text.indexOf(".")));

    // Set field value, if it is unset.
    currentField.setFieldType(Field.FieldType.VARIABLE);

    variable.setObjectType(AnalyticsComponentType.FIELD);
View Full Code Here

Examples of org.drools.verifier.components.QualifiedIdentifierRestriction

        Variable variable = data.getVariableByRuleAndVariableName( pattern.getRuleName(),
                                                                   base );

        if ( variable != null ) {

            QualifiedIdentifierRestriction restriction = new QualifiedIdentifierRestriction( pattern );

            restriction.setPatternIsNot( pattern.isPatternNot() );
            restriction.setConstraintPath( constraint.getPath() );
            restriction.setFieldPath( constraint.getFieldPath() );
            restriction.setOperator( Operator.determineOperator( descr.getEvaluator(),
                                                                 descr.isNegated() ) );
            restriction.setVariablePath( variable.getPath() );
            restriction.setVariableName( base );
            restriction.setVariablePath( fieldName );
            restriction.setOrderNumber( orderNumber );
            restriction.setParentPath( pattern.getPath() );
            restriction.setParentType( pattern.getVerifierComponentType() );

            // Set field value, if it is not set.
            field.setFieldType( Field.VARIABLE );

            variable.setObjectTypeType( VerifierComponentType.FIELD.getType() );

            data.add( restriction );
            solvers.addPatternComponent( restriction );
        } else {

            EnumField enumField = (EnumField) data.getFieldByObjectTypeAndFieldName( base,
                                                                                     fieldName );
            if ( enumField == null ) {

                ObjectType objectType = data.getObjectTypeByFullName( base );

                if ( objectType == null ) {
                    Import objectImport = data.getImportByName( base );

                    if ( objectImport != null ) {
                        objectType = ObjectTypeFactory.createObjectType( objectImport );
                    } else {
                        objectType = ObjectTypeFactory.createObjectType( base );
                    }

                    data.add( objectType );
                }

                enumField = new EnumField();

                enumField.setObjectTypePath( objectType.getPath() );
                enumField.setObjectTypeName( objectType.getName() );
                enumField.setName( fieldName );

                objectType.getFields().add( enumField );

                data.add( enumField );
            }

            EnumRestriction restriction = new EnumRestriction( pattern );

            restriction.setPatternIsNot( pattern.isPatternNot() );
            restriction.setConstraintPath( constraint.getPath() );
            restriction.setFieldPath( constraint.getFieldPath() );
            restriction.setOperator( Operator.determineOperator( descr.getEvaluator(),
                                                                 descr.isNegated() ) );
            restriction.setEnumBasePath( enumField.getPath() );
            restriction.setEnumBase( base );
            restriction.setEnumName( fieldName );
            restriction.setOrderNumber( orderNumber );
            restriction.setParentPath( pattern.getPath() );
            restriction.setParentType( pattern.getVerifierComponentType() );

            // Set field value, if it is not set.
            field.setFieldType( Field.ENUM );

            data.add( restriction );
View Full Code Here

Examples of org.drools.verifier.components.QualifiedIdentifierRestriction

        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        saveVerifierComponentAndGet( LiteralRestriction.createRestriction( pattern,
                                                                           "" ) );
        saveVerifierComponentAndGet( new EnumRestriction( pattern ) );
        saveVerifierComponentAndGet( new QualifiedIdentifierRestriction( pattern ) );
        saveVerifierComponentAndGet( new ReturnValueRestriction( pattern ) );
        saveVerifierComponentAndGet( new ReturnValueRestriction( pattern ) );
        saveVerifierComponentAndGet( new VariableRestriction( pattern ) );
    }
View Full Code Here

Examples of org.drools.verifier.components.QualifiedIdentifierRestriction

        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        saveVerifierComponentAndGet( LiteralRestriction.createRestriction( pattern,
                                                                           "" ) );
        saveVerifierComponentAndGet( new EnumRestriction( pattern ) );
        saveVerifierComponentAndGet( new QualifiedIdentifierRestriction( pattern ) );
        saveVerifierComponentAndGet( new ReturnValueRestriction( pattern ) );
        saveVerifierComponentAndGet( new ReturnValueRestriction( pattern ) );
        saveVerifierComponentAndGet( new VariableRestriction( pattern ) );
    }
View Full Code Here

Examples of org.drools.verifier.components.QualifiedIdentifierRestriction

        Variable variable = data.getVariableByRuleAndVariableName( pattern.getRuleName(),
                                                                   base );

        if ( variable != null ) {

            QualifiedIdentifierRestriction restriction = new QualifiedIdentifierRestriction( pattern );

            restriction.setPatternIsNot( pattern.isPatternNot() );
            restriction.setConstraintPath( constraint.getPath() );
            restriction.setFieldPath( constraint.getFieldPath() );
            restriction.setOperator( Operator.determineOperator( descr.getEvaluator(),
                                                                 descr.isNegated() ) );
            restriction.setVariablePath( variable.getPath() );
            restriction.setVariableName( base );
            restriction.setVariablePath( fieldName );
            restriction.setOrderNumber( orderNumber );
            restriction.setParentPath( pattern.getPath() );
            restriction.setParentType( pattern.getVerifierComponentType() );

            // Set field value, if it is not set.
            field.setFieldType( Field.VARIABLE );

            variable.setObjectTypeType( VerifierComponentType.FIELD.getType() );

            data.add( restriction );
            solvers.addPatternComponent( restriction );
        } else {

            EnumField enumField = (EnumField) data.getFieldByObjectTypeAndFieldName( base,
                                                                                     fieldName );
            if ( enumField == null ) {

                ObjectType objectType = data.getObjectTypeByFullName( base );

                if ( objectType == null ) {
                    Import objectImport = data.getImportByName( base );

                    if ( objectImport != null ) {
                        objectType = ObjectTypeFactory.createObjectType( objectImport );
                    } else {
                        objectType = ObjectTypeFactory.createObjectType( base );
                    }

                    data.add( objectType );
                }

                enumField = new EnumField();

                enumField.setObjectTypePath( objectType.getPath() );
                enumField.setObjectTypeName( objectType.getName() );
                enumField.setName( fieldName );

                objectType.getFields().add( enumField );

                data.add( enumField );
            }

            EnumRestriction restriction = new EnumRestriction( pattern );

            restriction.setPatternIsNot( pattern.isPatternNot() );
            restriction.setConstraintPath( constraint.getPath() );
            restriction.setFieldPath( constraint.getFieldPath() );
            restriction.setOperator( Operator.determineOperator( descr.getEvaluator(),
                                                                 descr.isNegated() ) );
            restriction.setEnumBasePath( enumField.getPath() );
            restriction.setEnumBase( base );
            restriction.setEnumName( fieldName );
            restriction.setOrderNumber( orderNumber );
            restriction.setParentPath( pattern.getPath() );
            restriction.setParentType( pattern.getVerifierComponentType() );

            // Set field value, if it is not set.
            field.setFieldType( Field.ENUM );

            data.add( restriction );
View Full Code Here

Examples of org.drools.verifier.components.QualifiedIdentifierRestriction

        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        saveVerifierComponentAndGet( LiteralRestriction.createRestriction( pattern,
                                                                           "" ) );
        saveVerifierComponentAndGet( new EnumRestriction( pattern ) );
        saveVerifierComponentAndGet( new QualifiedIdentifierRestriction( pattern ) );
        saveVerifierComponentAndGet( new ReturnValueRestriction( pattern ) );
        saveVerifierComponentAndGet( new ReturnValueRestriction( pattern ) );
        saveVerifierComponentAndGet( new VariableRestriction( pattern ) );
    }
View Full Code Here

Examples of org.drools.verifier.components.QualifiedIdentifierRestriction

    Variable variable = data.getVariableByRuleAndVariableName(currentRule
        .getRuleName(), base);

    if (variable != null) {

      QualifiedIdentifierRestriction restriction = new QualifiedIdentifierRestriction();

      restriction.setRuleId(currentRule.getId());
      restriction.setPatternId(currentPattern.getId());
      restriction.setPatternIsNot(currentPattern.isPatternNot());
      restriction.setConstraintId(currentConstraint.getId());
      restriction.setFieldId(currentConstraint.getFieldId());
      restriction.setOperator(Operator.determineOperator(descr
          .getEvaluator(), descr.isNegated()));
      restriction.setVariableId(variable.getId());
      restriction.setVariableName(base);
      restriction.setVariablePath(fieldName);
      restriction.setOrderNumber(orderNumber);
      restriction.setParent(parent);

      // Set field value, if it is not set.
      currentField.setFieldType(Field.FieldType.VARIABLE);

      variable.setObjectType(VerifierComponentType.FIELD);

      data.add(restriction);
      solvers.addRestriction(restriction);
    } else {

      EnumField enumField = (EnumField) data
          .getFieldByObjectTypeAndFieldName(base, fieldName);
      if (enumField == null) {
        ObjectType objectType = findOrCreateNewObjectType(base);

        enumField = new EnumField();
        enumField.setObjectTypeId(objectType.getId());
        enumField.setClassName(objectType.getName());
        enumField.setName(fieldName);

        objectType.getFields().add(enumField);

        data.add(enumField);
      }

      EnumRestriction restriction = new EnumRestriction();

      restriction.setRuleId(currentRule.getId());
      restriction.setPatternId(currentPattern.getId());
      restriction.setPatternIsNot(currentPattern.isPatternNot());
      restriction.setConstraintId(currentConstraint.getId());
      restriction.setFieldId(currentConstraint.getFieldId());
      restriction.setOperator(Operator.determineOperator(descr
          .getEvaluator(), descr.isNegated()));
      restriction.setEnumBaseId(enumField.getId());
      restriction.setEnumBase(base);
      restriction.setEnumName(fieldName);
      restriction.setOrderNumber(orderNumber);
      restriction.setParent(parent);

      // Set field value, if it is not set.
      currentField.setFieldType(Field.FieldType.ENUM);

      data.add(restriction);
View Full Code Here

Examples of org.drools.verifier.components.QualifiedIdentifierRestriction

        Variable patternVariable = data.getVariableByRuleAndVariableName(pattern.getRuleName(),
                base);

        if (patternVariable != null) {

            QualifiedIdentifierRestriction restriction = new QualifiedIdentifierRestriction(pattern);

            restriction.setPatternIsNot(pattern.isPatternNot());
            restriction.setFieldPath(field.getPath());
            restriction.setOperator(Operator.determineOperator(descr.getEvaluator(),
                    descr.isNegated()));
            restriction.setVariablePath(patternVariable.getPath());
            restriction.setVariableName(base);
            restriction.setVariablePath(fieldName);
            restriction.setOrderNumber(orderNumber);
            restriction.setParentPath(pattern.getPath());
            restriction.setParentType(pattern.getVerifierComponentType());

            // Set field value, if it is not set.
            field.setFieldType(Field.VARIABLE);

            data.add(restriction);
            solvers.addPatternComponent(restriction);
        } else {

            EnumField enumField = (EnumField) data.getFieldByObjectTypeAndFieldName(base,
                    fieldName);
            if (enumField == null) {

                ObjectType objectType = data.getObjectTypeByFullName(base);

                if (objectType == null) {
                    Import objectImport = data.getImportByName(base);

                    if (objectImport != null) {
                        objectType = ObjectTypeFactory.createObjectType(descr,objectImport);
                    } else {
                        objectType = ObjectTypeFactory.createObjectType(descr,base);
                    }

                    data.add(objectType);
                }

                enumField = new EnumField(descr);

                enumField.setObjectTypePath(objectType.getPath());
                enumField.setObjectTypeName(objectType.getName());
                enumField.setName(fieldName);

                objectType.getFields().add(enumField);

                data.add(enumField);
            }

            EnumRestriction restriction = new EnumRestriction(pattern);

            restriction.setPatternIsNot(pattern.isPatternNot());
            restriction.setFieldPath(field.getPath());
            restriction.setOperator(Operator.determineOperator(descr.getEvaluator(),
                    descr.isNegated()));
            restriction.setEnumBasePath(enumField.getPath());
            restriction.setEnumBase(base);
            restriction.setEnumName(fieldName);
            restriction.setOrderNumber(orderNumber);
            restriction.setParentPath(pattern.getPath());
            restriction.setParentType(pattern.getVerifierComponentType());

            // Set field value, if it is not set.
            field.setFieldType(Field.ENUM);

            data.add(restriction);
View Full Code Here

Examples of org.drools.verifier.components.QualifiedIdentifierRestriction

        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        saveVerifierComponentAndGet( LiteralRestriction.createRestriction( pattern,
                                                                           "" ) );
        saveVerifierComponentAndGet( new EnumRestriction( pattern ) );
        saveVerifierComponentAndGet( new QualifiedIdentifierRestriction( pattern ) );
        saveVerifierComponentAndGet( new ReturnValueRestriction( pattern ) );
        saveVerifierComponentAndGet( new ReturnValueRestriction( pattern ) );
        saveVerifierComponentAndGet( new VariableRestriction( pattern ) );
    }
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.