cancel
Showing results for 
Search instead for 
Did you mean: 

Complex Data Input through REST API

imsrk
Champ in-the-making
Champ in-the-making
Hi,

I have a requirement wherein I need to initiate a Activiti BPM process through REST Call and the data that needs to be passed in the process variable is bit complex. It's a JPA entity with relationship among entities, I 'm able to convert the JPA entity to JSON but not sure how to model Activiti process to accept such complex data.

For example I want to pass below JSON data to initiate an activiti BPM process, how do I map the BPM Activiti model to accept such related data:

<blockcode>
{
  "author": {
    "id": 1
  },
  "description": "Modular approach",
  "price": 0,
  "publicationDate": "2016-05-31",
  "title": "Test Rest for Activiti"
}
</blockcode>
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
There is a way to defined a custom variable serializer/deseralizer for rest …
but i'm not sure if it's a proper way to do it. I would go with primitive variables and fetch/create the JPA entity with that data, rather than trying to pass it to the workflow.