org.jboss.soa.esb.actions
Class BusinessRulesProcessor
java.lang.Object
org.jboss.soa.esb.actions.AbstractActionLifecycle
org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
org.jboss.soa.esb.actions.ContentBasedWiretap
org.jboss.soa.esb.actions.ContentBasedRouter
org.jboss.soa.esb.actions.BusinessRulesProcessor
- All Implemented Interfaces:
- ActionLifecycle, ActionPipelineProcessor
public class BusinessRulesProcessor
- extends ContentBasedRouter
BusinessRulesProcessor extends ContentBasedRouter
but does not perform any routing, it only
executes the business rules.
Configuration Example:
<action class="org.jboss.soa.esb.actions.BusinessRulesProcessor" name="MyAction">
<property name="ruleSet" value="OrderDiscountOnMultipleOrders.drl" />
<property name="ruleReload" value="false" />
<property name="ruleFireMethod" value="FIRE_ALL_RULES" />
<property name="ruleAuditType" value="THREADED_FILE" />
<property name="ruleAuditFile" value="/tmp/event" />
<property name="ruleAuditInterval" value="1000" />
<property name="ruleClockType" value="REALTIME" />
<property name="ruleEventProcessingType" value="STREAM" />
<property name="stateful" value="true" />
<property name="object-paths">
<object-path esb="body.TheOrderHeader" />
<object-path esb="body.TheCustomer" />
<object-path esb="body.TheOrderStatus" entry-point="OrderStatusEntry" />
<object-path esb="body.TheOrderInfo" entry-point="OrderInfoEntry" />
</property>
<property name="channels">
<!-- chan1 and chan2 are equivalent (but timeout only applies if async == false) -->
<send-to channel-name="chan1" service-category="cat1" service-name="svc1" />
<send-to channel-name="chan2" channel-class="org.jboss.soa.esb.services.rules.ServiceChannel" service-category="cat1" service-name="svc1" async="true" timeout="30000" set-payload-location="org.jboss.soa.esb.message.defaultEntry" />
<!-- a custom channel -->
<send-to channel-name="chan3" channel-class="com.example.MyChannel" />
</property>
</action>
As this class extends ContentBasedRouter
please see its javadoc for
configuration descriptions that are common to both classes.
Property description:
- class action class, org.jboss.soa.esb.actions.BusinessRulesProcessor
- ruleFireMethod Optional property that defines, for StatefulKnowledgeSessions, if fireAllRules() or fireUntilHalt() should be called. Possible values are FIRE_ALL_RULES (the default) or FIRE_UNTIL_HALT.
- ruleAuditType Optional property that defines the type of KnowledgeRuntimeLogger used (CONSOLE, FILE, THREADED_FILE). If not defined and neither is ruleAuditFile, no auditing is done. If not defined but ruleAuditFile is, the assumption is THREADED_FILE.
- ruleAuditFile Optional property that defines the file path for a ruleAuditType of FILE or THREADED_FILE ("event" is the default, and ".log" is always appended).
- ruleAuditInterval Optional property that defines the interval (in milliseconds) for a ruleAuditType of THREADED_FILE (1000 is the default).
- ruleclockType Optional property that defines the type of clock used (REALTIME, PSEUDO). Default is up to drools.
- ruleEventProcessingType Optional property that defines the type of event processing used (STREAM, CLOUD). Default is up to drools.
- stateful Optional property which tells the RuleService to use a stateful session where facts will be remembered between invocations.
- object-paths Optional property to pass Message objects into Rule Services WorkingMemory. If an entry-point is specified, that will be placed in the StatefulSession's WorkingMemoryEntryPoint with the same name.
- channels A set of send-to properties each containing the logical name
of the destination along with the Service category and name
as referenced in the registry (if the default channel-class is used),
OR your own custom-class, which MUST implement org.drools.runtime.Channel,
, but MAY provide a setConfig(ConfigTree):void method.
The logical name is the name which should be used in the rule set.
- Author:
- John Doe, Daniel Bevenius
Fields inherited from class org.jboss.soa.esb.actions.ContentBasedWiretap |
_cbr, _cbrClass, _config, _destinations, _mapper, _messagePathList, _registry, _ruleLanguage, _ruleReload, _ruleSet, DEFAULT_CBR_CLASS, ENTRY_POINT, entryPointMap, messageMulticaster, OBJECT_PATH, OBJECT_PATH_TAG, ROUTE_TO_TAG |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BusinessRulesProcessor
public BusinessRulesProcessor(ConfigTree config)
throws ConfigurationException,
RegistryException,
MessageRouterException
- Throws:
ConfigurationException
RegistryException
MessageRouterException
process
public Message process(Message message)
throws ActionProcessingException
- Inspect the content of the message using a rule set
- Specified by:
process
in interface ActionPipelineProcessor
- Overrides:
process
in class ContentBasedRouter
- Parameters:
message
-
- Returns:
- Message
- Throws:
ActionProcessingException