cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco: query tasks with custom nodes properties

amekki
Champ on-the-rise
Champ on-the-rise
I have a workflow task that refer to a specific nodeRef. This node has some properties. I would like to create a query that gives all tasks with specific values of some properties (contained in the node). With WorkflowTaskQuery, I can query taks with custom properties handled by the task. Is it possible to modifiy WorkflowTaskQuery or to use luceneSearch for this purpose? I can get such tasks using workflowTaskQuery and filter the result, but this solution is execution time expensive.

Thanks,
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

see my response to your other question about workflow queries in <a href="https://forums.alfresco.com/forum/developer-discussions/workflow/alfresco-query-workflow-tasks-list-...">this thread</a>. By default, you can't search workflows / tasks based on the properties of an associated document unless you duplicate these properties as workflow or task properties - only then would you be able to use WorkflowQuery to query workflows / tasks. Duplication could be done via an Activiti task listener inside your process definition that executes a small JavaScript script. Of course, you'd also need to add the necessary properties / aspects to your workflow / task model.

The proof-of-concept I was referring to in the other reply actually contains a mapping hook which allows us to define which properties of associated content can be used to search for workflows / tasks using SOLR / Lucene.
We may consider bundling the functionality to search for workflows / tasks using SOLR / Lucene into our commercial "Enhanced Search" addon in the near future.

Regards
Axel

amekki
Champ on-the-rise
Champ on-the-rise
Thank your for the reply!