0 Replies Latest reply on Nov 23, 2009 2:47 PM by Ed Schechter

    Rest call to create a new instance with variables?

    Ed Schechter Newbie

      I'm trying to use Rest interface to create new instance. It's working, but Its not assigning process variables to the new instance.

      Here's the URL to view an instance created through the console (rather than through a direct Rest call), and the data it returns:

      http://localhost:8080/gwt-console-server/rs/process/instance/VacationRequest.10023/dataset


      {dataset ref="VacationRequest.10023"}
      {data key="Done" javaType="java.lang.String"}
      {value xsi:type="xs:string">Submit</value}
      {/data}
      {data key="number_of_days" javaType="java.lang.String"}
      {value xsi:type="xs:string"}5{/value}
      {/data}
      {data key="employee_name" javaType="java.lang.String"}
      {value xsi:type="xs:string"}Hank{/value}
      {/data}
      {/dataset}

      And here's the entire HTML member I'm using to create a new process:

      {form method='post' enctype="multipart/form-data" action="http://localhost:8080/gwt-console-server/rs/process/definition/VacationRequest-1/new_instance"}

      {p}Days: {input type="text" name='number_of_days' id='number_of_days' /}
      {p}Name: {input type="text" name='employee_name' id='employee_name' /}
      {p}

      {/form}


      When I submit this form, with values entered, I am redirected to

      http://localhost:8080/gwt-console-server/rs/process/definition/VacationRequest-1/new_instance

      And see data:

      {
      "id": "VacationRequest.90046",
      "definitionId": "VacationRequest-1",
      "startDate": "2009-11-23 11:24:13",
      "suspended": false,
      "rootToken": {
      "id": "VacationRequest.90046",
      "currentNodeName": "verify_request",
      "children": [],
      "availableSignals": [],
      "canBeSignaled": true
      }
      }

      Finally, when I look at the new instance using

      http://localhost:8080/gwt-console-server/rs/process/instance/VacationRequest.90046/dataset

      I see

      {dataset ref="VacationRequest.90046"/}


      Any insights on why I'm not seeing the number_of_days and employee_name process variables?