06-14-2021 04:12 AM
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.
06-14-2021 06:52 AM
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
06-14-2021 05:16 AM
From the source code:
I guess that "where" parameter is missed. So, likely, this option is not available from REST API.
06-14-2021 05:48 AM
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
06-14-2021 06:52 AM
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
06-14-2021 12:02 PM
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,
Explore our Alfresco products with the links below. Use labels to filter content by product module.