Does the REST Task Service support parsing of objects in BPM Suite 6?
Environment
- Red Hat JBoss BPM Suite (BPM Suite)
- 6.1.x
- 6.2.x
Issue
- We are using the REST task service to invoke a REST Web Service and the response is an object marshalled in JSON/XML and we would like to use this task service to automatically parse the response into our model object. Is that possible?
- How to parse HTTP response using REST service task and put value to process variable?
Resolution
BPM Suite 6.1.x
In BPM Suite 6.1.x the response will always be available as a String which you can parse to a custom model object using a script task or use BPMN2 transformation. An example using BPMN2 transformation can be found at jbpm test classes.
BPM Suite 6.2.x
BPM Suite 6.2.x supports the parsing of objects using the REST Task as you can see in the project upstream sources.
Root Cause
The response is always parsed to String.
A feature request was raised to have this in a future BPM Suite release, it was already implemented upstream and should be available in BPM Suite 6.2, which is targeted for later this year.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
