I'm working on a project which integrates with Alfresco v4.2.e and Activiti v5.13.
I use the REST API to query for tasks through the task-instance service.
When a property is a (collection of) NodeRef, It returns a (collection of) string ("workspace://...."). When I try to update this property, Alfresco throws a ClassCastException saying that String cannot be cast to NodeRef.
Anyway I decided to try the activiti-rest webapp to query directly Activiti. So I searched the war for the 5.13.
Unfortunately the Activiti website doesn't provide a long history of binaries. I had to build the war using the sources from github. When I deployed the compiled war to a Tomcat and tried to get variables through the runtime/tasks service, It throws a ActivitiException "unknown variable type name alfrescoScriptNodeList". Indeed in some Maven repo I've seen some Activiti jars suffixed by "alf". Did I built the wrong war? Is there a fork of the project?
Finally I could write a webscript in Alfresco using the Alfresco Java API but it would be the last option...
Sorry for the length of this text and thanks in advance for your answers.
The task instance is well updated except if I include a property of type NodeRef.
In that case I receive a status code 500 from the Alfresco REST API. When I check the logs of Alfresco, I see this stacktrace:
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to org.alfresco.service.cmr.repository.NodeRef at org.alfresco.repo.workflow.activiti.ActivitiNodeConverter.convertNodes(ActivitiNodeConverter.java:59) at org.alfresco.repo.workflow.AbstractWorkflowNodeConverter.convertNodes(AbstractWorkflowNodeConverter.java:71) at org.alfresco.repo.workflow.AbstractWorkflowNodeConverter.convertNodes(AbstractWorkflowNodeConverter.java:47) at org.alfresco.repo.workflow.AbstractWorkflowPropertyHandler.convertAssociationValue(AbstractWorkflowPropertyHandler.java:106) at org.alfresco.repo.workflow.AbstractWorkflowPropertyHandler.handleAssociation(AbstractWorkflowPropertyHandler.java:60) at org.alfresco.repo.workflow.AbstractWorkflowPropertyHandler.handleDefaultProperty(AbstractWorkflowPropertyHandler.java:166) at org.alfresco.repo.workflow.DefaultWorkflowPropertyHandler.handleProperty(DefaultWorkflowPropertyHandler.java:38) at org.alfresco.repo.workflow.WorkflowPropertyHandlerRegistry.handleVariablesToSet(WorkflowPropertyHandlerRegistry.java:75) at org.alfresco.repo.workflow.activiti.properties.ActivitiPropertyConverter.setTaskProperties(ActivitiPropertyConverter.java:789) at org.alfresco.repo.workflow.activiti.properties.ActivitiPropertyConverter.updateTask(ActivitiPropertyConverter.java:1050) at org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine.updateTask(ActivitiWorkflowEngine.java:2167) at org.alfresco.repo.workflow.WorkflowServiceImpl.updateTask(WorkflowServiceImpl.java:951)
In the PUT HTTP method, I set the property of type NodeRef as follow:
I talked about the Activiti REST API as a workaround: I installed it and configured with the same database as the Activiti bundled with Alfresco to see if I could update task instances by this way. But it's not a good idea.
I hope I have been clearer and thanks for your help.