cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Windchill - QuerySpec

dgraham-4
Newbie

Windchill - QuerySpec

Windchill 8.0 M020

Anyone have the code to limit the scope of a QuerySpec to between two
given dates (Timestamps)?

I'm trying to query WfActivity class

I've got this much:

QuerySpec qs = new QuerySpec(WfActivity.class);
qs.appendWhere(new SearchCondition(WfActivity.class,
WfActivity.NAME, SearchCondition.EQUAL, assignmentName), null);
qs.appendAnd();
qs.appendWhere(new SearchCondition(WfActivity.class,
WfActivity.STATE,SearchCondition.EQUAL,"CLOSED_COMPLETED_EXECUTED"),
null);
qs.appendOr();
qs.appendWhere(new SearchCondition(WfActivity.class,
WfActivity.STATE,SearchCondition.EQUAL,"OPEN_RUNNING"), null);

QueryResult qr = PersistenceHelper.manager.find((StatementSpec)
qs);

but I need to limit the scope to a date range as well.

Thanks

David Graham
CAx/PDM Administrator


Emhart Glass Manufacturing Inc.
Emhart Glass Research Center
123 Great Pond Drive | PO Box 220 | Windsor, CT 06095-0220 | USA
Telephone +1 (860) 298 7377 | Telefax +1 (860) 298 7397
Mobile +1 (203) 376-3144 |
2 REPLIES 2

Windchill - QuerySpec

TimestampRangeSearch.. A special type of search condition. If you cannot
figure it out form there, let me know.




Windchill - QuerySpec

I guess, you could add conditions on the createStamp or updateStamp on the
table.


Praseeth M

> qs.appendOr();
> qs.appendWhere(new SearchCondition(WfActivity.class,
> WfActivity.STATE,SearchCondi...








Announcements