I must not understand "IN BATCHES OF 1"

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

I must not understand "IN BATCHES OF 1"

Post by BLOMASKY »

I thought that if I have:

FIND ..... IN BATCHES OF 1
RunSomeProcess


That if there are 2 or more records, it will RunSomeProcess that many times. However, it seems like it restarts this line, so if there are 2 records, RunSomeProcess is run 4 times

What am I doing wrong

Bruce
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: I must not understand "IN BATCHES OF 1"

Post by BenHayat »

It's 4th of July special. Buy 1 Get 1 Free.

What happens if you do not use Batches? Will you get only 1, the last record?
kklosson
Posts: 1628
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: I must not understand "IN BATCHES OF 1"

Post by kklosson »

RunSomeProcess should be a separate process. Is it?
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: I must not understand "IN BATCHES OF 1"

Post by BLOMASKY »

Yes, RunSomeProcess is the name of an external process
It seems like when the original process suspends to run the 2nd process and then restarts, it sort of forgets which record it is on, and starts with the 1st record again.

I could be wrong

I have been wrong

(ask my wife!)

Bruce
johntalbott
Posts: 619
Joined: Wed Jun 17, 2015 11:16 pm
Location: Omaha, Nebraska
Contact:

Re: I must not understand "IN BATCHES OF 1"

Post by johntalbott »

BLOMASKY wrote:I thought that if I have:

FIND ..... IN BATCHES OF 1
RunSomeProcess


That if there are 2 or more records, it will RunSomeProcess that many times. However, it seems like it restarts this line, so if there are 2 records, RunSomeProcess is run 4 times

What am I doing wrong

Bruce
I can't answer your specific question about the restarts, but ... your code above will work without using Batches of 1.
VocalDay Solutions - Agility - Predictability - Quality

We specialize in enabling business through the innovative use of technology.

AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
RocketRod
Posts: 907
Joined: Wed Aug 06, 2008 4:22 am
Location: Melbourne

Re: I must not understand "IN BATCHES OF 1"

Post by RocketRod »

You are passing the instance of the BO to the subprocess right?

Cheers Rod
rocketman
Posts: 1252
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Re: I must not understand "IN BATCHES OF 1"

Post by rocketman »

Late to this thread but I was just doing some testing last night - for my own education. If you are calling a subprocess after a "FIND" in batches of doesn't seem to matter. Each item in the FIND is passed to the sub-process one at a time. I know this because I was trying to find a way of speeding up a part of my system by saying something like ThisOpeningBalance = ThatClosingBalance.

This failed because there was never a "That" in context (I had a DISPLAY MESSAGE line in the subprocess to check).

From distant times past, I seem to recall that "In Batches of" was simply a mechanism for not tying up the process engine for minutes at a time when there are potentially 000's of transactions in the FIND. Using "IN BATCHES OF (1 or 10 or 100) enables the process engine to pause and allow other processes in the queue to complete

But I could be wrong ....Support??

Hope this helps
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: I must not understand "IN BATCHES OF 1"

Post by aware_support »

IN BATCHES of 1 puts one of the instances found in the context and continues execution with this instance.

The rest depends on what else is in the Context. From Bruce's previous email it seems that he has two instances of the Order object in the Context already. FIND puts an instance of the Quote there. Then he calls a sub-process and the sub-process is executed with every combination of Order/Quote available in the Context (2 in this case - Order1/Quote1, Order2/Quote1).

Then IN BATCHES OF 1 puts another instance of the Quote object in the context, so it has Order1, Order2, Quote2 and the sub-process is run with the combination of Order1/Quote2, Order2/Quote2 and so on.
Aware IM Support Team
Post Reply