workflows = new ArrayList<MyleadWorkflowMetadata>();
try {
ContextQueryRequestDocument query = ContextQueryRequestDocument.Factory
.newInstance();
ContextQueryRequestType params = query
.addNewContextQueryRequest();
QueryObjectType target = params.addNewQueryTarget();
target.setAggrType(CatalogAggregationType.COLLECTION);
ContextQueryType context = params.addNewContextQuery();
QueryComponentType parentCollection = context
.addNewQueryComponent();
parentCollection.setAggrType(CatalogAggregationType.COLLECTION);
parentCollection.setRelation(ContextType.DIRECT_PARENT);
QueryPropertyType titleProperty = parentCollection
.addNewQueryProperty();
titleProperty.setName("citation");
titleProperty.setSource("LEAD");
QueryElementType titleElement = titleProperty
.addNewQueryElement();
titleElement.setName("title");
titleElement.setSource("LEAD");
QueryTextElementType textCriteria = titleElement
.addNewQueryTextElement();
textCriteria.setCompare(TextComparisonType.EXACT);
textCriteria.setValue(WORKFLOW_TEMPLATES_COLLECTION);
QueryComponentType project = parentCollection
.addNewQueryComponent();
project.setAggrType(CatalogAggregationType.PROJECT);
project.setRelation(ContextType.PARENT);
project.setObjectId(projectID);
QueryResultConfigurationType config = params
.addNewQueryResultConfiguration();
config.setOffset(0);
config.setCount(0);
config.setHierarchyFilter(HierarchyFilterType.TARGET);
ElementFilterType filterTitle = config.addNewElementFilter();