Skip to main content
13-Aquamarine
September 18, 2018
Question

Return objects from custom task

  • September 18, 2018
  • 0 replies
  • 765 views

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?

This topic has been closed for replies.