Mini-lang equivalent to while loop

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Mini-lang equivalent to while loop

Scott Gray
Hi All

I can't seem to find anything among the minilang tags that is equivalent
to a while loop in java, can anybody point me in the right direction or
let me know if there isn't anything?

Thanks
Scott
Reply | Threaded
Open this post in threaded view
|

Re: Mini-lang equivalent to while loop

Jacopo Cappellato
Hi Scott,

have a look at the receiveInventoryProduct minilang method in:

applications\product\script\org\ofbiz\shipment\receipt\ShipmentReceiptServices.xml

you'll find an example of the <loop> operation

Jacopo


Scott Gray wrote:
> Hi All
>
> I can't seem to find anything among the minilang tags that is equivalent
> to a while loop in java, can anybody point me in the right direction or
> let me know if there isn't anything?
>
> Thanks
> Scott

Reply | Threaded
Open this post in threaded view
|

Re: Mini-lang equivalent to while loop

Jacopo Cappellato
Hmmm sorry,

however this is an equivalent for the "for" java command... I don't know
if it will help you to do what you need.

Jacopo

Jacopo Cappellato wrote:

> Hi Scott,
>
> have a look at the receiveInventoryProduct minilang method in:
>
> applications\product\script\org\ofbiz\shipment\receipt\ShipmentReceiptServices.xml
>
>
> you'll find an example of the <loop> operation
>
> Jacopo
>
>
> Scott Gray wrote:
>> Hi All
>>
>> I can't seem to find anything among the minilang tags that is
>> equivalent to a while loop in java, can anybody point me in the right
>> direction or let me know if there isn't anything?
>>
>> Thanks
>> Scott

Reply | Threaded
Open this post in threaded view
|

Re: Mini-lang equivalent to while loop

Iain Fogg
In reply to this post by Jacopo Cappellato
Jacopo,

I was testing the reception of a large(ish) purchase order and could
consistently get receiveInventoryProduct to raise an exception, although
with no useful diagnostics about what might be causing the problem.

Whenever I try to receive a shipment with several hundred items this
would occur. However, if I received the order in "chunks" of 20-30 items
everything worked fine. This points to a dynamic runtime error rather
than a program logic error, but the logs don't really give an idea of
what might be causing it.

Are there known problems with receiveInventoryProduct for big orders? I
couldn't see anything on jira...

Cheers, Iain

Jacopo Cappellato wrote:

> Hi Scott,
>
> have a look at the receiveInventoryProduct minilang method in:
>
> applications\product\script\org\ofbiz\shipment\receipt\ShipmentReceiptServices.xml
>
>
> you'll find an example of the <loop> operation
>
> Jacopo
>
>
> Scott Gray wrote:
>> Hi All
>>
>> I can't seem to find anything among the minilang tags that is
>> equivalent to a while loop in java, can anybody point me in the right
>> direction or let me know if there isn't anything?
>>
>> Thanks
>> Scott
>
>
>



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.32/523 - Release Date: 7/11/2006

Reply | Threaded
Open this post in threaded view
|

Re: Mini-lang equivalent to while loop

David E Jones-2

Iain,

How long is it taking to run? Perhaps you're running into the default  
transaction timeout of 60 seconds.

There are a couple of ways around this. In general even with a few  
hundred items it should go faster than 60 seconds, so some  
optimization (ie caching, db table indexing, improving queries to  
reduce database round-trips, etc) might be needed. The other  
alternative would be to increase the transaction timeout (either the  
default one, or the timeout for that specific service).

-David


On Nov 8, 2006, at 6:45 AM, Iain Fogg wrote:

> Jacopo,
>
> I was testing the reception of a large(ish) purchase order and  
> could consistently get receiveInventoryProduct to raise an  
> exception, although with no useful diagnostics about what might be  
> causing the problem.
>
> Whenever I try to receive a shipment with several hundred items  
> this would occur. However, if I received the order in "chunks" of  
> 20-30 items everything worked fine. This points to a dynamic  
> runtime error rather than a program logic error, but the logs don't  
> really give an idea of what might be causing it.
>
> Are there known problems with receiveInventoryProduct for big  
> orders? I couldn't see anything on jira...
>
> Cheers, Iain
>
> Jacopo Cappellato wrote:
>> Hi Scott,
>>
>> have a look at the receiveInventoryProduct minilang method in:
>>
>> applications\product\script\org\ofbiz\shipment\receipt
>> \ShipmentReceiptServices.xml
>>
>> you'll find an example of the <loop> operation
>>
>> Jacopo
>>
>>
>> Scott Gray wrote:
>>> Hi All
>>>
>>> I can't seem to find anything among the minilang tags that is  
>>> equivalent to a while loop in java, can anybody point me in the  
>>> right direction or let me know if there isn't anything?
>>>
>>> Thanks
>>> Scott
>>
>>
>>
>
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.409 / Virus Database: 268.13.32/523 - Release Date:  
> 7/11/2006
>

Reply | Threaded
Open this post in threaded view
|

Re: Mini-lang equivalent to while loop

Scott Gray
In reply to this post by Jacopo Cappellato
Hi Jacopo

I need to be able to break out of the loop when a condition becomes true
and it looks like i can't do this with the loop tag.  Would if be
worthwhile if I spent some time creating a <while-compare> tag (i.e. is
it likely to get committed) or otherwise I can just switch to java or
bsh to do what I need.

Thanks
Scott

Jacopo Cappellato wrote:

> Hmmm sorry,
>
> however this is an equivalent for the "for" java command... I don't
> know if it will help you to do what you need.
>
> Jacopo
>
> Jacopo Cappellato wrote:
>> Hi Scott,
>>
>> have a look at the receiveInventoryProduct minilang method in:
>>
>> applications\product\script\org\ofbiz\shipment\receipt\ShipmentReceiptServices.xml
>>
>>
>> you'll find an example of the <loop> operation
>>
>> Jacopo
>>
>>
>> Scott Gray wrote:
>>> Hi All
>>>
>>> I can't seem to find anything among the minilang tags that is
>>> equivalent to a while loop in java, can anybody point me in the
>>> right direction or let me know if there isn't anything?
>>>
>>> Thanks
>>> Scott
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Mini-lang equivalent to while loop

Jacques Le Roux
Administrator
Hi Scott,

From my PoV this seems interesting. I could review your patch if you create a Jira issue.

Jacques

From: "Scott Gray" <[hidden email]>

> Hi Jacopo
>
> I need to be able to break out of the loop when a condition becomes true
> and it looks like i can't do this with the loop tag.  Would if be
> worthwhile if I spent some time creating a <while-compare> tag (i.e. is
> it likely to get committed) or otherwise I can just switch to java or
> bsh to do what I need.
>
> Thanks
> Scott
>
> Jacopo Cappellato wrote:
> > Hmmm sorry,
> >
> > however this is an equivalent for the "for" java command... I don't
> > know if it will help you to do what you need.
> >
> > Jacopo
> >
> > Jacopo Cappellato wrote:
> >> Hi Scott,
> >>
> >> have a look at the receiveInventoryProduct minilang method in:
> >>
> >> applications\product\script\org\ofbiz\shipment\receipt\ShipmentReceiptServices.xml
> >>
> >>
> >> you'll find an example of the <loop> operation
> >>
> >> Jacopo
> >>
> >>
> >> Scott Gray wrote:
> >>> Hi All
> >>>
> >>> I can't seem to find anything among the minilang tags that is
> >>> equivalent to a while loop in java, can anybody point me in the
> >>> right direction or let me know if there isn't anything?
> >>>
> >>> Thanks
> >>> Scott
> >
> >