Parameter of sub process not passing through
-
- Community Contributor
- Posts: 217
- Joined: Thu Aug 15, 2013 9:05 am
- OLAP Product: TM1
- Version: 10.2.1.1
- Excel Version: 14.0.6129.5000
Parameter of sub process not passing through
Hello to all,
recently we came across an issue that concerns a Master TI that fires sub TIs, which also fire sub TIs. All of the TIs take a parameter of the current year. These are also set as default parameters.
We needed to change the parameter from 2015 to 2016, so we thought we would just have to change the default parameter of the master process, but no...the sub TIs still tried to use the old parameter argument, 2015. In order for us to fix this, we had to change the default parameter arguments to 2016 as well.
Has anyone come across this before? The sub TI of a master process does not use the original parameter argument, it instead uses its own default parameter argument.
This has not always happened to us either, it has worked for us before.
Thanks.
Trevor.
recently we came across an issue that concerns a Master TI that fires sub TIs, which also fire sub TIs. All of the TIs take a parameter of the current year. These are also set as default parameters.
We needed to change the parameter from 2015 to 2016, so we thought we would just have to change the default parameter of the master process, but no...the sub TIs still tried to use the old parameter argument, 2015. In order for us to fix this, we had to change the default parameter arguments to 2016 as well.
Has anyone come across this before? The sub TI of a master process does not use the original parameter argument, it instead uses its own default parameter argument.
This has not always happened to us either, it has worked for us before.
Thanks.
Trevor.
- 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: Parameter of sub process not passing through
How do you expect the parameter to be passed between TIs if you're not passing it? Naturally the default parameter value of the subprocess will be used in such a case and that is '2015'. It does not matter that the default for the parent process is now something else as nowhere are you passing that to the subprocess!TrevorGoss wrote:The sub TI of a master process does not use the original parameter argument, it instead uses its own default parameter argument.
Kamil Arendt
-
- Community Contributor
- Posts: 217
- Joined: Thu Aug 15, 2013 9:05 am
- OLAP Product: TM1
- Version: 10.2.1.1
- Excel Version: 14.0.6129.5000
Re: Parameter of sub process not passing through
Thanks for the response,qml wrote:How do you expect the parameter to be passed between TIs if you're not passing it? Naturally the default parameter value of the subprocess will be used in such a case and that is '2015'. It does not matter that the default for the parent process is now something else as nowhere are you passing that to the subprocess!TrevorGoss wrote:The sub TI of a master process does not use the original parameter argument, it instead uses its own default parameter argument.
Perhaps I should of been clearer in my original post. The Master process, calls the Sub processes, passing the default parameter to the sub process, like so:
MasterTI.....
Code: Select all
ExecuteProcess('SubPro','Year',pYear);
Code: Select all
ExecuteProcess('SubSubPro','Year',pYear);
So if the MasterTI is called with a default parameter argument if '2016', we would expect the SubProcess to have '2016', when it is called.
- 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: Parameter of sub process not passing through
Ok, I see.
Can you post the relevant portions of your actual code please? I understand that you have a master TI that calls some subprocesses which execute some sub-subprocesses of their own. I'm interested to see your ExecuteProcess syntax, because right now it's looking as though you are not passing the Year parameter value and hence each process uses its own defaults. If your actual syntax is along the lines of your example then I would agree that a subprocess should be using the value passed from the parent process, even if that was a default value in that parent process. How (from what interface) do you execute the master process, by the way?TrevorGoss wrote:The Master TI has a default parameter of pYear. So if the MasterTI is called with a default parameter argument if '2016', we would expect the SubProcess to have '2016', when it is called.
Kamil Arendt
- gtonkin
- MVP
- Posts: 1265
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: Parameter of sub process not passing through
Hi Trevor,
Can't say I have encountered this problem and I know we are doing some of these chained TI's.
Assume you have checked the obvious like the pYear variable is not set/reset in any of the Sub TI's
May also be worthwhile trying an asciioutput in Prolog and Epilog (to a different file of course) to check the values on entry and exit.
Can't say I have encountered this problem and I know we are doing some of these chained TI's.
Assume you have checked the obvious like the pYear variable is not set/reset in any of the Sub TI's
May also be worthwhile trying an asciioutput in Prolog and Epilog (to a different file of course) to check the values on entry and exit.
-
- MVP
- Posts: 3704
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Parameter of sub process not passing through
Its going to be the obvious answer that wrong param value being passed or else the param isn't passed at all and so the process is running with its defaults. Can't be anything else; code does what it's been programmed to do. Just a matter of finding where you've gone wrong.
Whenever I'm setting up a system I always have the default values of pYear, pMonth etc. set to blank. If the process runs without these params being passed or if passed as blank strings then there is parameter validation code on the prolog to look up current year or current month from a sys settings cube. Then there's never any code changes or resetting of chore or process defaults to do for year rollover.
Whenever I'm setting up a system I always have the default values of pYear, pMonth etc. set to blank. If the process runs without these params being passed or if passed as blank strings then there is parameter validation code on the prolog to look up current year or current month from a sys settings cube. Then there's never any code changes or resetting of chore or process defaults to do for year rollover.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
- mattgoff
- MVP
- Posts: 518
- Joined: Fri May 16, 2008 1:37 pm
- OLAP Product: TM1
- Version: 10.2.2.6
- Excel Version: O365
- Location: Florida, USA
Re: Parameter of sub process not passing through
Is "Year" really your param name or is that a placeholder for this post? If the former, "Year" is a reserved word, and you get a modal error if you attempt to use it for a variable name. I would have expected your code to be:
Code: Select all
ExecuteProcess('SubPro','pYear',pYear);
Please read and follow the Request for Assistance Guidelines. It helps us answer your question and saves everyone a lot of time.
- gtonkin
- MVP
- Posts: 1265
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: Parameter of sub process not passing through
I think Mattgoff has unconvered the answer - If the sub process has a parameter value called 'Year' and is passed a value via a variable of pYear then the sub process probably does not have a variable or parameter called 'pYear,' unless it is set to 'Year' - as per mattgoff, please confirm the actual parameter names and variables too.mattgoff wrote:Is "Year" really your param name or is that a placeholder for this post?
-
- Community Contributor
- Posts: 217
- Joined: Thu Aug 15, 2013 9:05 am
- OLAP Product: TM1
- Version: 10.2.1.1
- Excel Version: 14.0.6129.5000
Re: Parameter of sub process not passing through
Thank you all for your responses,
This code is looping through the }Processes dimension, finding all the right processes to pass as arguments into the ExecuteProcess function, note this line of code:
This was done a while ago, as a test to solve a different issue, the 'vReturn_Value' is storing the return value of the ExecuteProcess call, as it returns errors. This code was never taken out, which is amazing.
Thank you all for your responses, I never new 'Year' was a keyword and I will take the idea of leaving all the default parameters to blank, especially if it is being passed as a sub TI. The reason why we did set up default values, was in case we wanted to run the Sub Tis on its own.
Correct, the parameter is pYear, rather than Year.mattgoff wrote:Is "Year" really your param name or is that a placeholder for this post? If the former, "Year" is a reserved word, and you get a modal error if you attempt to use it for a variable name. I would have expected your code to be:
Code: Select all
ExecuteProcess('SubPro','pYear',pYear);
lotsaram wrote:Its going to be the obvious answer that wrong param value being passed or else the param isn't passed at all and so the process is running with its defaults. Can't be anything else; code does what it's been programmed to do. Just a matter of finding where you've gone wrong.
Whenever I'm setting up a system I always have the default values of pYear, pMonth etc. set to blank. If the process runs without these params being passed or if passed as blank strings then there is parameter validation code on the prolog to look up current year or current month from a sys settings cube. Then there's never any code changes or resetting of chore or process defaults to do for year rollover.
Also correct, the response and code below will demonstrate my discovery,the param isn't passed at all and so the process is running with its defaults.
qml wrote:Ok, I see.Can you post the relevant portions of your actual code please? I understand that you have a master TI that calls some subprocesses which execute some sub-subprocesses of their own. I'm interested to see your ExecuteProcess syntax, because right now it's looking as though you are not passing the Year parameter value and hence each process uses its own defaults. If your actual syntax is along the lines of your example then I would agree that a subprocess should be using the value passed from the parent process, even if that was a default value in that parent process. How (from what interface) do you execute the master process, by the way?TrevorGoss wrote:The Master TI has a default parameter of pYear. So if the MasterTI is called with a default parameter argument if '2016', we would expect the SubProcess to have '2016', when it is called.
Code: Select all
vK=1;
WHILE(vK <= vMaxElement);
vElement = DIMNM('}Processes', vK);
IF (SUBST(vElement,1,11) @= 'TI_Transfer' & vElement @<>'TI_Transfer2'&vElement @<>'TI_Transfer_d');
EXECUTEPROCESS(vElement, 'pYear', pYear, 'TrfVer', TrfVer,'pViewOrData','V');
EXECUTEPROCESS(vElement, 'pYear', pYear, 'TrfVer', TrfVer,'pViewOrData','D');
vReturn_value = ExecuteProcess(vElement);
ASCIIOUTPUT('z:\PrintOutTis1.txt',vElement);
If(vReturn_value = ProcessExitSeriousError() );
ASCIIOUTPUT('z:\TiFailedSerious.txt','Process', vElement ,'exited with serious errors at ', TIME, 'on', vNewDate);
Elseif
(vReturn_value = ProcessExitMinorError() );
ASCIIOUTPUT('z:\TiFailedMinor.txt','Process', vElement ,'exited with minor errors at ', TIME, 'on', vNewDate);
Elseif
(vReturn_value = ProcessExitOnInit() );
ASCIIOUTPUT('z:\TiFailedOnINIT.txt','Process', vElement ,'exited on init at ', TIME, 'on', vNewDate);
Endif;
ENDIF;
vK=vK+1;
vReturn = CELLPUTN(0,'TriggerControl', 'IsRunning', 'TriggerOption');
CubeSetLogChanges('CalenderManualTriggerControl',0);
Code: Select all
vReturn_value = ExecuteProcess(vElement);
Thank you all for your responses, I never new 'Year' was a keyword and I will take the idea of leaving all the default parameters to blank, especially if it is being passed as a sub TI. The reason why we did set up default values, was in case we wanted to run the Sub Tis on its own.
-
- 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: Parameter of sub process not passing through
Indeed, I also tend to put default values in the TI processes.TrevorGoss wrote:I will take the idea of leaving all the default parameters to blank, especially if it is being passed as a sub TI. The reason why we did set up default values, was in case we wanted to run the Sub Tis on its own.
In case the TI is run on its own from the Server Explorer, it's good to have the "format" of the input.
Like: year could be 16 (sometimes) or 2016 or Y2016.
Month could be 05 or 5 or May or ...
Or if the parameter asks for a YTD month, would it be YTD 05 or 05 ?
I do know that we can program around this and I almost always do so, and I also know the concept of aliases

but still being shown possible default values and their "format" (at runtime) is useful.
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
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
-
- Community Contributor
- Posts: 217
- Joined: Thu Aug 15, 2013 9:05 am
- OLAP Product: TM1
- Version: 10.2.1.1
- Excel Version: 14.0.6129.5000
Re: Parameter of sub process not passing through
Indeed, I also tend to put default values in the TI processes.Wim Gielis wrote:TrevorGoss wrote:I will take the idea of leaving all the default parameters to blank, especially if it is being passed as a sub TI. The reason why we did set up default values, was in case we wanted to run the Sub Tis on its own.
In case the TI is run on its own from the Server Explorer, it's good to have the "format" of the input.
Like: year could be 16 (sometimes) or 2016 or Y2016.
Month could be 05 or 5 or May or ...
Or if the parameter asks for a YTD month, would it be YTD 05 or 05 ?
quote]
We have a Control Cube for items such as Current Period, Previous Period and the like.
Of course, for current year we could always have no parameter and use this code:
Code: Select all
vYear = TIMST(NOW,'\Y');