TI Process jump tabs (Advanced tabs of TI) without completion
Posted: Fri Aug 05, 2016 10:00 pm
Hi All,
We are trying to run TI processes parallel to load data by leveraging the resources available on TM1 server. To achieve parallelism, developed Wrapper-Master process to do separately each of below,
A) Process to create meta data objects like cubes, subsets, views
B) Batch files to invoke same processes multiple times with unique parameters
C) Process to delete / destroy meta data objects
Issue: In Wrapper-Master process, after completion of processes to create meta data, few processes are added to execute before running parallel processes in Prolog tab of TI (it means these processes will be executed before start of any other processes in Epilog) and batch files are called from Epilog to run parallel processes, issue is even tough processes in Prolog tab not complete, processes in Epilog are kicked off.
Not sure what is causing to run processes in Epilog without completing processes in Prolog?
Appreciate if somebody can help me.
Thanks
Environment: TM1 10.2.2 (IBM Cloud)
Code
##pYear, pMonth is parameter value
##Prolog
######### Ensure the Right Month's Dimension is Used #########
ExecuteProcess ('Temporary - Create Dimensions', 'pVersion', 'Actual', 'pYear', pYear);
######### End #########
######### Export Config File to Declare Month for Batch Files #########
DatasourceASCIIQuoteCharacter = '';
sDir = '/..../..';
sFileName = 'log.txt';
sFile = sDir | sFileName;
ASCIIOutput (sFile, 'set month="' | pmonth | '"');
######### End ########
######### Ensure Proper values in the cube #########
ExecuteProcess ('P1 - Import Base Numbers from Source', 'pVersion', 'Actual', 'pYear', pYear);
ExecuteProcess ('P2 - Import from Agreement ID', 'pYear', pYear);
######### End #########
###Epilog
Sleep (15000);
######### Start Parallel Interaction #########
sFileEnding = '.bat';
sProDim = 'Pro Process';
i = 1;
iMax = DIMSIZ (sProDim);
While (i <= iMax);
sElement = DIMNM (sProDim, i);
sFile = sDir | sElement | sFileEnding;
ExecuteCommand (sFile, 0);
i = i + 1;
END;
######### End #########
######### Verify That All Processes Have Completed #########
sSuccessFileEnding = '-Pass.txt';
sFailedFileEnding = '-Fail.txt';
sProDim = 'Pro Process';
sBF1 = 'Failed File Found.txt';
sBF2 = 'Processes Not Completed.txt';
k = 1;
kMax = 240;
sCompleteFlag = 'N';
While (k <= kMax);
Sleep (30000);
If (sCompleteFlag @= 'Y');
k = kMax + 1;
Else;
i = 1;
iMax = DIMSIZ (sProDim);
While (i <= iMax);
sElement = DIMNM (sProDim, i);
sFailedFile = sDir | sElement | sFailedFileEnding;
sSuccessFile = sDir | sElement | sSuccessFileEnding;
If (FileExists (sFailedFile) = 1);
ASCIIOutput (sDir | sBF1, sFailedFile | ' was found. Process Terminated.');
ProcessBreak;
EndIf;
If (FileExists (sSuccessFile) = 0);
i = iMax + 1;
sCompleteFlag = 'N';
EndIf;
If (FileExists (sSuccessFile) = 1);
If (i = iMax);
sCompleteFlag = 'Y';
Else;
i = i + 1;
EndIf;
EndIf;
END;
k = k + 1;
EndIf;
END;
If (sCompleteFlag @= 'Y');
# Proceed as Planned
Else;
ASCIIOutput (sDir | sBF2, 'The Processes Did Not Complete in the Time Allotted. Process Terminated.');
ProcessQuit;
EndIf;
######### End #########
######### Some more to run #########
ExecuteProcess ('P3 - OpEx', 'pVersion', pVersion, 'pYear', pYear);
ExecuteProcess ('P4 - Consolidate Source Data', 'pVersion', pVersion, 'pYear', pYear);
######### Move Data to the Reporting Cubes #########
ExecuteProcess ('P6 - Reporting Cubes', 'pMonth', pYear);
We are trying to run TI processes parallel to load data by leveraging the resources available on TM1 server. To achieve parallelism, developed Wrapper-Master process to do separately each of below,
A) Process to create meta data objects like cubes, subsets, views
B) Batch files to invoke same processes multiple times with unique parameters
C) Process to delete / destroy meta data objects
Issue: In Wrapper-Master process, after completion of processes to create meta data, few processes are added to execute before running parallel processes in Prolog tab of TI (it means these processes will be executed before start of any other processes in Epilog) and batch files are called from Epilog to run parallel processes, issue is even tough processes in Prolog tab not complete, processes in Epilog are kicked off.
Not sure what is causing to run processes in Epilog without completing processes in Prolog?
Appreciate if somebody can help me.
Thanks
Environment: TM1 10.2.2 (IBM Cloud)
Code
##pYear, pMonth is parameter value
##Prolog
######### Ensure the Right Month's Dimension is Used #########
ExecuteProcess ('Temporary - Create Dimensions', 'pVersion', 'Actual', 'pYear', pYear);
######### End #########
######### Export Config File to Declare Month for Batch Files #########
DatasourceASCIIQuoteCharacter = '';
sDir = '/..../..';
sFileName = 'log.txt';
sFile = sDir | sFileName;
ASCIIOutput (sFile, 'set month="' | pmonth | '"');
######### End ########
######### Ensure Proper values in the cube #########
ExecuteProcess ('P1 - Import Base Numbers from Source', 'pVersion', 'Actual', 'pYear', pYear);
ExecuteProcess ('P2 - Import from Agreement ID', 'pYear', pYear);
######### End #########
###Epilog
Sleep (15000);
######### Start Parallel Interaction #########
sFileEnding = '.bat';
sProDim = 'Pro Process';
i = 1;
iMax = DIMSIZ (sProDim);
While (i <= iMax);
sElement = DIMNM (sProDim, i);
sFile = sDir | sElement | sFileEnding;
ExecuteCommand (sFile, 0);
i = i + 1;
END;
######### End #########
######### Verify That All Processes Have Completed #########
sSuccessFileEnding = '-Pass.txt';
sFailedFileEnding = '-Fail.txt';
sProDim = 'Pro Process';
sBF1 = 'Failed File Found.txt';
sBF2 = 'Processes Not Completed.txt';
k = 1;
kMax = 240;
sCompleteFlag = 'N';
While (k <= kMax);
Sleep (30000);
If (sCompleteFlag @= 'Y');
k = kMax + 1;
Else;
i = 1;
iMax = DIMSIZ (sProDim);
While (i <= iMax);
sElement = DIMNM (sProDim, i);
sFailedFile = sDir | sElement | sFailedFileEnding;
sSuccessFile = sDir | sElement | sSuccessFileEnding;
If (FileExists (sFailedFile) = 1);
ASCIIOutput (sDir | sBF1, sFailedFile | ' was found. Process Terminated.');
ProcessBreak;
EndIf;
If (FileExists (sSuccessFile) = 0);
i = iMax + 1;
sCompleteFlag = 'N';
EndIf;
If (FileExists (sSuccessFile) = 1);
If (i = iMax);
sCompleteFlag = 'Y';
Else;
i = i + 1;
EndIf;
EndIf;
END;
k = k + 1;
EndIf;
END;
If (sCompleteFlag @= 'Y');
# Proceed as Planned
Else;
ASCIIOutput (sDir | sBF2, 'The Processes Did Not Complete in the Time Allotted. Process Terminated.');
ProcessQuit;
EndIf;
######### End #########
######### Some more to run #########
ExecuteProcess ('P3 - OpEx', 'pVersion', pVersion, 'pYear', pYear);
ExecuteProcess ('P4 - Consolidate Source Data', 'pVersion', pVersion, 'pYear', pYear);
######### Move Data to the Reporting Cubes #########
ExecuteProcess ('P6 - Reporting Cubes', 'pMonth', pYear);