[rules-users] storing array in variable!

Edson Tirelli tirelli at post.com
Thu Sep 6 10:24:36 EDT 2007


   I believe that this happens because of the usage of x.y.z (nested
accessors). When using nested accessors, I think the engine is assuming the
result is a single object and not an array.
   Can you please open a jira for it and attach a test case?

   I will fix that for 4.0.2.

   Thanks.

    []s
    Edson

2007/9/6, vamshidhar reddy chitti <chvreddy2001 at yahoo.de>:
>
> Hello Mr Edson,
> I tried using memberOf , but i get
> java.lang.ClassCastException: Can't check if an attribute is member of an
> object of class class [Ljava.lang.String;
>
> here is my code
>
> MyFact($arraystore : x.y.z)
> MyAnotherFact(a memberOf $arraystore)
>
> where z is an string of array
> and MyAnotherFact.a is a string
>
> waiting for ur reply
>
> thank you
> vamshi
>
> *Edson Tirelli <tirelli at post.com>* schrieb:
>
>
>     Yes, but use "memberOf" instead of "in":
>
> rule XYZ
> when
>     MyFact( $array : arrayAttr )
>     AnotherFact( attr memberOf $array )
> then
>     ...
> end
>
>     []s
>     Edson
>
> 2007/9/5, vamshidhar reddy chitti <chvreddy2001 at yahoo.de>:
> >
> > hi
> > how to store array of string values in a variable and later checking for
> > some value to be in that array..
> > for example
> > String[] str = new String[] { "Spouse", "Annuitant", "Nominee" };
> >
> > am trying to store like this
> > $test1 : Object($example : str)
> > is it right?
> >
> > and i need to compare like Object2 ( x in ($example) )
> >
> > my rule doesnt fire..
> >
> > please help me..
> >
> > tnx
> > vamshi
> > ------------------------------
> > Beginnen Sie den Tag mit den neuesten Nachrichten. Machen Sie Yahoo! zu
> > Ihrer Startseite!
> > <http://de.rd.yahoo.com/evt=41213/*http://de.yahoo.com/set>
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
>   Edson Tirelli
>   Software Engineer - JBoss Rules Core Developer
>   Office: +55 11 3529-6000
>   Mobile: +55 11 9287-5646
>   JBoss, a division of Red Hat @ www.jboss.com_______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> ------------------------------
> Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr
> Wissen.
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070906/f2946632/attachment.html 


More information about the rules-users mailing list