ExecuteProcess

ExecuteProcess lets you execute a TurboIntegrator process from within another process.

This function is valid in TM1® TurboIntegrator processes only.

Syntax

ExecuteProcess(ProcessName, [ParamName1, ParamValue1,ParamName2, ParamValue2]);

Argument

Description

ProcessName

The name of the process to be executed. This process must reside on the same server as the process from which ExecuteProcess is called.

If the process named by this argument cannot be found at runtime, the calling process is immediately terminated. (TurboIntegrator does not check for a valid ProcessName at compilation.)

ParamName

The name of an existing parameter of the process to be executed. This argument is required only if the process to be executed uses parameters.

ParamValue

A valid value for the ParamName parameter. If you specify a ParamName argument, you must specify a corresponding ParamValue.

The ParamName and ParamValue arguments must occur in ordered pairs, with the name of the parameter followed by the value. You must specify a ParamName and corresponding ParamValue for each parameter of the process to be executed.

The parameter names passed in the ExecuteProcess function are matched at runtime against the parameter names specified in the process to be executed. If the passed names cannot be found in the parameter list of the process to be executed, a serious error results, causing the immediate termination of the process from which ExecuteProcess is called.

Return Values

ExecuteProcess returns a real value that can be tested against one of the following return value functions:

Function

Description

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 tm1server.log.

ProcessExitSeriousError()

Indicates that the process exited because of a serious error.

When a process exits because of a serious error, the process is immediately terminated and no further processing occurs. For example, if a serious error occurs in the Data procedure, the process immediately exits and the Epilog procedure is not executed.

ProcessExitOnInit()

Indicates that the process aborted during initialization.

ProcessExitByBreak()

Indicates that the process exited because it encountered a ProcessBreak function.

Example

To record when a process called by ExecuteProcess fails because of a serious error, use code similar to the following:
return_value = ExecuteProcess('create_sales_cube');
ASCIIOutput('C:\temp\process_return_value.txt', 'Process exited
with serious errors at', TIME, 'on', TODAY);if(return_value = ProcessExitSeriousError() )
endif;