use of org.kie.workbench.common.stunner.core.lookup.rule.RuleLookupRequest in project kie-wb-common by kiegroup.
the class CommonLookups method lookupConnectionRules.
private <T> List<Rule> lookupConnectionRules(final String defSetId, final T sourceDefinition, final String edgeId, final int page, final int pageSize) {
if (null != defSetId) {
final Set<String> defLabels = getDefinitionLabels(sourceDefinition);
final RuleLookupRequest.Builder builder = new RuleLookupRequest.Builder();
builder.definitionSetId(defSetId).type(RuleLookupRequest.Builder.RuleType.CONNECTION).from(defLabels).page(page).pageSize(pageSize);
if (null != edgeId) {
builder.id(edgeId);
}
final RuleLookupRequest request = builder.build();
final LookupManager.LookupResponse<Rule> response = ruleLookupManager.lookup(request);
return response.getResults();
}
return null;
}
Aggregations