Re: [rules-users] For loop inside a modify block problem

2012-01-12 Thread Wolfgang Laun
. >> > I can't figure out what might be causing this. >> > >> > Thanks >> > >> > On Tue, Jan 10, 2012 at 10:08 PM, Davide Sottara >> wrote: >> > >> >> Did you remember to bind $item to some expression in the LHS ? Maybe

Re: [rules-users] For loop inside a modify block problem

2012-01-12 Thread Martin A
ht be causing this. > > > > Thanks > > > > On Tue, Jan 10, 2012 at 10:08 PM, Davide Sottara > wrote: > > > >> Did you remember to bind $item to some expression in the LHS ? Maybe you > >> just > >> called that "item" without th

Re: [rules-users] For loop inside a modify block problem

2012-01-12 Thread Wolfgang Laun
, Davide Sottara wrote: > >> Did you remember to bind $item to some expression in the LHS ? Maybe you >> just >> called that "item" without the $ :) >> Davide >> >> (the original "modify" syntax is still wrong anyway) >> >> -- &

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Davide Sottara
users-For-loop-inside-a-modify-block-problem-tp3648460p3651214.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Martin A
; rules-users-boun...@lists.jboss.org] *On Behalf Of *Mark Proctor > *Sent:* 11 January 2012 15:27 > *To:* rules-users@lists.jboss.org > > *Subject:* Re: [rules-users] For loop inside a modify block problem > > ** ** > > Why no braces after SomeBusinessLogic? > >

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Swindells, Thomas
From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Mark Proctor Sent: 11 January 2012 15:27 To: rules-users@lists.jboss.org Subject: Re: [rules-users] For loop inside a modify block problem Why no braces after SomeBusinessLogic? Also your logic

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Mark Proctor
expression in the LHS ? Maybe you just called that "item" without the $ :) Davide (the original "modify" syntax is still wrong anyway) -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-For-loop-inside-a-modify-block

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Martin A
Is this literally your rule? This one is missing () after > SomeBusinessLogic, > which might be confusing the parser... > > -- > View this message in context: > http://drools.46999.n3.nabble.com/rules-users-For-loop-inside-a-modify-block-problem-tp3648460p3650235.html > Sent

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Davide Sottara
.nabble.com/rules-users-For-loop-inside-a-modify-block-problem-tp3648460p3650235.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Martin A
27;... > > I can't figure out what might be causing this. > > ** ** > > Thanks**** > > ** ** > > On Tue, Jan 10, 2012 at 10:08 PM, Davide Sottara wrote: > > > Did you remember to bind $item to some expression in the LHS ? Maybe you > jus

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Martin A
ntity, and says 'no >>> such identifier $item'... >>> I can't figure out what might be causing this. >>> >>> Thanks >>> >>> On Tue, Jan 10, 2012 at 10:08 PM, Davide Sottara wrote: >&

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Swindells, Thomas
il.com>> wrote: Did you remember to bind $item to some expression in the LHS ? Maybe you just called that "item" without the $ :) Davide (the original "modify" syntax is still wrong anyway) -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-For-

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Martin A
gure out what might be causing this. >> >> Thanks >> >> On Tue, Jan 10, 2012 at 10:08 PM, Davide Sottara wrote: >> >>> Did you remember to bind $item to some expression in the LHS ? Maybe you >>> just >>> called that "item" with

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Michael Anstis
Maybe you >> just >> called that "item" without the $ :) >> Davide >> >> (the original "modify" syntax is still wrong anyway) >> >> -- >> View this message in context: >> http://drools.46999.n3.nabble.com/rules-users-For-loop-

Re: [rules-users] For loop inside a modify block problem

2012-01-11 Thread Martin A
n in the LHS ? Maybe you > just > called that "item" without the $ :) > Davide > > (the original "modify" syntax is still wrong anyway) > > -- > View this message in context: > http://drools.46999.n3.nabble.com/rules-users-For-loop-inside-a-modify-block-pr

Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Davide Sottara
Did you remember to bind $item to some expression in the LHS ? Maybe you just called that "item" without the $ :) Davide (the original "modify" syntax is still wrong anyway) -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-For-loop-inside-a-

Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Mauricio Salatino
what is this doing: for (int i = 0; i < $item.quantity; i++) { $gsc.doSomethingElse($item.id); } "i" is not being used inside the $gsc.doSomethingElse($item.id); sentence.. that means that you are executing that always with the same parameter.. do you really need that? By the way

Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Martin A
Strangely, after making the changes, that 'for' loop makes the Drools engine to come up with the same error (no such identifier). I commented the loop and it does not throw that error. Any ideas why this happens? Thanks On Tue, Jan 10, 2012 at 9:04 PM, Martin A wrote: > Hi, Mauricio, > > Than

Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Martin A
Hi, Mauricio, Thanks for the help.. but what do you mean by ' that loop is not doing anything ' Regards, Martin On Tue, Jan 10, 2012 at 8:59 PM, Mauricio Salatino wrote: > yeah.. sort of.. > you can do > > $gsc.doSomething($item.id); > for (int i = 0; i < $item.quantity; i++) { >

Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Mauricio Salatino
yeah.. sort of.. you can do $gsc.doSomething($item.id);   for (int i = 0; i < $item.quantity; i++) {            $gsc.doSomethingElse($item.id);   } update($gsc); but by the way.. that loop is not doing anything .. 2012/1/10 Martin A : > Hello, > > I suppose that means something like: > >      

Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Martin A
Hello, I suppose that means something like: modify ($gsc) { doSomething($item.id); } for (int i = 0; i < $item.quantity; i++) { $gsc.doSomethingElse($item.id); } update($gsc); Thanks, Martin 2012/1/10 Wolfgang Laun > No can do,

Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Wolfgang Laun
No can do, because within a modify block a comma-separated list of (setter) method calls of the object between the parentheses must be written. Note that you can change a fact (without a modify statement) - just follow this with an update call. See the Expert manual for details. -W 2012/1/10 M

Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Mauricio Salatino
You just need to do the loop outside the modify block and then just update the object. Cheers 2012/1/10 Martin A : > Hello, guys, > > I have the following snippet of a right side rule: > > >         modify ($gsc) { >             doSomething($item.id); > >             for (int i = 0; i < $item.quan

[rules-users] For loop inside a modify block problem

2012-01-10 Thread Martin A
Hello, guys, I have the following snippet of a right side rule: modify ($gsc) { doSomething($item.id); for (int i = 0; i < $item.quantity; i++) { doSomethingElse($item.id); } } which looks like is invalid syntax in some way, b