Package org.jboss.soa.esb.services.rules

Examples of org.jboss.soa.esb.services.rules.RuleInfo


  @Test
  public void executeStatelessRulesFromDecisionTable() throws RuleServiceException
  {
    Map<String,Object> globals = getGlobalsWithDest();
    final String decisionTable = "RuleBaseHelper.xls";
    RuleInfo ruleInfo = new RuleInfoBuilder(decisionTable).reload(false).globals(globals).build();
    StatefulRuleInfo statefulRuleInfo = new StatefulRuleInfoImpl(ruleInfo, false, false);
    message = ruleService.executeStatelessRulesFromDecisionTable( statefulRuleInfo, message );
    ArrayList<String> destinations = getDestinations( globals );
    assertTrue( destinations.size() == 1 );
  }
View Full Code Here


  @Test
  public void executeStatefulRulesFromDecisionTableReload() throws RuleServiceException
  {
    Map<String,Object> globals = getGlobalsWithDest();
    final String decisionTable = "RuleBaseHelper.xls";
    final RuleInfo ruleInfo = new RuleInfoBuilder(decisionTable).reload(true).globals(globals).build();
    final StatefulRuleInfoImpl statefulRuleInfo = new StatefulRuleInfoImpl(ruleInfo, false, false);
    message = ruleService.executeStatefulRulesFromDecisionTable( statefulRuleInfo, message );
    ArrayList<String> destinations = getDestinations( globals );
    assertTrue( destinations.size() == 1 );
  }
View Full Code Here

  @Test
  public void executeStatefulRulesFromDecisionTable() throws RuleServiceException
  {
    Map<String,Object> globals = getGlobalsWithDest();
    final String decisionTable = "RuleBaseHelper.xls";
    final RuleInfo ruleInfo = new RuleInfoBuilder(decisionTable).reload(false).globals(globals).build();
    final StatefulRuleInfoImpl statefulRuleInfo = new StatefulRuleInfoImpl(ruleInfo, false, false);
    message = ruleService.executeStatefulRulesFromDecisionTable( statefulRuleInfo, message );
    ArrayList<String> destinations = getDestinations( globals );
    assertTrue( destinations.size() == 1 );
  }
View Full Code Here

  @Test
  public void executeStatefulRules() throws RuleServiceException
  {
    Map<String,Object> globals = getGlobalsWithDestAndMessage();
    final RuleInfo ruleInfo = new RuleInfoBuilder("JBossESBRules.drl").reload(true).globals(globals).build();
    final StatefulRuleInfoImpl statefulRuleInfo = new StatefulRuleInfoImpl(ruleInfo, false, false);
    message = ruleService.executeStatefulRules( statefulRuleInfo, message );
    ArrayList<String> destinations = getDestinations( globals );
    assertTrue( destinations.size() == 1 );
  }
View Full Code Here

  @Test
  public void executeStatefulRulesDrl() throws RuleServiceException
  {
    Map<String,Object> globals = getGlobalsWithDestAndMessage();
    RuleInfo ruleInfo = new RuleInfoBuilder("JBossESBRules.drl").reload(true).globals(globals).build();
    StatefulRuleInfoImpl statefulRuleInfo = new StatefulRuleInfoImpl(ruleInfo, false, false);
    message = ruleService.executeStatefulRules( statefulRuleInfo, message );
    ArrayList<String> destinations = getDestinations( globals );
    assertTrue( destinations.size() == 1 );
  }
View Full Code Here

    boolean ruleReload = true;

    // first run
    long startTime = System.nanoTime();

    RuleInfo ruleInfo = new RuleInfoBuilder("RulesWithDsl.drl").dslSource("XPathLanguage.dsl").reload(ruleReload).globals(globals).build();
    message = ruleService.executeStatelessRules( ruleInfo, msg );
    ArrayList<String> destinations = getDestinations( globals );
    assertTrue( destinations.size() == 1 );

    long procTime = System.nanoTime() - startTime;
View Full Code Here

    String contents = StreamUtils.readStreamString( resourceAsStream, "UTF-8" );
    msg.getBody().add( contents );
    Map<String,Object> globals = getGlobalsWithDest();
    boolean ruleReload = true;

    RuleInfo ruleInfo = new RuleInfoBuilder("RulesWithDslNS.drl").dslSource("XPathLanguage.dsl").reload(ruleReload).globals(globals).build();
    message = ruleService.executeStatelessRules( ruleInfo, msg );
    ArrayList<String> destinations = getDestinations( globals );
    assertEquals( 3 , destinations.size() );
  }
View Full Code Here

        messagePathList.add("body.Order");
        messagePathList.add("body.Counter");

        // process message
        List<Object> objectList = new ObjectMapper().createObjectList(message, messagePathList);
    RuleInfo ruleInfo = new RuleInfoBuilder("JBossESBPricingRulesStateful.drl").reload(true).globals(globals).defaultFacts(objectList).build();
    StatefulRuleInfoImpl statefulRuleInfo = new StatefulRuleInfoImpl(ruleInfo, false, true);
    message = ruleService.executeStatefulRules( statefulRuleInfo, message );
        assertEquals( 20.0, order.getDiscount(), 0 );
        assertEquals( "20%" ,message.getBody().get("DiscountObject"));
View Full Code Here

  //  Test setup methods

  @Before
  public void setup() throws RuleServiceException
  {
    RuleInfo ruleInfo = new RuleInfoBuilder("JBossESBRules.drl").reload(true).build();
    ruleBaseState = ruleService.getRuleBaseStateForFileBasedRules(ruleInfo);
    message = MessageFactory.getInstance().getMessage();

    order = new Order();
        order.setQuantity(20);
View Full Code Here

{
    @Test
    public void ruleSet()
    {
        final RuleInfoBuilder builder = new RuleInfoBuilder("dummy.drl");
        final RuleInfo info = builder.ruleType("DRL").build();;
        assertEquals("dummy.drl", info.getRuleSource());
        assertEquals("DRL", info.getRuleType());
    }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.services.rules.RuleInfo

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.