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 must not understand "IN BATCHES OF 1"
Re: I must not understand "IN BATCHES OF 1"
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?
What happens if you do not use Batches? Will you get only 1, the last record?
Re: I must not understand "IN BATCHES OF 1"
RunSomeProcess should be a separate process. Is it?
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit
Re: I must not understand "IN BATCHES OF 1"
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
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
-
- Posts: 619
- Joined: Wed Jun 17, 2015 11:16 pm
- Location: Omaha, Nebraska
- Contact:
Re: I must not understand "IN BATCHES OF 1"
I can't answer your specific question about the restarts, but ... your code above will work without using Batches of 1.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
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
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
Re: I must not understand "IN BATCHES OF 1"
You are passing the instance of the BO to the subprocess right?
Cheers Rod
Cheers Rod
Re: I must not understand "IN BATCHES OF 1"
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
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
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: I must not understand "IN BATCHES OF 1"
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.
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