AnsweredAssumed Answered

WorkflowInstanceQuery searching with like or contains

Question asked by dave984 on Oct 20, 2014
Latest reply on Oct 21, 2014 by dave984
I've built a simple webscript that accepts in input some paramenters and returns a list of workflows that matches the conditions. This is a simplified version:

WorkflowInstanceQuery workflowInstanceQuery = new WorkflowInstanceQuery();
Map<QName, Object> filters = new HashMap<QName, Object>(9);
if (req.getParameter(MY_PARAM) != null)
     filters.put(QNAME_MYPROP, req.getParameter(MY_PARAM));
workflowInstanceQuery.setCustomProps(filters);
List<WorkflowInstance> workflows = new ArrayList<WorkflowInstance>();
workflows.addAll(workflowService.getWorkflows(workflowInstanceQuery));

List<Map<String, Object>> results = new ArrayList<Map<String, Object>>(workflows.size());
     for (WorkflowInstance workflow : workflows)
     {
         results.add(buildSimple(workflow));                     
     }


This is working perfectly, but now i'd like to have as a result all the workflows that match in like or contains the property in input.
For example if the property in input is valued "hello" i would like to have in output of the webscript the workflows that have that property with values such as "hello" or "hello Dear" or "Say hello" and so on…
This is actually working with search for content in Advanced Search of Alfresco Share…how to implement with WorkflowInstanceQuery?!

Outcomes