Rest-API difficulty updating formProperties

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2014 03:44 PM
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!
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!
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2014 07:08 AM
Looking at the user guide, is seems a json array is passed. Did you try that?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2014 09:19 AM
Worked like a charm. Don't I feel foolish. Too much time spent in a chair yesterday I guess. Thanks!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2014 11:09 AM
No problem, glad it worked 🙂
