Update a process with the TM1 REST API
Posted: Tue Mar 29, 2022 11:08 am
Hi all,
I am trying to use Postman to update an existing, very simple, TI process.
The only line of code is: v = 1; in the Prolog tab. No data source, no variables, etc.
I want to update the process to read: v = 2; Can it be even more simple ?
The process is called 'test'. TM1 basic security, I am admin for the test.
PAL 2.0.9.10.
So I have this:
Result:
I change the v = 1 into v = 2 and I copy the whole lot into the JSON body for a PATCH statement, I get an error for "Bad request":
(see below for a picture)
When I then manually delete the Attributes part in the JSON body and send the PATCH request again, it works:
(see below for a picture)
The process is not part of any chore.
Did any of you encounter it before ? When I reverse engineer in tm1py, it does not seem to me that tm1py is doing anything with the body of the request. Certainly nothing with Attributes. Any help is greatly appreciated !
Thanks.
I am trying to use Postman to update an existing, very simple, TI process.
The only line of code is: v = 1; in the Prolog tab. No data source, no variables, etc.
I want to update the process to read: v = 2; Can it be even more simple ?

PAL 2.0.9.10.
So I have this:
Code: Select all
GET: http://AEX220:8001/api/v1/Processes('test')
Code: Select all
{
"@odata.context": "$metadata#Processes/$entity",
"@odata.etag": "W/\"322acd39b78e9283c769d29d901f4c3e04792b58\"",
"Name": "test",
"HasSecurityAccess": false,
"PrologProcedure": "\r\n#****Begin: Generated Statements***\r\n#****End: Generated Statements****\r\n\r\n\r\nv = 1;",
"MetadataProcedure": "\r\n#****Begin: Generated Statements***\r\n#****End: Generated Statements****",
"DataProcedure": "\r\n#****Begin: Generated Statements***\r\n#****End: Generated Statements****",
"EpilogProcedure": "\r\n#****Begin: Generated Statements***\r\n#****End: Generated Statements****",
"DataSource": {
"Type": "None"
},
"Parameters": [],
"Variables": [],
"Attributes": {
"Caption": "test"
}
}
Code: Select all
{
"error": {
"code": "278",
"message": "Cannot modify Attributes property during Process PATCH."
}
}
When I then manually delete the Attributes part in the JSON body and send the PATCH request again, it works:
Code: Select all
{
"@odata.context": "$metadata#Processes/$entity",
"@odata.etag": "W/\"322acd39b78e9283c769d29d901f4c3e04792b58\"",
"Name": "test",
"HasSecurityAccess": false,
"PrologProcedure": "\r\n#****Begin: Generated Statements***\r\n#****End: Generated Statements****\r\n\r\n\r\nv = 2;",
"MetadataProcedure": "\r\n#****Begin: Generated Statements***\r\n#****End: Generated Statements****",
"DataProcedure": "\r\n#****Begin: Generated Statements***\r\n#****End: Generated Statements****",
"EpilogProcedure": "\r\n#****Begin: Generated Statements***\r\n#****End: Generated Statements****",
"DataSource": {
"Type": "None"
},
"Parameters": [],
"Variables": []
}
The process is not part of any chore.
Did any of you encounter it before ? When I reverse engineer in tm1py, it does not seem to me that tm1py is doing anything with the body of the request. Certainly nothing with Attributes. Any help is greatly appreciated !
Thanks.