Rest API behaviour

Post Reply
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Rest API behaviour

Post 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
lotsaram
MVP
Posts: 3651
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Rest API behaviour

Post 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).
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: Rest API behaviour

Post 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
Post Reply