Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Translate the entire conversation x

Return objects from custom task

ashishbhusa
13-Aquamarine

Return objects from custom task

I have written a custom task to fetch WTGroup objects belonging to a particular PDMLinkProduct. Following is the code that I have used:

 

 

QuerySpec qs = new QuerySpec(WTGroup.class);
qs.appendWhere(new SearchCondition(WTGroup.class, "containerReference.key.classname", SearchCondition.EQUAL, product.getPersistInfo().getObjectIdentifier().getClassname().toString()));
qs.appendAnd();
qs.appendWhere(new SearchCondition(WTGroup.class,"containerReference.key.id", SearchCondition.EQUAL, product.getPersistInfo().getObjectIdentifier().getId()), new int[] { 0 });
QueryResult qr = PersistenceHelper.manager.find(qs);

 

 

But I'm unable to return these fetched WTGroups in QueryResult using Return-Groups.

 

Does anyone know how to return these objects from the custom task?

0 REPLIES 0
Announcements


Top Tags