cancel
Showing results for 
Search instead for 
Did you mean: 

Query by Date & NodeRef As String does not working properly

mohammed_amr
Champ in-the-making
Champ in-the-making
Dear Team,

I have set of workflows instances and tasks, and i used WorkflowTaskQuery for query about tasks with custom task properties, even though when i set a (Date, NodeRef As String) values in the custom properties ( & i ensure that this values exists in some of tasks) and pass it for the query the resulted array list of task query is empty.

Notice that when i pass a string values the returned result set is not empty, can any one clarify this issue, cause i have a subsystem depends on the WorkflowTaskQuery.

Thanks
Mohammed Amr.
Senior System Developer.
10 REPLIES 10

mitpatoliya
Star Collaborator
Star Collaborator
can you post the query which you are using for this?
It will give more idea.

mohammed_amr
Champ in-the-making
Champ in-the-making
lets i use the following code

WorkflowTaskQuery query = new WorkflowTaskQuery();

Map<QName,Serializable> properties = new HashMap<QName,Serializable>();
properties.set(QName.createQName("sec","creationDate"),new Date());
query.setCustomTaskProps(properties);

workflowService.query(query); // No Results returned although there is a tasks in the console has this value

another example about nodeRef

WorkflowTaskQuery query = new WorkflowTaskQuery();

Map<QName,Serializable> properties = new HashMap<QName,Serializable>();
properties.set(QName.createQName("sec","sender"),nodeRef.getNodeRefAsString());
query.setCustomTaskProps(properties);

workflowService.query(query); // No Results returned although there is a tasks in the console has this value

yogeshpj
Star Contributor
Star Contributor
Hi mohammed.amr,

Can you please try processCustomProps. Please try query.setProcessCustomProps(properties).

mohammed_amr
Champ in-the-making
Champ in-the-making
already tried. Smiley Happy

yogeshpj
Star Contributor
Star Contributor
Can you please show me the query you are executing and the property entry in workflow model which you are adding in taskcustomprops ?

mohammed_amr
Champ in-the-making
Champ in-the-making
Good,

Listen, i have two way of search upon workflow, one of them by task and another by process.

neither task or process takes a date as a parameter. you can try to search by by date using workflow console and you will reach for this conclusion.

Thanks.

yogeshpj
Star Contributor
Star Contributor
Yes,You are right. Taskcustomprops and processcustomprops are not accepting date as parameter.

mohammed_amr
Champ in-the-making
Champ in-the-making
Smiley Very Happy

That what i'm trying to do, search by date. However all workflow properties must be string. Try to search by nodeRef you cannot.

That miss-functionality in workflow search.

Thanks

swemon
Champ on-the-rise
Champ on-the-rise
I have the same problem.. I can't find workflow tasks by completion date.
Smiley Sad