The rule below is doing exactly what it should. Here's the rule expressed in pseudo
code:
when
1) there's an object of type DroolsWorkingMemory
2) there's an object of type BaseType
3) there's an object of type ConcreteType1
4) the BaseType object and ConcreteType1 object are equal
then
blah, blah, blah...
end
So if you have a single ConcreteType1 object, it fits the logical conditions of the rule.
It's a BaseType, a ConcreteType1, and is equal to itself.
I don't quite understand your two issues, though.
--- On Fri, 4/9/10, Rajnikant Gupta <capricorn.raj(a)gmail.com> wrote:
From: Rajnikant Gupta <capricorn.raj(a)gmail.com>
Subject: Re: [rules-users] Tuples in Agenda Item.
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Friday, April 9, 2010, 12:01 AM
Hi,
Sorry for not being very clear. Here's the rule which I run:
package rr
import com.thirdpillar.common.util.DroolsWorkingMemoryimport com.parentchild.BaseType
import com.parentchild.ConcreteType1
rule "s"
no-loop true
salience 999999
when
DroolsWorkingMemory:DroolsWorkingMemory()
BaseType:BaseType()
ConcreteType1:ConcreteType1()
eval (
(
((BaseType.equals(ConcreteType1)))
)
)
then
BaseType.setString("Blah Blah!");
end
where ConcreteType1 extends BaseType.
Issues:
1. Even for different values for fields in ConcreteType1 and BaseType, the rule gets
fired.
2. I also do audit for the rules for which i need tuples so that I can extract the objects
out of it and evaluate the expression against Mvel. But the tuple shows me only the
ConcreteType1 instance not the BaseType. Thus getting wrong audit.
Regards,
Rajnikant Gupta
Sr. Software Engineer
GlobalLogic,Noida
09899530562
http://rkthinks.wordpress.com/
2010/4/9 Greg Barton <greg_barton(a)yahoo.com>
We need some rule code to get a better idea of what's going on. Can you post some?
--- On Thu, 4/8/10, Rajnikant Gupta <capricorn.raj(a)gmail.com> wrote:
From: Rajnikant Gupta <capricorn.raj(a)gmail.com>
Subject: [rules-users] Tuples in Agenda Item.
To: rules-users(a)lists.jboss.org
Date: Thursday, April 8, 2010, 1:36 PM
Hi,
I have a doubt regarding tuples. I created a rule using complex types objects. I am
comparing two complex type objecs which have parent-child relationship eg.
"ParentType.equals(ChildType)". I expect this to follow java rule which allows
such comparision. Now when I run the rules with different values for fields in ParentType
and ChildType (which means the rule should fail) to my surprise it evals to TRUE. Also
upon inspection, the tuple shows me only the ChildType instance not the ParentType.
I would appreciate any help on this.
Regards,
Rajnikant
-----Inline Attachment Follows-----
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
-----Inline Attachment Follows-----
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users