[
https://jira.jboss.org/browse/JBESB-2831?page=com.atlassian.jira.plugin.s...
]
David Ward closed JBESB-2831.
-----------------------------
Resolution: Done
Committed revision 34210. (trunk)
The concept of ExitPoint in Drools is deprecated. The new name is Channel, so that is
what was added. You can now specify a channels property as in the example below:
<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>
The first kind is one we provide out of the box, which constructs a new Message containing
the object sent to the channel on the right-hand-side of the rule, like so:
channels["mychannel"].send(myobject);
and sends it to a target ESB Service using ServiceInvoker
The second kins is if someone wants to implement org.drools.runtime.Channel themselves.
They need a public no-arg constructor, but if they want it configurable, they just have to
implement the org.jboss.soa.esb.Configurable interface, and it will be called from the
ESB.
Description of these are in detail in the Services Guide, as well as in javadoc and
lightly in Programmers Guide.
Add Exit Point support to BusinessRulesProcessor
------------------------------------------------
Key: JBESB-2831
URL:
https://jira.jboss.org/browse/JBESB-2831
Project: JBoss ESB
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Reporter: Jeff DeLong
Assignee: David Ward
Fix For: 4.9
ExitPoint support should be provided with BusinessRulesProcess. This would allow one or
more ExitPoints to be declared in the ESB service configuration. Basically exit point
support would take the object inserted into the exit point from the rule, create a new
ESBMessage, copy the object into the ESB Message based on the exit point configuration,
and send the ESB message to a configured "destination" (similar to a router
configuration).
This would require configuration such as
<action class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
name="OrderCountHistory">
<property name="ruleSet" value="OrderCount.drl"/>
<property name="ruleReload" value="true"/>
<property name="stateful" value="true"/>
<property name="object-paths">
<object-path entry-point="OrderEntryPoint"
esb="body.TheOrderHeader"/>
</property>
<property name="exitPoint value="OrderExitPoint"
<route-to destination-name="x" service-category="y"
service-name="z"/>
<need to either use set-payload-location or object mapper to map location of
added data in new message>
</property>
</action>
The configuration of multiple exit points should be allowed.
A class would then need to be added that implemented the ExitPointInterface and was
instantiated and configured from the BusinessRulesProcessor such as:
public class RulesExitPointServiceInvoker implements ExitPoint
{
// constructor with configuration details
// service category, service name, and object mapping or set-payload-location details
// required method
public void insert(Object object) {
try {
ServiceInvoker invoker = new ServiceInvoker(service-category, service-name);
Message requestMessage;
requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
// add payload stuff /object mapping
requestMessage.getBody().add(object);
invoker.deliverAsync(requestMessage);
} catch (MessageDeliverException mde) {
System.out.println("Eating this Exception: " + mde);
}
}
}
where the BRP code looked like:
RulesExitPointServiceInvokerr exit = new RulesExitPointServiceInvoker();
KnowledgeRuntime kruntime = (KnowledgeRuntime) ksession.getEnvironment();
kruntime.registerExitPoint("exit-point", exit);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira