Hello,
when I run the code
rule "sample1"
when
$P: User( $nam : name, userId == "10", email matches "[EMAIL PROTECTED]")
$role :Role($name : name, $users: users)
then
System.out.println($P.getname());
end
there 's nothing affiched the portion RHS didn't execute
but when I remove
$role :Role($name : name, $users: users)
the result waited is affiched
but I don't remove it and I want the portion RHS execute
Marko Frankovic <[EMAIL PROTECTED]> a écrit : Try this out :
http://sourceforge.net/projects/droolsruleedit . It's in early development
stage, but it might help you.
On 4/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Drools developers,
In our specific use case we have customers who need to be able to write
validation rules and NOT have to resort to writing them in Java. Hence our
interest in using drools as an open source 'standard' to potentially replace a
proprietary rules engine we already have.
In the previous case I mentioned where I want to do this:
> *rule* "UCCnet_DVE_Depth_All"
> *when*
> catalogObject : CatalogObject( )
> String s = catalogObject.getElementValue("depth");
> *eval*( s == *null* || s == "" )
> *then*
> logWriter.logDebug("Package Depth is Blank");
> *end*
This is because potentially, in our use for data validation, there might be 50
values we need to compare against. Those values need to be on the drools (not
java) side of the world. So getting the result of
catalogObject.getElementValue("depth") into a String variable and being able to
use String methods like indexOf or multiple || cases is much more desirable
than crossing from the rule back into the object by having to call
getElementValue 50 times. There are numerous, other cases, where the result of
catalogObject.getElementValue need to be saved into a local drools variable
and evaluated multiple times without encurring the overhead of multiple calls
back into java.
Please consider enhancing drl syntax to support this use case. Is there a
bug/enhancement process for me to follow to submit this functionality request.
Thanks
John
Date: Thu, 5 Apr 2007 16:47:07 +1000
From: "Michael Neale" < [EMAIL PROTECTED]>
Subject: Re: [rules-users] RE: Need DRL authoring Help
To: "Rules Users List" < [email protected]>
Message-ID:
< [EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
OK you are really bending what you would use rules for, I really wouldn't
recommend that. flattening the object model would allow you to write rules over
it, but as it stands, its just going to be a bit difficult for you.
catalogObject : CatalogObject( )
*eval*( catalogObject.getElementValue("depth") == *null* ||
catalogObject.getElementValue ("depth") == "" )
On 4/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Ok, Thanks for the help on the drl syntax.
>
> So this works.
>
> *rule* "UCCnet_DVE_Depth_All"
> *when*
> catalogObject : CatalogObject( )
> *eval*( catalogObject.getElementValue("depth") == *null* ||
> catalogObject.getElementValue("depth") == "" )
> *then*
> logWriter.logDebug("Package Depth is Blank");
> *end*
>
> But how do I get the drl parser to accept something like this:
>
> *rule* "UCCnet_DVE_Depth_All"
> *when*
> catalogObject : CatalogObject( )
> String s = catalogObject.getElementValue("depth");
> *eval*( s == *null* || s == "" )
> *then*
> logWriter.logDebug("Package Depth is Blank");
> *end*
>
> I am getting an Unexpected token 's' InvalidRulePackage
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users
---------------------------------
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur
Yahoo! Questions/Réponses._______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users