Examples of LiteralRestriction


Examples of org.drools.verifier.components.LiteralRestriction

     */
    @Test
    public void testAddOrAnd() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction3 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );

        PatternSolver solver = new PatternSolver( pattern );

        solver.addOperator( OperatorDescrType.OR );
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

     */
    @Test
    public void testAddAndOr() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction3 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );

        PatternSolver solver = new PatternSolver( pattern );

        solver.addOperator( OperatorDescrType.AND );
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

     */
    @Test
    public void testAddAndOrOr() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction3 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction4 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );

        PatternSolver solver = new PatternSolver( pattern );

        solver.addOperator( OperatorDescrType.AND );
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

     */
    @Test
    public void testAddOrAndAnd() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction3 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction4 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );

        PatternSolver solver = new PatternSolver( pattern );

        solver.addOperator( OperatorDescrType.OR );
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

     */
    @Test
    public void testAddOrAndOr() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction3 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction4 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );

        PatternSolver solver = new PatternSolver( pattern );

        solver.addOperator( OperatorDescrType.OR );
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

     */
    @Test
    public void testAddOrAndOrDescr() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction3 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction4 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
        LiteralRestriction literalRestriction5 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );

        PatternSolver solver = new PatternSolver( pattern );

        solver.addOperator( OperatorDescrType.AND );
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

     *
     * @param descr
     */
    private void visit(LiteralRestrictionDescr descr) {

        LiteralRestriction restriction = LiteralRestriction.createRestriction( pattern,
                                                                               descr.getText() );

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

        // Set field value, if it is unset.
        field.setFieldType( restriction.getValueType() );

        data.add( restriction );
        solvers.addPatternComponent( restriction );
    }
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

   * @param descr
   */
  private void flatten(LiteralRestrictionDescr descr,
      VerifierComponent parent, int orderNumber) {

    LiteralRestriction restriction = new LiteralRestriction();

    restriction.setRuleId(currentRule.getId());
    restriction.setRuleName(currentRule.getRuleName());
    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.setValue(descr.getText());
    restriction.setOrderNumber(orderNumber);
    restriction.setParent(parent);

    // Set field value, if it is unset.
    currentField.setFieldType(restriction.getValueType());

    data.add(restriction);
    solvers.addRestriction(restriction);
  }
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

    }

    for (Restriction r : restrictions) {
      if (r instanceof LiteralRestriction) {
        try {
          LiteralRestriction restriction = (LiteralRestriction) r;

          dt.put(restriction.getValueAsObject(), new DataRow(
              restriction.getRuleId(), restriction.getRuleName(),
              restriction.getOperator(), restriction
                  .getValueAsString()));
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

     *
     * @param descr
     */
    private void visit(LiteralRestrictionDescr descr) {

        LiteralRestriction restriction = LiteralRestriction.createRestriction(pattern,
                descr.getText());

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

        // Set field value, if it is unset.
        field.setFieldType(restriction.getValueType());

        data.add(restriction);
        solvers.addPatternComponent(restriction);
    }
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.