ExecuteProcess works in parallel?

Post Reply
Joris
Posts: 21
Joined: Wed Sep 30, 2015 2:19 pm
OLAP Product: TM1
Version: 10_2_2
Excel Version: 2010

ExecuteProcess works in parallel?

Post by Joris »

I've got a process that basically just calls a bunch of other processes using ExecuteProcess(). Some of these processes depend on a previous process being completed, so it's important that the next ExecuteProcess() only starts when the previous one is finished. This doesn't seem to be the case however. Based on my observations the process do indeed start serially, but as they don't wait for the previous one to be finished the may be running in parallel which does result in some problematic results.

Anyone an idea how to get them to work serially?
User avatar
qml
MVP
Posts: 1097
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: ExecuteProcess works in parallel?

Post by qml »

I'm sorry, but you will really have to show us your code and describe in more detail what you are seeing and where.

ExecuteProcess calls from a single parent process run sequentially, one after another. Only when a previous ExecuteProcess function call finishes (returning the status of the process being called) does the next line of code get executed, so not really sure how you are reaching the conclusions that processes 'don't wait for the previous one to be finished'.
Kamil Arendt
Joris
Posts: 21
Joined: Wed Sep 30, 2015 2:19 pm
OLAP Product: TM1
Version: 10_2_2
Excel Version: 2010

Re: ExecuteProcess works in parallel?

Post by Joris »

You're right, thanks.

The problem was a matter of stuff running in parallel, but it wasn't ExecuteProcess() itself that was the problem.
Some of these ExecuteProcess() commands run an ExecuteCommand() (i.e. running a *.bat-file) and others where trying to update the *.bat file while it was still processing (as TM1 doesn't know when a batch file is finished).
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: ExecuteProcess works in parallel?

Post by Wim Gielis »

Joris wrote:and others where trying to update the *.bat file while it was still processing (as TM1 doesn't know when a batch file is finished).
Do you use ExecuteCommand ? Check out the 2nd argument of that function.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply