Page 1 of 1

Rest API behaviour

Posted: Thu Apr 04, 2019 4:01 am
by EvgenyT
Hi Guys,

I'm observing some odd behavior when trying to call a process via Rest API (in Postman).
It works as expected until I force the TI to ProcessQuit by introducing invalid parameter value. When I run the same process from TM1, ProcessQuit works as expected.

In TM1 Logs I get an following error when I execute via Postman with an invalid parameter value, e.g. DIMIX ( 'Year', pYear ) = 0, Invalid file name etc. While ProcessQuit is expected, I'm not sure why there is a Rollback on executing an Unknown function. Moreover, I have a cube that gets update based on errors encountered in a Prolog, however when I try to force errors in a TI via API call that cube does not get updated.

Process "ProcessName": : Execution was aborted by ProcessQuit Function.
CommitActionLog::Rollback: Called for thread '7856' of user '...'' executing function 'Unknown'.



API Call below:

POST /api/v1/Processes('ProcessName')/tm1.Execute HTTP/1.1
{
"Parameters": [
{
"Name": "pFileName",
"Value": "FileName"
},
{
"Name": "pYear",
"Value": "2017"

},
{
"Name": "pYearTo",
"Value": "2019"

},
{
"Name": "pMonthFrom",
"Value": "1"

},
{
"Name": "pMonthTo",
"Value": "12"

},
{
"Name": "pVersion",
"Value": "Actual"

},
{
"Name": "pAdjustment",
"Value": "N"

},
{
"Name": "pDebug",
"Value": 0
}
]
}

Any help or insights would be much appreciated

Thanks

Evgeny

Re: Rest API behaviour

Posted: Thu Apr 04, 2019 8:53 am
by lotsaram
You are using Execute which is now a depreciated function.
Most of us would say there's a "bug" with Execute as it breaks with backward compatibility as any error results in rollback and no data being committed. When executing the same process via C API only major error results in rollback, minor errors will still commit data. However IBM might claim this is a "feature". In any case IBM don't plan to fix it. There is a new function ExecuteWithReturn which you should use instead. (Provided you are on a sufficiently up-to-date version of PA).

Re: Rest API behaviour

Posted: Thu Apr 04, 2019 10:54 pm
by EvgenyT
Thanks for the pointer. We are on v11.3.00000.27 and as I can tell from the documentation, Execute has been depreciated in this version while ExecuteWithReturn has been introduced:
https://www.ibm.com/support/knowledgece ... 2_0_5.html

I'm still getting the same behavior with ExecuteWithReturn, major error results in a roll-back and no data being committed:

PostMan:
{{protocol}}://{{serverName}}:{{httpPortNumber}}/api/v1/Processes('processName')/tm1.ExecuteWithReturn

{
"@odata.context": "../$metadata#ibm.tm1.api.v1.ProcessExecuteResult",
"ProcessExecuteStatusCode": "QuitCalled"
}

Pulse:

6332 user 9:13:03 CommitActionLog::Rollback: Called for thread '6332' of user 'user' executing function 'Unknown'.
6332 user 9:13:03 Process "processName": : Execution was aborted by ProcessQuit Function.

Any help would be much appreciated, my involvement with Rest API has been minimal so far

Regards,

ET