AnsweredAssumed Answered

Passing variables REST API

Question asked by adgonzal on Oct 1, 2013
Latest reply on Oct 3, 2013 by krull80
I'm trying to pass variables to the process when I create an instance via REST API but Im getting an error.

My process BPMN has declared this section:
<startEvent id="startevent2" name="Start" activiti:initiator="initiator">
      <extensionElements>
        <activiti:formProperty id="approver" name="Approver" type="user" required="true" />
        <activiti:formProperty id="duedate" name="Approval due date" datePattern="dd-MM-yyyy hh:mm" type="date"  />
        <activiti:formProperty id="invoiceNumber" name="Invoice Number" type="string" required="true"/>
   <activiti:formProperty id="invoiceAmount" name="Invoice Amount" type="long" />
   <activiti:formProperty id="supplierName" name="Supplier Name"    type="string" />
   <activiti:formProperty id="supplierNif" name="Supplier Nif"    type="string" />
   <activiti:formProperty id="supplierId"    name="Supplier ID"    type="string" />
   <activiti:formProperty id="companyName" name="Supplier Name"    type="string" />
   <activiti:formProperty id="companyNif" name="Supplier Nif"    type="string" />
   <activiti:formProperty id="companyId"    name="Supplier ID"    type="string" />
      </extensionElements>
    </startEvent>

and I send a JSON request qith these values:


{
  "processDefinitionKey":"invoicesApprovalProcess",
  "businessKey":"A1234567",
  "variables": [
      {
        "invoiceNumber":"A1234567",
        "invoiceAmount":"123",
   "supplierName":"supplierName",
        "supplierNif":"supplierNif",
   "supplierId":"supplierId",
        "companyName":"companyName",
   "companyNif":"companyNif",
        "companyId":"companyId",
   "approver":"kermit"
      }
  ]   
}

I think is not possible to assign form properties passing variables but….
How can I declare variables for the process?

The Rest API throws an Jackson UnrecognizedPropertyException; Unrecognized field "invoiceNumber"

Thanks in advance

Outcomes