AnsweredAssumed Answered

REST Api questions

Question asked by erainero on Nov 9, 2011

I am driving activiti 5.8 from C# over the REST API
I am having quite a bit of succes. I have run into a few challenges and am looking for advise.

This is the set of capabilities i need from REST, but have questions/confusion over some of the capabilities.

SUPPORTED get list of process definitions
SUPPORTED get single process definition
??????????? get single process instance - my question #4
SUPPORTED get process definition diagram
SUPPORTED start process instance
SUPPORTED get process instance diagram
??????????? get process instance variables - my question #1
SUPPORTED get available user tasks
??????????? get form fields (as json) for user task - my question #2
SUPPORTED claim user task
PARTIAL??? complete user task, sending back form fields as processinstance variables  - my question #3

1. Is it possible to get the list of processinstance variables over rest?
   currently i am getting the variables via the ACT_HI_DETAIL over rest  GET /management/table/{tableName}/data
  This works, but seems a bit awkward. Am i looking in the right table? Is there a cleaner way?

2. Is it possible to get the list of usertask form fields over rest?
   currently i am going from the usertask to the processinstance to the process definition. getting the xml resource. and
   then using xpath on the xml
string query = String.Format("//default:userTask[@id='{0}']/default:extensionElements/activiti:formProperty", this.taskDefinitionKey);
   this works but seems awkward.

3. When i complete a task, i am trying to add the usertask formfields back as processinstance variables without success.
This is the http put i am using. the task completes, but the variables dont seem to persist in the database.

Content-Type: application/json
Authorization: Basic a2VybWl0Omtlcm1pdA==
Content-Length: 32
Expect: 100-continue
Connection: Keep-Alive

{"CustomerName":"Customer Name"}

4. Is there a way to get the details on a single process instance without getting all process-instances back?
   Are process instance variables part of the response?

I am considering adding to the REST API, but would like to use the existing API if possible first.

Thanks in advance