cancel
Showing results for 
Search instead for 
Did you mean: 

Updating process viarables via REST

jaco1
Confirmed Champ
Confirmed Champ

Hi all.

When I send a list of variables only the last one is updated.

PUT

https://10.64.9.134:9445/bpmn/runtime/process-instances/5001/variables

[
      {
        "name":"income",
        "type":"integer" ,
        "value":20000 ,
        "name":"loanAmount",
        "type":"integer" ,
        "value":500
      }
      
]

Then the response will be

{
    "restVariables": [
        {
            "valueUrl": null,
            "variableScope": "LOCAL",
            "scope": "local",
            "name": "loanAmount",
            "value": 500,
            "type": "integer"
        }
    ]
}

Also when I create a instance and send the list of variables only the last one is set. What am I doing wrong with the list ?

How do I set a list of more than one ?

1 ACCEPTED ANSWER

jaco1
Confirmed Champ
Confirmed Champ

OK I got it working. The JSON should look like this

[
      {
        "name":"income",
        "type":"integer" ,
        "value":100
      },
      {
        "name":"loanAmount",
        "type":"integer" ,
        "value":200
      }
      
]

View answer in original post

1 REPLY 1

jaco1
Confirmed Champ
Confirmed Champ

OK I got it working. The JSON should look like this

[
      {
        "name":"income",
        "type":"integer" ,
        "value":100
      },
      {
        "name":"loanAmount",
        "type":"integer" ,
        "value":200
      }
      
]