cancel
Showing results for 
Search instead for 
Did you mean: 

WorkflowInstanceQuery searching with like or contains

dave984
Champ in-the-making
Champ in-the-making
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?!
1 REPLY 1

dave984
Champ in-the-making
Champ in-the-making
Nobody have any idea?!Maybe the question is not clear?!