Hi all. I am new to the forum. I have a question about the json structure when starting a new instance of an process using the REST API.
It states you send in the instance variables using a name / value pair. But you are not able to change the name parameter. Lets say you have 3 parameters then the json will look like this .
{
"processDefinitionId":"LoanProcess:1:35",
"businessKey":"LoanProcess",
"variables": [
{
"name":"income",
"value": 50000,
"name":"loanAmount",
"value": 20000 ,
"name":"limitAmount",
"value": 5000
}
]
}
This does not comply with the json rules. IT should look like this.
{
"processDefinitionId":"LoanProcess:1:35",
"businessKey":"LoanProcess",
"variables": [
{
"name1":"income",
"value1": 50000,
"name2":"loanAmount",
"value2": 20000 ,
"name3":"limitAmount",
"value3": 5000
}
]
}
But then you get a 500 response error that states it does not know the variable name "name1"
Am I doing something wrong ?
Kind Regards.
Hello,
i guess you have misunderstood it here variables is kind of HashMap which holds key="name" and value="value" so you are adding the key and value pairs to the HashMap with variables names and its vallues. important here is the name property should be unique else it will get overridden.
I hope this explaination is helpful to you.
Hi. thanks for the reply. So this method to add 3 variables is correct even if postman says the json format is not correct as the name and value tags are there 3 times.
{
"processDefinitionId":"LoanProcess:1:35",
"businessKey":"LoanProcess",
"variables": [
{
"name":"income",
"value": 50000,
"name":"loanAmount",
"value": 20000 ,
"name":"limitAmount",
"value": 5000
}
]
}
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.