Red Hat Bugzilla – Bug 976673
There is no straightforward way how to return a reply from Rules component
Last modified: 2014-06-16 19:52:43 EDT
It is not possible to create a reply and return it from Rules component in a straightforward manner. The output mapping does not take neither the working memory nor the global parameters into consideration.
The best approach now is to import the "message" as global variable and setContent on it, but it would be better to allow to return just a payload of the message without using the Message object.
I agree it would be nice to be more flexible and we're open to ideas on how to do this outside the Message object. The current support in rules component allows for modification of the inserted message (e.g. policy.setApproved(true)) or assignment of different content via the Message variable. Introducing a new mechanism to handle returning output from any object in working memory or an object created in the RHS of the rule would be an enhancement and we are open to ideas. :-)
Assigning to David to get his feedback as well.
I've introduced a way to do this in https://issues.jboss.org/browse/SWITCHYARD-1554 . Please read my extensive Comment there, particularly point #4 near the bottom. ;)
Verified in ER2
Keith Babo <firstname.lastname@example.org> updated the status of jira SWITCHYARD-1554 to Closed