cancel
Showing results for 
Search instead for 
Did you mean: 

Searching tasks by complex variables values

aalaa
Champ in-the-making
Champ in-the-making
The rest api saves the complex objects as byte array, that makes it impossible to query the tasks using the values assigned to the complex variable saved with the task…
So has is it possible to query the tasks using the task variable values in that case ??
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
It's possible to register custom serializers for that. From the docs:

"It’s possible to support additional variable-types with a custom JSON representation (either simple value or complex/nested JSON object). By extending the initializeVariableConverters() method on org.activiti.rest.service.api.RestResponseFactory, you can add additional org.activiti.rest.service.api.engine.variable.RestVariableConverter classes to support converting your POJO’s to a format suitable for transferring through REST and converting the REST-value back to your POJO. The actual transformation to JSON is done by Jackson."

aalaa
Champ in-the-making
Champ in-the-making
If i implemented the custom complex object, is it possible to query tasks based on values assigned to fields in that object using REST calls ?
For example using the where clause : http://docs.alfresco.com/5.0/pra/1/concepts/act-tasks-get-tasks.html
It would be great if you can provide any references on how to implement this

jbarrez
Star Contributor
Star Contributor
You're referencing the alfresco docs … so I'm assuming you're using Activiti in Alfresco?
If so, sadly my answer above does not apply: Alfresco has it's own REST APi that is very different from the Activiti one.
I'd guess in Alfresco you have to use a custom webscript to do that …. but then you'd also need a custom query to be able to query it properly. I don't know how that would be done in Alfresco exactly.

aalaa
Champ in-the-making
Champ in-the-making
yes, I'm using activiti in alfresco…
Can't find a thing about that in the documentation which is weird