Package org.drools.assistant.option

Examples of org.drools.assistant.option.ReplaceAssistantOption


    if (!contentInfo.getType().equals(DRLContentTypeEnum.RULE_LHS_LINE))
      return null;
    String response = VariableBinding.execute(contentInfo, offset-contentInfo.getOffset());
    if (response.equals(contentInfo.getContent()))
      return null;
    return new ReplaceAssistantOption("assign to variable", response, contentInfo.getOffset(), contentInfo.getContentLength(), offset);
  }
View Full Code Here


  }

  public void testAssignSalaryFieldToVariable() throws Exception {
    List<AssistantOption> options = ruleAssistant.getRuleAssistant(rule, 780);
    assertEquals(options.size(), 1);
    ReplaceAssistantOption assistantOption = (ReplaceAssistantOption) options.get(0);
    Assert.assertEquals("\t$employee : Employee($company : company, $company1 : oldcompany, $age : age > 80, salary $ : > 400)", assistantOption.getContent());
  }
View Full Code Here

  }

  public void testAssignLicenseFromSecondRule() throws Exception {
    List<AssistantOption> options = ruleAssistant.getRuleAssistant(rule, 930);
    assertEquals(options.size(), 1);
    ReplaceAssistantOption assistantOption = (ReplaceAssistantOption) options.get(0);
    Assert.assertEquals("\tDriver($licence : licence = 1234, $name : name)", assistantOption.getContent());
  }
View Full Code Here

  }

  public void testFirstTest() {
    List<AssistantOption> options = ruleAssistant.getRuleAssistant(rule, 150);
    assertEquals(1, options.size());
    ReplaceAssistantOption assistantOption = (ReplaceAssistantOption) options.get(0);
    Assert.assertEquals("\t\t$prueba : Prueba()", assistantOption.getContent());
  }
View Full Code Here

TOP

Related Classes of org.drools.assistant.option.ReplaceAssistantOption

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.