My application is interacting with Alfresco workflow by REST. There is a task having association to an object of type cmerson, its value should be collected form the end user -to be used as assignee of the next task-. How can I set this value by REST ??
I tried to send HTTP "PUT" request (content-type:application/json) on URL
where "workspace://SpacesStore/bcb9817f-5778-484b-be16-a388eb18b5ab" is the reference of admin person, but when I end the task (by REST also), Alfresco throws error:
…
Caused by: org.activiti.engine.ActivitiException: Unknown property used in expression: ${cio_employee.properties.userName} … Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Could not find property properties in class java.lang.String
Below is the task and its model definition:
//User Task:
<code>
<userTask id="assignHandler" name="Assign Employee" activiti:assignee="admin" activiti:formKey="cio:assignEmployeeTask"> <documentation>Please, Assign employee to the next task</documentation> <extensionElements> <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string> execution.setVariable('cio_employee', task.getVariable('cio_employee')); </activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> </userTask>
After deeply searching, This REST API doesn't support submitting associated object, it will see the object reference as String. So, I should do some work around in my process definition.