On 05/16/2012 09:06 AM, Wolfgang Laun wrote:
On 16/05/2012, Joe Ammann <joe(a)pyx.ch> wrote:
> On 05/15/2012 07:24 PM, Wolfgang Laun wrote:
>> Assuming you can get hold of the resulting DRL text, a simple script
>> might detect rules where there is nothing between "then" and
"end".
> I have currently implemented something similar. A REST client that
> periodically scans the BRLs in certain Guvnor packages and fills out
> missing RHS. Problem is that the users try to test their broken rules
> faster than this script can fix them :-/
You can easily design your DSL/DSLR in such a way that the expanded text is
jinxed, to be rectified by your scanning script. That way, they won't be
able to exec without some Joe's blessing ;-)
:-) I like this!
> I was looking for exactly that: an option to replace or inject custom
> extensions to what you refer to as "Guvnor's validator". But I must
> admit that I was not able to find any pointer to this in the doc or
> the Guvnor source. Can you point me to the place in the Guvnor source
> where that validation actually happens? I might then be able to
> develop some ideas.
There's drools-verifier-5.4.0.Beta2-sources.jar in Expert's sources. Look at
org/drools/verifier/Consequence.drl
The first rule is called "No action - possibly commented out".
Had a look
at this and I think this will be the way for me: Implement my
own set of verifier rules. It still don't quite understand how I would
"plug" these rules into Guvnor, but I guess I'll just have to do some
source reading :-)
--
CU, Joe