drools-verifier (the scaffolding thereof at least) could be used in principle.<br><br>drools-verifier builds an AST of a rule's definition that is then evaluated by some bundled validation\verification rules.<br><br>In principle you could use the AST and your own rules to perform a search.<br>
<br>Guvnor uses JCR and Lucene to perform the search based on the rules' content (sometimes DRL sometimes XML, depending on how the rule is expressed internally).<br><br>You could, in principle, extend this however you're not really getting anything better than regex on the DRL with the associated issues you have already identified.<br>
<br>Lots of "in principles" but worth a look... :)<br><br>With kind regards,<br><br>Mike<br><br><div class="gmail_quote">On 25 July 2012 11:02, Stephen Masters <span dir="ltr"><<a href="mailto:stephen.masters@me.com" target="_blank">stephen.masters@me.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks,<br>
<br>
I have been asked by my current client to evaluate search functionality which could in essence search for rules which are affected by a particular fact value.<br>
<br>
For example, if we have a number of rules similar to the following format:<br>
<br>
when<br>
$req : TradeRequest(account = 10, buyCurrency = 'EUR', buyAmount > 5000000)<br>
then<br>
TradeValidationResponse response = new TradeValidationResponse();<br>
response.setPermitted(false);<br>
response.setMessage("Account 10 is not permitted to trade more than 5000000 EUR");<br>
insert(response);<br>
end<br>
<br>
What the client is interested in is being able to search for all rules which have been defined for account 10.<br>
<br>
I was thinking to mess around with a rather quick and dirty solution to grab the package source via the REST interface and pattern match rules in a very hard-coded way for this specific use-case. However, that does look like a rather fragile way of achieving this.<br>
<br>
So I was wondering whether anybody had looked at this sort of idea previously and might have thoughts on a 'better' or more generic solution, which wouldn't be massively complicated. I was thinking that it might be nice to extend the search mechanism in Guvnor so that I could pick a fact from the model and do a search for all rules which are based on the value of an attribute. However, every time I think about how that could be achieved, it seems I come up with new ways in which it would become really difficult to pull off.<br>
<br>
Any thoughts?<br>
<br>
Cheers,<br>
<br>
Steve<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>