use of org.kie.server.services.dmn.modelspecific.OASGenerator in project droolsjbpm-integration by kiegroup.
the class ModelEvaluatorServiceBase method getOAS.
public Response getOAS(String containerId, boolean asJSON) {
try {
KieContainerInstanceImpl kContainer = context.getContainer(containerId, ContainerLocatorProvider.get().getLocator());
ReleaseId resolvedReleaseId = kContainer.getKieContainer().getResolvedReleaseId();
DMNRuntime dmnRuntime = KieRuntimeFactory.of(kContainer.getKieContainer().getKieBase()).get(DMNRuntime.class);
Collection<DMNModel> models = dmnRuntime.getModels();
String content = new OASGenerator(containerId, resolvedReleaseId).generateOAS(models, asJSON);
return Response.ok().entity(content).build();
} catch (Exception e) {
LOG.error("Error from container '" + containerId + "'", e);
return Response.serverError().entity(e.getMessage()).build();
}
}
Aggregations