Skip to main content
1-Visitor
September 29, 2011
Question

Windchill - QuerySpec

  • September 29, 2011
  • 2 replies
  • 1668 views
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

1-Visitor
September 30, 2011
TimestampRangeSearch.. A special type of search condition. If you cannot
figure it out form there, let me know.