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

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


      // 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();
   
    // execute the rules (which will execute the channels)
View Full Code Here


      String filePath = file.getAbsolutePath();
      file.delete();
      assertFalse(file.exists());
        builder.auditFile(filePath.substring(0, filePath.length()-4));
       
        StatefulRuleInfo ruleInfo = new StatefulRuleInfoImpl(builder.build(), true, false);
          message = ruleService.executeStatefulRules(ruleInfo, message);
          ArrayList<String> destinations = getDestinations( globals );
          assertTrue( destinations.size() == 1 );
         
          file = new File(filePath);
View Full Code Here

        break;
      }
      Thread.sleep(1000);
    } while (!success);

    StatefulRuleInfo haltRuleInfo = new StatefulRuleInfoImpl(ruleInfo, true, true);
    // this halts the kicked-off thread
    ruleService.executeStatefulRules(haltRuleInfo, message);
   
    assertTrue(success);
    }
View Full Code Here

  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

    builder.defaultFact(message);

    // OrderEntryPoint that matches the entry-point name in PricingRulesStatfulEntryPoint.drl.
    builder.fact("OrderEntryPoint", objectMapper.getObjectFromMessage(message, "body.Order"));
        // process message
    StatefulRuleInfo statefulInfo = new StatefulRuleInfoImpl(builder.build(), false, true);
        message = ruleService.executeStatefulRules(statefulInfo, message);

        assertEquals( 20.0, order.getDiscount(), 0 );
        assertEquals( "20%" ,message.getBody().get("DiscountObject"));
View Full Code Here

    builder.defaultFact(objectMapper.getObjectFromMessage(message, "body.Counter"));

        // Non Existing entry-point name.
        builder.fact("Bajja", objectMapper.getObjectFromMessage(message, "body.Order"));
        // process message
    StatefulRuleInfo statefulInfo = new StatefulRuleInfoImpl(builder.build(), true, false);
        ruleService.executeStatefulRules(statefulInfo, message);
    }
View Full Code Here

       
        // validates (explicitContinueState && (diposeProperty != null))
        final boolean explicitContinueState = isExplicitContinueState(message);
        final boolean continueState = explicitContinueState || isContinueStateOrDefault(message);
       
        final StatefulRuleInfo statefulRuleInfo = new StatefulRuleInfoImpl(ruleInfo, dispose, continueState);
       
        if (explicitContinueState)
        {
            return ruleService.continueStatefulRulesExecution(statefulRuleInfo, message);
        }
View Full Code Here

TOP

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

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.