Hi all,
We are trying to set a logical OR in Alfresco REST API where clause, especifically on task endpoint from workflow REST API. We are not sure whether this is possible or not, and we are unable to find any referencea on these "where" clauses syntax.
Is what we are trying possible? Is there any reference documentation about these clauses in REST API?
Thanks a lot.
Solved! Go to Solution.
If anyone interested, here's the solution:
We were assigning tasks to a candidateGroup, not candidateUsers. So, when retrieving tasks through the /task endpoint, we had to set the "where" clause to "(candidateGroup=GROUP_XXX)". Without this clause, no results were returned.
The solution is to set the "where" clause to "(candidateUser=<username>)". Looking at the code, when this variable is set, it looks for all user's groups that are candidateGroup for existing tasks.
This clause is used in another REST API endpoints. This solution is useful for this specific use case, I'm not sure whether other "where" clauses from other endpoints will be able to handle an OR operator.
Hope this helps someone
From the source code:
I guess that "where" parameter is missed. So, likely, this option is not available from REST API.
Hi Angel,
We previously used the "where" clause, because we are trying to retrieve all tasks that are assigned to a candidate group, for a specific users of this group.
If we don't set this clause, no taks are returned, because, as stated in the API docs "Tasks are returned for which the authenticated user is the assignee or a candidate."
We reached this part of the code, and although I don't fully understand it, it seems that is not capable to handle OR operations. I will wait a bit to see whether someone faced the same problem.
For the record, we tried using OR keyword, using ldap-style operators (|(clause1)(clause2)), usgin java-like operators (| and || between clauses), and no one seems to be working...
Thanks again for your responses
If anyone interested, here's the solution:
We were assigning tasks to a candidateGroup, not candidateUsers. So, when retrieving tasks through the /task endpoint, we had to set the "where" clause to "(candidateGroup=GROUP_XXX)". Without this clause, no results were returned.
The solution is to set the "where" clause to "(candidateUser=<username>)". Looking at the code, when this variable is set, it looks for all user's groups that are candidateGroup for existing tasks.
This clause is used in another REST API endpoints. This solution is useful for this specific use case, I'm not sure whether other "where" clauses from other endpoints will be able to handle an OR operator.
Hope this helps someone
Hi @narkuss
Thanks for providing your update. I've made this an accepted solution - since you've found an answer and this will hopefully help other users.
Cheers,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.