ProcessService
ProcessService(rest)
Bases: ObjectService
Service to handle Object Updates for TI Processes
Source code in TM1py/Services/ProcessService.py
compile(name, **kwargs)
Compile a Process. Return List of Syntax errors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
List
|
|
Source code in TM1py/Services/ProcessService.py
compile_process(process, **kwargs)
Compile a Process. Return List of Syntax errors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process
|
Process
|
|
required |
Returns:
| Type | Description |
|---|---|
List
|
|
Source code in TM1py/Services/ProcessService.py
create(process, **kwargs)
Create a new process on TM1 Server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process
|
Process
|
Instance of TM1py.Process class |
required |
Returns:
| Type | Description |
|---|---|
Response
|
Response |
Source code in TM1py/Services/ProcessService.py
debug_add_breakpoint(debug_id, break_point, **kwargs)
debug_add_breakpoints(debug_id, break_points=None, **kwargs)
Source code in TM1py/Services/ProcessService.py
debug_continue(debug_id, **kwargs)
Resumes execution until next breakpoint
Source code in TM1py/Services/ProcessService.py
debug_get_breakpoints(debug_id, **kwargs)
Source code in TM1py/Services/ProcessService.py
debug_get_current_breakpoint(debug_id, **kwargs)
Source code in TM1py/Services/ProcessService.py
debug_get_process_line_number(debug_id, **kwargs)
Source code in TM1py/Services/ProcessService.py
debug_get_process_procedure(debug_id, **kwargs)
Source code in TM1py/Services/ProcessService.py
debug_get_record_number(debug_id, **kwargs)
Source code in TM1py/Services/ProcessService.py
debug_get_single_variable_value(debug_id, variable_name, **kwargs)
Source code in TM1py/Services/ProcessService.py
debug_get_variable_values(debug_id, **kwargs)
Source code in TM1py/Services/ProcessService.py
debug_process(process_name, timeout=None, **kwargs)
Start debug session for specified process; debug session id is returned in response
Source code in TM1py/Services/ProcessService.py
debug_remove_breakpoint(debug_id, breakpoint_id, **kwargs)
Source code in TM1py/Services/ProcessService.py
debug_step_in(debug_id, **kwargs)
Runs a single statement in the process If ExecuteProcess is next function, will pause at first statement inside child process
Source code in TM1py/Services/ProcessService.py
debug_step_out(debug_id, **kwargs)
Resumes execution and runs until current process has finished.
Source code in TM1py/Services/ProcessService.py
debug_step_over(debug_id, **kwargs)
Runs a single statement in the process If ExecuteProcess is next function, will NOT debug child process
Source code in TM1py/Services/ProcessService.py
debug_update_breakpoint(debug_id, break_point, **kwargs)
Source code in TM1py/Services/ProcessService.py
delete(name, **kwargs)
Delete a process in TM1
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Response
|
Response |
evaluate_boolean_ti_expression(formula)
Source code in TM1py/Services/ProcessService.py
evaluate_ti_expression(formula, **kwargs)
This function is same functionality as hitting "Evaluate" within variable formula editor in TI Function creates temporary TI and then starts a debug session on that TI EnableTIDebugging=T must be present in .cfg file Only suited for DEV and one-off uses, don't incorporate into dataframe lambda function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formula
|
str
|
a valid tm1 variable formula (no double quotes, no equals sign, semicolon optional) e.g. "8*2;", "CellGetN('c1', 'e1', 'e2);", "ATTRS('Region', 'France', 'Currency')" |
required |
Returns:
| Type | Description |
|---|---|
str
|
string result from formula |
Source code in TM1py/Services/ProcessService.py
execute(process_name, parameters=None, timeout=None, cancel_at_timeout=False, **kwargs)
Ask TM1 Server to execute a process. Call with parameter names as keyword arguments: tm1.processes.execute("Bedrock.Server.Wait", pLegalEntity="UK01")
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process_name
|
str
|
|
required |
parameters
|
Dict
|
Deprecated! dictionary, e.g. {"Parameters": [ { "Name": "pLegalEntity", "Value": "UK01" }] } |
None
|
timeout
|
float
|
Number of seconds that the client will wait to receive the first byte. |
None
|
cancel_at_timeout
|
bool
|
Abort operation in TM1 when timeout is reached |
False
|
Returns:
| Type | Description |
|---|---|
Response
|
|
Source code in TM1py/Services/ProcessService.py
execute_process_with_return(process, timeout=None, cancel_at_timeout=False, return_async_id=False, retry_on_disconnect=False, **kwargs)
Run unbound TI code directly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process
|
Process
|
a TI Process Object |
required |
timeout
|
float
|
Number of seconds that the client will wait to receive the first byte. |
None
|
cancel_at_timeout
|
bool
|
Abort operation in TM1 when timeout is reached |
False
|
return_async_id
|
bool
|
return async_id instead of (success, status, error_log_file) |
False
|
retry_on_disconnect
|
bool
|
bool, indicates that the operation is idempotent and can be safely retried on connection errors |
False
|
kwargs
|
dictionary of process parameters and values |
{}
|
Returns:
| Type | Description |
|---|---|
Tuple[bool, str, str]
|
success (boolean), status (String), error_log_file (String) |
Source code in TM1py/Services/ProcessService.py
execute_ti_code(lines_prolog, lines_epilog=None, **kwargs)
Execute lines of code on the TM1 Server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines_prolog
|
Iterable[str]
|
list - where each element is a valid statement of TI code. |
required |
lines_epilog
|
Iterable[str]
|
list - where each element is a valid statement of TI code. |
None
|
Source code in TM1py/Services/ProcessService.py
execute_with_return(process_name=None, timeout=None, cancel_at_timeout=False, return_async_id=False, retry_on_disconnect=False, **kwargs)
Ask TM1 Server to execute a process. pass process parameters as keyword arguments to this function. E.g:
self.tm1.processes.execute_with_return( process_name="Bedrock.Server.Wait", pWaitSec=2)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process_name
|
str
|
name of the TI process |
None
|
timeout
|
float
|
Number of seconds that the client will wait to receive the first byte. |
None
|
cancel_at_timeout
|
bool
|
Abort operation in TM1 when timeout is reached |
False
|
return_async_id
|
bool
|
return async_id instead of (success, status, error_log_file) |
False
|
retry_on_disconnect
|
bool
|
bool, indicates that the operation is idempotent and can be safely retried on connection errors |
False
|
kwargs
|
dictionary of process parameters and values |
{}
|
Returns:
| Type | Description |
|---|---|
Tuple[bool, str, str]
|
success (boolean), status (String), error_log_file (String) |
Source code in TM1py/Services/ProcessService.py
exists(name, **kwargs)
Check if Process exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
get(name_process, **kwargs)
Get a process from TM1 Server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_process
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Process
|
Instance of the TM1py.Process |
Source code in TM1py/Services/ProcessService.py
get_all(skip_control_processes=False, **kwargs)
Get all processes from TM1 Server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip_control_processes
|
bool
|
bool, True to exclude processes that begin with "}" or "{" |
False
|
Returns:
| Type | Description |
|---|---|
List[Process]
|
List, instances of the TM1py.Process |
Source code in TM1py/Services/ProcessService.py
get_all_names(skip_control_processes=False, **kwargs)
Get List with all process names from TM1 Server
:Returns: List of Strings
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip_control_processes
|
bool
|
bool, True to exclude processes that begin with "}" or "{" |
False
|
Source code in TM1py/Services/ProcessService.py
get_error_log_file_content(file_name, **kwargs)
Get content of error log file (e.g. TM1ProcessError_20180926213819_65708356_979b248b-232e622c6.log)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name
|
str
|
name of the error log file in the TM1 log directory |
required |
Returns:
| Type | Description |
|---|---|
str
|
String, content of the file |
Source code in TM1py/Services/ProcessService.py
get_error_log_filenames(process_name=None, top=0, descending=False, **kwargs)
Get error log filenames for specified TI process
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process_name
|
str
|
valid TI name, leave blank to return all error log filenames |
None
|
top
|
int
|
top n filenames |
0
|
descending
|
bool
|
default sort is ascending, descending=True would have most recent at the top of list |
False
|
Returns:
| Type | Description |
|---|---|
List[str]
|
list of filenames |
Source code in TM1py/Services/ProcessService.py
get_last_message_from_processerrorlog(process_name, **kwargs)
Get the latest ProcessErrorLog from a process entity
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process_name
|
str
|
name of the process |
required |
Returns:
| Type | Description |
|---|---|
str
|
String - the errorlog, e.g.: "Error: Data procedure line (9): Invalid key: Dimension Name: "Product", Element Name (Key): "ProductA"" |
Source code in TM1py/Services/ProcessService.py
get_processerrorlogs(process_name, **kwargs)
Get all ProcessErrorLog entries for a process
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process_name
|
str
|
name of the process |
required |
Returns:
| Type | Description |
|---|---|
List
|
list - Collection of ProcessErrorLogs |
Source code in TM1py/Services/ProcessService.py
poll_execute_with_return(async_id)
Source code in TM1py/Services/ProcessService.py
search_error_log_filenames(search_string, top=0, descending=False, **kwargs)
Search error log filenames for given search string like a datestamp e.g. 20231201
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search_string
|
str
|
substring to contain in file names |
required |
top
|
int
|
top n filenames |
0
|
descending
|
bool
|
default sort is ascending, descending=True would have most recent at the top of list |
False
|
Returns:
| Type | Description |
|---|---|
List[str]
|
list of filenames |
Source code in TM1py/Services/ProcessService.py
search_string_in_code(search_string, skip_control_processes=False, **kwargs)
Ask TM1 Server for list of process names that contain string anywhere in code tabs: Prolog,Metadata,Data,Epilog will not search DataSource, Parameters, Variables, or Attributes
:Returns: List of strings
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search_string
|
str
|
case insensitive string to search for |
required |
skip_control_processes
|
bool
|
bool, True to exclude processes that begin with "}" or "{" |
False
|
Source code in TM1py/Services/ProcessService.py
search_string_in_name(name_startswith=None, name_contains=None, name_contains_operator='and', skip_control_processes=False, **kwargs)
Ask TM1 Server for list of process names that contain or start with string
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_startswith
|
str
|
str, process name begins with (case insensitive) |
None
|
name_contains
|
Iterable
|
iterable, found anywhere in name (case insensitive) |
None
|
name_contains_operator
|
str
|
'and' or 'or' |
'and'
|
skip_control_processes
|
bool
|
bool, True to exclude processes that begin with "}" or "{" |
False
|
Source code in TM1py/Services/ProcessService.py
update(process, **kwargs)
Update an existing Process on TM1 Server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process
|
Process
|
Instance of TM1py.Process class |
required |
Returns:
| Type | Description |
|---|---|
Response
|
Response |
Source code in TM1py/Services/ProcessService.py
update_or_create(process, **kwargs)
Update or Create a Process on TM1 Server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process
|
Process
|
Instance of TM1py.Process class |
required |
Returns:
| Type | Description |
|---|---|
Response
|
Response |