Hi,

I have been running more test cases on Drools-Guvnor, 5.1.0.M2, and I found a 
solution for the question 3) I had on my initial email thread.

As for the 1), and 2), here is more context, hope that will help in 
debugging/solving my issues, as I am stuck at this point.

1) I need to create a BRL with the IN conditional element for the Fact field 
that is Text type.
I can do that when creating a technical rule, but I see no option for the BRL 
with guided editor. The option for the text fields are (equals, not equal, 
matches, sounds like). 
However, even with the technical rule there seem to be some issues. First, I 
can compile and verify the technical rule OK, but when I ran a test for the 
technical rule, I got an error that I pasted below. Here is the technical rule 
with the IN condition:

when
    #conditions
    $assignmentRule: 
RequestItemAssignmentRule(approvalLevel=="Approval_Level_1")
    Attribute(code=="EQUIPMENT_FAMILY",uvalue in ("200","300")) 
then
    #actions
    modify ($assignmentRule){assignTo="admin", assignToId="394394993"}

The error when I ran the test for this technical rule, is:

Error: Unable to determine the used declarations.
java.lang.Class cannot be cast to org.mvel2.util.MethodStub


2) I have a decision table manually created, that is using for one of the 
conditions this formula (with FROM and IN for the field):

Attribute(code=="DISCIPLINE" && uvalue in ($param)) from 
assignmentRule.getAttributes() 

The drools engine loads the decision table and executes it correctly in the 
app. 

What I try to do, is to create a decision table in Guvnor, using the guided 
editor, and set the same condition for one of the fields. But I cannot find how 
to do this. On the editor, it says that I can use Predicate in order to 
evaluate an expression and use $param, but when I select the "Predicates" 
option on the editor, it says for both Field and Operator that "(not needed for 
predicate)", and I cannot enter anything.

What am I doing wrong? I appreciate a lot for any insight/hint, or solution.

Thanks,
Patricia






--- On Sun, 7/18/10, Patricia Bogoevici <patriciabogoev...@yahoo.com> wrote:

From: Patricia Bogoevici <patriciabogoev...@yahoo.com>
Subject: Re: [rules-users] How to configure conditional elements (IN, FROM) in 
Guvnor and more
To: "Rules Users List" <rules-users@lists.jboss.org>
Cc: "rules-users@lists.jboss.org" <rules-users@lists.jboss.org>
Date: Sunday, July 18, 2010, 11:30 AM

Hi,

Oh, right. I am using 5.1.0.M2.

Thanks,
Patricia


--- On Sun, 7/18/10, Salaboy <sala...@gmail.com> wrote:

From: Salaboy <sala...@gmail.com>
Subject: Re: [rules-users] How to configure conditional elements (IN, FROM) in 
Guvnor and more
To: "Rules Users List" <rules-users@lists.jboss.org>
Cc: "rules-users@lists.jboss.org" <rules-users@lists.jboss.org>
Date: Sunday, July 18, 2010, 11:17 AM

Which version of guvnor are you using? 

- CTO @ http://www.plugtree.com- MyJourney @ http://salaboy.wordpress.com- 
Co-Founder @ http://www.jbug.com.ar- Mauricio "Salaboy" Salatino -
On Jul 18, 2010, at 4:22, Patricia Bogoevici <patriciabogoev...@yahoo.com> 
wrote:

Hi,

I am evaluating Drools Guvnor for our application, and I am stuck with a few 
things. I appreciate a lot, if someone can help me, or give me some hints. 

1) How can I
 configure Guvnor, BRL Guided Editor, to allow for IN conditional element?
By default, when I create a new package, and then create a new BRL rule, I have 
these options for a text Fact field:
- equal
- not equal
- matches
- sounds
I do have the IN conditional element for the Decision Table rule - "is 
contained in the a (comma separated) list". 

2) How can I configure Guvnor, Decision table, to use the FROM condition 
element?
I have a fact, Fact1, that contains a list of Fact2. The condition I need to 
configure in the Decision Table, is to iterate the collection of Fact2 objects 
that is on the Fact1, and apply constraints on Fact2 fields. 

3) How
 can I insert a list of facts when testing a rule? My test case is the 
following:
I have a Fact1, which contains a list of Fact2. And the rule, is expecting to 
get Fact1, with a list of Fact2 inside. 
When I create the Fact1, and add the collection field, it shows the option to 
create a guided list where I can specify a literal value, or a variable. But 
there is nowhere to create a Fact2 with its fields. I did inserted 2 separate 
Fact2 objects, but how I can link these 2 objects to the collection of the 
Fact1?

Thanks in advance,
Patricia








      _______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

-----Inline Attachment Follows-----

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



      
-----Inline Attachment Follows-----

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



      
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to