cancel
Showing results for 
Search instead for 
Did you mean: 

Rest-API difficulty updating formProperties

jyerger
Champ in-the-making
Champ in-the-making
I'm having difficultly performing a simple property update via the REST-API.  I've successfully worked out creating and listing info from Activiti, but I just can't seem to set a property.  The json converted property looks to be properly formed, but I still keep getting the error "resulted in 400 (Bad Request)" on execute.  The user’s guide suggests that this is likely happening because of a difference in property scope, but a simple query of all formProperties on this process shows them all as 'local', just as I'm putting into my json. 
Is there any chance of somebody setting me straight?

Activiti version: 5.15.1

Sample code.
String url = http://myServer/activiti-rest/service/runtime/process-instances/25762/variables
RestTemplate restTemplate = getRestTemplate();    <–Spring restTemplate
restTemplate.put(url, request);    <– Spring HttpEntity for request

Request object content before calling 'put' is….
<{"name":"cmoApproved","type":"string","value":"true","scope":"local"},{Content-Type=[application/json]}>

Rest should be making this simple for me as there are only a few elements to deal with.
1.) URL  <– matches users guide…see above
2.) json formatted variable array  <– matches user guide
3.) request method (put, post, get)  <– performing put to update variable

Could my request object be missing something?  Any help would be greatly appreciated!

3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
Looking at the user guide, is seems a json array is passed. Did you try that?

jyerger
Champ in-the-making
Champ in-the-making
Worked like a charm.  Don't I feel foolish.  Too much time spent in a chair yesterday I guess. Thanks!

jbarrez
Star Contributor
Star Contributor
No problem, glad it worked 🙂
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.