try {
List<KieContainerResource> containers = new ArrayList<KieContainerResource>();
for (KieContainerInstance instance : context.getContainers()) {
containers.add(instance.getResource());
}
KieContainerResourceList cil = new KieContainerResourceList(containers);
return new ServiceResponse<KieContainerResourceList>(ServiceResponse.ResponseType.SUCCESS, "List of created containers", cil);
} catch (Exception e) {
logger.error("Error retrieving list of containers", e);
return new ServiceResponse<KieContainerResourceList>(ServiceResponse.ResponseType.FAILURE, "Error listing containers: " +
e.getClass().getName() + ": " + e.getMessage());