use of org.kie.workbench.common.stunner.core.lookup.diagram.DiagramLookupRequest in project kie-wb-common by kiegroup.
the class DMNShowcaseDiagramService method loadByName.
public void loadByName(final String name, final ServiceCallback<Diagram> callback) {
final DiagramLookupRequest request = new DiagramLookupRequest.Builder().withName(name).build();
clientDiagramServices.lookup(request, new ServiceCallback<LookupManager.LookupResponse<DiagramRepresentation>>() {
@Override
public void onSuccess(LookupManager.LookupResponse<DiagramRepresentation> diagramRepresentations) {
if (null != diagramRepresentations && !diagramRepresentations.getResults().isEmpty()) {
final Path path = diagramRepresentations.getResults().get(0).getPath();
loadByPath(path, callback);
}
}
@Override
public void onError(final ClientRuntimeError error) {
callback.onError(error);
}
});
}
Aggregations