@Test public void testFilterDocuments() throws OperationException { DocumentModelList docs = session.query("Select * from Document"); assertThat(docs.size()).isNotEqualTo(1); ctx.setInput(docs); Map<String, Object> params = new HashMap<>(); params.put("condition", "Document.name == 'test'"); DocumentModelList filtered = (DocumentModelList) service.run(ctx, FilterDocuments.ID, params); assertThat(filtered).hasSize(1); }
@OperationMethod(collector = DocumentModelListCollector.class) public DocumentModelList run(DocumentModel doc) { Condition cond = new Condition(); DocumentModelList ret = new DocumentModelListImpl(); if (cond.accept(doc)) { ret.add(doc); } return ret; }
FilterDocuments { @OperationMethod(collector = DocumentModelListCollector.class) public DocumentModelList run(DocumentModel doc) { Condition cond = new Condition(); DocumentModelList ret = new DocumentModelListImpl(); if (cond.accept(doc)) { ret.add(doc); } return ret; } }
FilterDocuments { @OperationMethod(collector = DocumentModelListCollector.class) public DocumentModelList run(DocumentModel doc) { Condition cond = new Condition(); DocumentModelList ret = new DocumentModelListImpl(); if (cond.accept(doc)) { ret.add(doc); } return ret; }  }
FilterDocuments { @OperationMethod(collector = DocumentModelListCollector.class) public DocumentModelList run(DocumentModel doc) { Condition cond = new Condition(); DocumentModelList ret = new DocumentModelListImpl(); if (cond.accept(doc)) { ret.add(doc); } return ret; }  @OperationMethod(collector = DocumentModelListCollector.class) DocumentModelList run(DocumentModel doc); }
FilterDocuments { @OperationMethod(collector = DocumentModelListCollector.class) public DocumentModelList run(DocumentModel doc) { Condition cond = new Condition(); DocumentModelList ret = new DocumentModelListImpl(); if (cond.accept(doc)) { ret.add(doc); } return ret; }  @OperationMethod(collector = DocumentModelListCollector.class) DocumentModelList run(DocumentModel doc); static final String ID; }