cancel
Showing results for 
Search instead for 
Did you mean: 

Issue of rest api about startprocessinstance with form property

davidzhang
Champ in-the-making
Champ in-the-making
hi,
i want to start process with rest api, i take vacationrequest as example.
post request:
POST runtime/process-instances
request body:
{
   "processDefinitionKey":"vacationRequest",
     "variables": [
      {
        "name":"employeeName",
        "value":"kermit"
      },{
        "name":"numberOfDays",
        "value":4
      },{
        "name":"startDate",
        "value":"1-1-2001"
      }
   ]
}

throw exceptions below:
Exception or error caught in resource
org.activiti.engine.ActivitiException: Unknown property used in expression: ${em
ployeeName} would like to take ${numberOfDays} day(s) of vacation (Motivation: $
{vacationMotivation}).
        at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.ja
va:53)
        at org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior.execu
te(UserTaskActivityBehavior.java:53)
………

I am very appreciate for any suggestions, thanks

3 REPLIES 3

trademak
Star Contributor
Star Contributor
A quick look tells me that you don't have a vacationMotivation variable set, is that correct?

Best regards,

davidzhang
Champ in-the-making
Champ in-the-making
thanks, i get it to work, but why do I need to input vacationMotivation variable, it is not required in BPMN xml.

jbarrez
Star Contributor
Star Contributor
No, the xml does not declare variables. But the form does use.