How to update task property of type NodeRef using REST API?

cancel
Showing results for 
Search instead for 
Did you mean: 
eugen_p
Active Member

How to update task property of type NodeRef using REST API?

Hi,

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.

I found this bug on your jira [ALF-2705] ClassCastException in getProperties() - Alfresco JIRA  which seems to be related to my problem but in the other direction. Is my problem a bug? Is this a bug fixed in the v4.2.f? Did I do something wrong?

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.

3 Replies
ryandawson
Alfresco Employee

Re: How to update task property of type NodeRef using REST API?

I think that means that the variables being put into the Activiti database that the content app is using are of a type that the activiti-rest app doesn't know how to read. Presumably they are java objects that are being serialized and the classpath of the activiti-rest app doesn't have those types available for them to be deserialized. I think this question is more about the Content Repository than it is about Activiti. Your post is currently only visible to the Activiti and BPM forum. You might get a better response by reposting under Alfresco Content Services (ECM)  or adding the Alfresco Content Services (ECM) visibility to your post. You might be best to create a new post there and reference this one your new post will then appear at the top under ECM.

eugen_p
Active Member

Re: How to update task property of type NodeRef using REST API?

Thanks for your feedback. I will create a new post in the ECM forum.

eugen_p
Active Member

Re: How to update task property of type NodeRef using REST API?

For your information, the new post is located at