Page 2 of 2

Re: Run Process - How to Determine When All Completed.

Posted: Wed Jun 21, 2023 11:00 pm
by JohnO
PavoGa wrote: Tue Jun 20, 2023 5:55 pm Wasn't there a post the other day about some additional variables available for use with RunProcess? I searched but have not found it.
You may be referring to my earlier post in this thread. The NEW PA engine (What was to be Server 12) has some useful new functions to handle communication between the called process and the calling process.

Re: Run Process - How to Determine When All Completed.

Posted: Thu Jun 22, 2023 1:18 pm
by PavoGa
JohnO wrote: Wed Jun 21, 2023 11:00 pm
PavoGa wrote: Tue Jun 20, 2023 5:55 pm Wasn't there a post the other day about some additional variables available for use with RunProcess? I searched but have not found it.
You may be referring to my earlier post in this thread. The NEW PA engine (What was to be Server 12) has some useful new functions to handle communication between the called process and the calling process.
That is it. :D

Bookmarked now. Thanks!

Re: Run Process - How to Determine When All Completed.

Posted: Wed Jun 28, 2023 3:32 pm
by dan.kelleher
PavoGa wrote: Tue Jun 20, 2023 5:55 pm File semaphores is what I use currently to control a parent process. I believe I read about using adding/removing attributes or elements and tested it a few years back, but never used in production. The file semaphores seem to work well enough.

Wasn't there a post the other day about some additional variables available for use with RunProcess? I searched but have not found it.
https://www.ibm.com/docs/en/planning-an ... nprocess-1
https://www.ibm.com/docs/en/planning-an ... tjobstatus

Example
ID1 = RunProcess(`async_process_1`);
#*** Do something else in the main TI

#*** Check async_process_1 execution status
Ret = GetJobStatus(ID1);

If(Ret = ProcessExecutionInProgress());
WaitForAllJobs(ID1);
EndIf;

Ret = GetJobStatus(ID1);

If(Ret = ProcessExitNormal());
#*** async_process_1 finished execution and completed successfully, proceed with its results.
EndIf;

If(Ret = ProcessExitSeriousError());
#*** async_process_1 finished execution but failed with error, perform error handling.
EndIf;

In this example, after launching async_process_1, the ID1 can be used to check its execution status of the process. The return value of the GetJobStatus can be compared with process return codes, such as ProcessExitNormal and ProcessExitSeriousError that return the value of ExecuteProcess.

Re: Run Process - How to Determine When All Completed.

Posted: Mon Jul 17, 2023 5:54 pm
by ascheevel

Might not be obvious to some folks, but the functions/features Dan is referring to are only available currently in V12 or Planning Analytics New Engine.

Re: Run Process - How to Determine When All Completed.

Posted: Wed Jul 26, 2023 3:22 pm
by ardi
In my experience, the easiest way is to use RushTI ( a Cubewise python/TM1Py utility). I have used all kind of different approaches in the past, and I always had issues. Even with Flag-files approach, you end up having files being locked from OS and other type of issues.

RushTI is easy to use and it provides all the flexibility you need to manage the parallel execution, you can even implement process dependencies easily.