Thank you all for your responses,
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);
Correct, the parameter is pYear, rather than Year.
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.
the param isn't passed at all and so the process is running with its defaults.
Also correct, the response and code below will demonstrate my discovery,
qml wrote:Ok, I see.
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.
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?
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);
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:
Code: Select all
vReturn_value = ExecuteProcess(vElement);
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.