public List<DocumentModel> getRouteModelSuggestions(Object input) throws ClientException { DocumentRoutingService documentRoutingService = Framework.getLocalService(DocumentRoutingService.class); return documentRoutingService.searchRouteModels(documentManager, (String) input); }
/** * @since 5.6 */ public List<DocumentModel> getFilteredRouteModels() throws ClientException { DocumentRoutingService documentRoutingService = Framework.getLocalService(DocumentRoutingService.class); List<DocumentModel> routeModels = documentRoutingService.searchRouteModels( documentManager, ""); for (Iterator<DocumentModel> it = routeModels.iterator(); it.hasNext();) { DocumentModel route = it.next(); Object graphRouteObj = route.getAdapter(GraphRoute.class); if (graphRouteObj instanceof GraphRoute) { String filter = ((GraphRoute) graphRouteObj).getAvailabilityFilter(); if (!StringUtils.isBlank(filter)) { if (!webActions.checkFilter(filter)) { it.remove(); } } } else { // old workflow document => ignore it.remove(); } } return routeModels; }
try (SessionWrapper wrapper = ctx.getSession(document)) { DocumentRoutingService documentRoutingService = Framework.getService(DocumentRoutingService.class); List<DocumentModel> routeModels = documentRoutingService.searchRouteModels(wrapper.getSession(), "");