Page 1 of 1

TI Process Success Status

Posted: Tue Dec 03, 2013 7:49 pm
by ViRa
Hi all,

Could you please tell me if there is a way to determine if a process has ran successfully? The Message Log (available on right clicking a data server) shows the Error and Info log details but not the success details. For the time being I have created a cube to which the TI process sends across a success text (eg. 'Success') to the element upon successful completion of the process by writing the required code in Epilog tab.

However, I would like to know if there any other method to verify if a process ran successfully. Appreciate your help.

Thanks

Re: TI Process Success Status

Posted: Tue Dec 03, 2013 7:58 pm
by Wim Gielis
Hello

Did you spend time in the Turbo Integrator help files? Specifically, the function ExecuteProcess. Thanks.

Re: TI Process Success Status

Posted: Tue Dec 03, 2013 7:59 pm
by declanr
The server log timestamps completion with a successful completion message.

And that's when its on fairly minimal logging option.

Re: TI Process Success Status

Posted: Tue Dec 03, 2013 8:30 pm
by ViRa
Wim, I did take a look at ExecuteProcess function. However, my requirement was just to verify the process status after its completion.
Declan, thanks I did look at the server log file and it shows the details.

Thanks

Re: TI Process Success Status

Posted: Tue Dec 03, 2013 10:41 pm
by Wim Gielis
FWIW, here's what I've compiled in my files, based on the information on ExecuteProcess function calls.



Information on the Execute Process function and its possible outcomes:

ProcessExitByChoreQuit(): indicates that the process exited due to execution of the ChoreQuit function
ProcessExitNormal(): indicates that the process executed normally
ProcessExitMinorError(): indicates that the process executed successfully but encountered minor errors
ProcessExitByQuit(): indicates that the process exited because of an explicit "quit" command
ProcessExitWithMessage(): indicates that the process exited normally, with a message written to Tm1smsg.log.
ProcessExitSeriousError(): indicates that the process exited because of a serious error
ProcessExitOnInit(): indicates that the process aborted during initialization
ProcessExitByBreak(): indicates that the process exited because it encountered a ProcessBreak function

Example code:
-----------------------

vResult = ExecuteProcess('xxx');
If(vResult <> ProcessExitNormal() );
ProcessError;
EndIf;

or with an implicit global variable (for the last executed process):

ExecuteProcess('xxx');
If(ProcessReturnCode <> ProcessExitNormal() );
ProcessError;
EndIf;



Internal constants:

ProcessExitByChoreQuit(): 16
ProcessExitNormal(): 0
ProcessExitMinorError(): 6
ProcessExitByQuit(): 8
ProcessExitWithMessage(): 5
ProcessExitSeriousError(): 10
ProcessExitOnInit(): 11
ProcessExitByBreak(): 7

Re: TI Process Success Status

Posted: Wed Dec 04, 2013 12:03 am
by paulsimon
Hi ViRa

You can also use

vPro = 'My_Pro' ;
vRet = ExecuteProcess( vPro ) ;
IF( vRet <> ProcessExitNormal() ) ;
ItemReject( 'Process ' | vPro | ' failed.' ) ;
ENDIF ;

The ItemReject lets you put an error message out on the TM1ProcessError file

Regards

Paul Simon

Re: TI Process Success Status

Posted: Wed Dec 04, 2013 12:06 am
by EvgenyT
To extend what Paul/Wim suggested, I normally use this piece of code


NumericGlobalVariable( 'ProcessReturnCode');


processreturncode = ExecuteProcess('Process Name');

If(ProcessReturnCode<> ProcessExitNormal());

If(ProcessReturnCode = ProcessExitByChoreQuit());
Status = 'Exit by ChoreQuit';
Endif;
If(ProcessReturnCode = ProcessExitMinorError());
Status = 'Exit with Minor Error';
Endif;
If(ProcessReturnCode = ProcessExitByQuit());
Status = 'Exit by Quit';
Endif;
If(ProcessReturnCode = ProcessExitWithMessage());
Status = 'Exit with Message';
Endif;
If(ProcessReturnCode = ProcessExitSeriousError());
Status = 'Exit with Serious Error';
Endif;
If(ProcessReturnCode = ProcessExitOnInit());
Status = 'Exit on Init';
Endif;
If(ProcessReturnCode = ProcessExitByBreak());
Status = 'Exit by Break';
Endif;
Endif;

Re: TI Process Success Status

Posted: Wed Dec 04, 2013 2:06 pm
by ViRa
Thanks Wim, Paul and EvgenyT. I'm learning so much from your valuable inputs. I will try these out and update the status.

Re: TI Process Success Status

Posted: Thu Dec 05, 2013 2:12 pm
by ViRa
Hi all,

I just wanted to confirm this -

So the piece of code to verify process status has to be placed in the Epilog tab of the last process (as there are multiple processes being executed one after other in my case) that will be executed. Am I correct? Appreciate your response. Thanks.