[rules-users] For each loop in drools
Tina Vießmann
tviessmann at stud.hs-bremen.de
Thu Aug 12 15:28:20 EDT 2010
Ok, I know what my problem is. Some mails ago I've asked about a problem
using a generic set. Because defining a generic set inside a DRL file
doesn't work, I'm using a non-generic set. And because of that the
object is of the type Object and not of the type ParameterValue. So I
have to make a cast.
Sorry for bothering you. :-/
Thanks anyone! :)
Tina
> Yeah, I think using a normal for loop is better. I just came up with
> the question because I wanted to use a for-each-loop in a simple
> exercise-scenario, because it's a bit faster to write...
>
> Anyway, what I wanted to do is:
>
> for (Value value : $eventSet) {
> // raise hell
> }
>
> Thats where I get the type mismatch.
>
>
> Thanks :)
> Tina
>
>
>> E.g., Joshua Bloch, "Effective Java", Item 46: Prefer *for-each
>> loops* to traditional for loops. Plain old Java.
>> -W
>>
>> 2010/8/12 Mauricio Salatino <salaboy at gmail.com
>> <mailto:salaboy at gmail.com>>
>>
>> Probably I misread the question.. I thought that Tina was asking
>> about for each loops in Drools Flow.
>> If not where are you using for each??
>> A java for each each node in the RHS?
>>
>> Greetings.
>>
>> 2010/8/12 Wolfgang Laun <wolfgang.laun at gmail.com
>> <mailto:wolfgang.laun at gmail.com>>
>>
>> I'm not sure whether you and Salboy are on the same
>> wavelength. Tina, please do provide more
>> details where and what you want to for-each-loop. Guessing is
>> a waste of time...
>> -W
>>
>> 2010/8/12 Tina Vießmann <tviessmann at stud.hs-bremen.de
>> <mailto:tviessmann at stud.hs-bremen.de>>
>>
>> Oh, do I need a loop xml definition? Good to know. -.-
>>
>> Could you give me a link with a good explanation/example
>> about how to do this?
>>
>> Thanks :)
>>
>> Tina
>>
>>
>>> The for each loop in Drools Flow recieves a list of
>>> objects to iterate over it.
>>> Can you share your loop xml definition? and can you
>>> check that the variable that it's using is a list?
>>>
>>>
>>> On Thu, Aug 12, 2010 at 1:08 PM, Tina Vießmann
>>> <tviessmann at stud.hs-bremen.de
>>> <mailto:tviessmann at stud.hs-bremen.de>> wrote:
>>>
>>> Hi,
>>>
>>> is it possible to use the for each loop in Drools?
>>> The engine grouses a type mismatch : cannot convert
>>> from element type
>>> Object to Value
>>>
>>> Thanks :)
>>> Tina
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users at lists.jboss.org
>>> <mailto:rules-users at lists.jboss.org>
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>>
>>>
>>>
>>> --
>>> - CTO @ http://www.plugtree.com
>>> - MyJourney @ http://salaboy.wordpress.com
>>> - Co-Founder @ http://www.jbug.com.ar
>>>
>>> - Salatino "Salaboy" Mauricio -
>>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> <mailto:rules-users at lists.jboss.org>
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>>
>>
>> --
>> - CTO @ http://www.plugtree.com
>> - MyJourney @ http://salaboy.wordpress.com
>> - Co-Founder @ http://www.jbug.com.ar
>>
>> - Salatino "Salaboy" Mauricio -
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100812/4dd34c1c/attachment.html
More information about the rules-users
mailing list