On a process implementation, I would like to manage a status on the tasks. For example, on a service task implementing a WSDL interface, I would like to manage the status of the request. If request is OK, then put a status to OK, If request is not OK (example no answer from the partner), I would like to put "Basket" on the status, in order to manage a retry or not as to force Ok or KO. How can we manage this kind of operation on Activiti ?
The easiest is just to put the response in a process variable. To implement that, don't use the webservice task of BPMN, but use a regular Java Delegate and call the webservice your self (eg using Camel, Spring, JAX-WS). That way you have full control over what you store afterwards.
That's mean that no structure is managed in the Activiti Database ? No persistence done on the structure of the process instance ?
Then how is managed the following result : {"activityId":"task1","activityName":"task1","activityType":"serviceTask","startTime":"2013-04-18T10:11:52CEST","completed":true,"endTime":"2013-04-18T10:11:52CEST","duration":16} Especially the value "completed" on the task ?
When there is no ACT_RU_TASK anymore, the task is completed (no Task instance left). Also, the HistoricTaskInstance has an endTime(). If not ended, the task is not completed… You can use those entities to check the state of a task, using the API.