Page 1 of 1
Getting TI returnvalue
Posted: Mon Mar 25, 2013 10:29 am
by jviegas@bi4all.pt
Hello,
It maybe a strange question but is there any possibility of getting the return value from a TI process without executing it through executeprocess (in another TI process).
I would like to get the returnvalue (regarding the execute status) and get this information as a parameter to another TI process (in the prolog).
At the moment I'm able to get this using another TI process and the executeprocess command.
Thank you for the time and help,
Jorge
Re: Getting TI returnvalue
Posted: Mon Mar 25, 2013 11:49 am
by ioscat
Re: Getting TI returnvalue
Posted: Tue Mar 26, 2013 7:12 pm
by jviegas@bi4all.pt
Iocat,
I can assume that I must have always a "caller process" to obtain the returnvalue of the target TI process.
I was wondering if I could get the returnvalue at the end of the process to pass it to a global variable.
Re: Getting TI returnvalue
Posted: Tue Mar 26, 2013 7:47 pm
by ioscat
you can store a value in cube with just 1 cell.
Re: Getting TI returnvalue
Posted: Wed Mar 27, 2013 7:41 am
by Harvey
Jorge, there is always some calling process. Do you mean calling a process via the TM1 API?
Re: Getting TI returnvalue
Posted: Wed Mar 27, 2013 8:25 am
by lotsaram
Lazarus wrote:Jorge, there is always some calling process. Do you mean calling a process via the TM1 API?
I think he means is it possible to query the last return state of a process regardless of when it was last executed and how it was executed. Others have asked this in the past too and the answer is of course NO, you have to declare a variable and set it equal to the process execute function.
Re: Getting TI returnvalue
Posted: Wed Mar 27, 2013 9:31 am
by jviegas@bi4all.pt
lotsaram wrote:Lazarus wrote:Jorge, there is always some calling process. Do you mean calling a process via the TM1 API?
I think he means is it possible to query the last return state of a process regardless of when it was last executed and how it was executed. Others have asked this in the past too and the answer is of course NO, you have to declare a variable and set it equal to the process execute function.
Thank you.
I was thinking to same but wanted to be sure and avoid missing a solution.
Thanks again for the feedbacks and the help on this issue.
Re: Getting TI returnvalue
Posted: Wed Mar 27, 2013 11:33 pm
by rmackenzie
jviegas@bi4all.pt wrote:I can assume that I must have always a "caller process" to obtain the returnvalue of the target TI process.
As the others have commented, your assumption is correct.
jviegas@bi4all.pt wrote:I was wondering if I could get the returnvalue at the end of the process to pass it to a global variable.
This however, is slightly different and somewhat possible. Although the return value is not available until the process has completed, it is possible within the Epilog to count the errors that occurred in the execution of the 3 preceding code tabs i.e. Prolog, Metadata, Data. Although you don't get the full range of information associated with the return code, you do get a basic test of whether the process ran without error versus ran with some minor errors.
TI exposes 3 variables for this purpose - the
doco calls them global variables that can be used within a chore presumably to get a running count of total errors throughout the chore. However, you can also use them in a single process:
In the prolog, you declare them:
Code: Select all
NumericGlobalVariable ( 'DataMinorErrorCount' );
NumericGlobalVariable ( 'MetadataMinorErrorCount' );
NumericGlobalVariable ( 'PrologMinorErrorCount' );
And in the Epilog, you can do this:
Code: Select all
nTotalProcessErrors = DataMinorErrorCount + MetadataMinorErrorCount + PrologMinorErrorCount;
IF ( nTotalProcessErrors > 0 );
# take action here like setting a flag in a cube, sending an e-mail, etc
END IF;