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

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


    {
      // create the statefulRuleInfo (including the channels)
      ConfigTree config = ConfigTree.fromXml(xml);
      Map<String,Channel> channel_map = RuleServiceCallHelper.getChannels(config);
      channel_map.remove("channel_3");
    RuleInfo ruleInfo = new RuleInfoBuilder("RuleServiceCallHelper.drl").channels(channel_map).build();
    StatefulRuleInfo statefulRuleInfo = new StatefulRuleInfoImpl(ruleInfo, true, false);
   
    // create the message
    Message message = MessageFactory.getInstance().getMessage();
   
View Full Code Here


  }
 
  @Test ( expected = IllegalArgumentException.class )
  public void shouldThrowIfRuleFileIsNull() throws RuleServiceException
  {
    RuleInfo ruleInfo = new RuleInfoBuilder(NULL_RULE_FILE).dslSource(NULL_DSL_FILE).build();
    helper.createRuleBaseFromRuleFiles( ruleInfo );
  }
View Full Code Here

  }
 
  @Test
  public void createRuleBaseFromRuleFiles() throws RuleServiceException
  {
    RuleInfo ruleInfo = new RuleInfoBuilder("RuleBaseHelper.drl").dslSource(NULL_DSL_FILE).build();
    KnowledgeBase ruleBase = helper.createRuleBaseFromRuleFiles( ruleInfo );
   
    assertNotNull( ruleBase );
    assertTrue( ruleBase.getKnowledgePackages().size() > 0 );
    assertEquals( "org.jboss.internal.soa.esb.rules" , ruleBase.getKnowledgePackages().iterator().next().getName());
View Full Code Here

  }
 
  @Test ( expected = IllegalArgumentException.class )
  public void shouldThrowIfDecisionTableIsNull() throws DroolsParserException, IOException, RuleServiceException
  {
    RuleInfo ruleInfo = new RuleInfoBuilder(NULL_DECISION_TABLE_FILE).build();
    helper.createRuleBaseFromDecisionTable( ruleInfo );
  }
View Full Code Here

  }
 
  @Test
  public void createRuleBaseFromDecisionTable() throws RuleServiceException
  {
    RuleInfo ruleInfo = new RuleInfoBuilder("RuleBaseHelper.xls").build();
    KnowledgeBase ruleBase = helper.createRuleBaseFromDecisionTable( ruleInfo );
    assertNotNull( ruleBase );
    assertEquals( "org.jboss.internal.soa.esb.rules", ruleBase.getKnowledgePackages().iterator().next().getName());
  }
View Full Code Here

  }
 
  @Test
  public void getSpreadSheetRules() throws RuleServiceException
  {
    RuleInfo ruleInfo = new RuleInfoBuilder("RuleBaseHelper.xls").build();
    KnowledgeBase spreadSheetRuleBase = helper.createRuleBaseFromDecisionTable( ruleInfo );
    assertNotNull( spreadSheetRuleBase );
  }
View Full Code Here

      file = File.createTempFile(clazz.getSimpleName() + "-", ".properties");
      Properties properties = new Properties();
      properties.setProperty(RuleAgent.URLS, clazz.getResource("/testrules.pkg").toString());
      os = new FileOutputStream(file);
      properties.store(os, clazz.getSimpleName());
      RuleInfo ruleInfo = new RuleInfoBuilder(file.getAbsolutePath()).build();
      KnowledgeAgent ka = helper.createRuleAgent(ruleInfo);
        kpkg = ka.getKnowledgeBase().getKnowledgePackage("org.jboss.internal.soa.esb.rules");

    }
    finally
View Full Code Here

  @Test
  public void executeStatelessRules()
  {
    Map<String,Object> globals = getGlobalsWithDestAndMessage();
    RuleInfo ruleInfo = new RuleInfoBuilder().globals(globals).build();
    message = ruleBaseState.executeStatelessRules( ruleInfo, message );
    ArrayList<String> destinations = getDestinations( globals );
    assertTrue( destinations.size() == 1 );
  }
View Full Code Here

 
  @Test
    public void executeStatefulRulesWithFireUntilHalt() throws InterruptedException, RuleServiceException
    {
    Map<String,Object> globals = getGlobalsWithDestAndMessage();
    final RuleInfo ruleInfo = new RuleInfoBuilder("JBossESBRules.drl")
      .globals(globals).ruleFireMethod(FIRE_UNTIL_HALT.name()).build();
   
    StatefulRuleInfoImpl waitRuleInfo = new StatefulRuleInfoImpl(ruleInfo, false, false);
    // this kicks off a new thread because of FIRE_UNTIL_HALT
    ruleService.executeStatefulRules(waitRuleInfo, message);
View Full Code Here

  @Test
  public void executeStatelessRulesFromDecisionTableReload() throws RuleServiceException
  {
    Map<String,Object> globals = getGlobalsWithDest();
    final String decisionTable = "RuleBaseHelper.xls";
    RuleInfo ruleInfo = new RuleInfoBuilder(decisionTable).reload(true).globals(globals).build();
    message = ruleService.executeStatelessRulesFromDecisionTable( ruleInfo, message );
    ArrayList<String> destinations = getDestinations( globals );
    assertTrue( destinations.size() == 1 );
  }
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.