incubator-kie-kogito-examples icon indicating copy to clipboard operation
incubator-kie-kogito-examples copied to clipboard

Controlling output from kogito-drools

Open jiwonjoung opened this issue 3 years ago • 3 comments

I am able to run the dmn-quarkus-example and get the output from model. I am wondering how to customize the format of the output from the model.

For example, I want to remove the original inputs from the response. I also want to add a 'status' field in the returned JSON.

jiwonjoung avatar May 25 '21 18:05 jiwonjoung

AFAIK there is no way to do this at the moment, but we could file a feature request. I think that when we will support custom definition of REST endpoints then you may just expose a custom POJO in your endpoint signature cc @tarilabs

evacchi avatar Jun 30 '21 13:06 evacchi

cc @danielezonca

Since the Swagger/OAS generation is based on the specification conventions, this use-case can only be achieved by manual customisation of (other) REST endpoints by the developer. e.g.: skip REST generation, manually develop REST endpoint using Quarkus as desired.

tarilabs avatar Jun 30 '21 13:06 tarilabs

I think there are way to approach the requirement:

  • remove input from output: we have a similar option when DMN is used connected with Kafka (see option) and I think it could make sense to consider a similar option also for REST (@tarilabs wdyt?)
  • customise the format via JsonMapper (it is already possible)
  • customise the endpoint: for now it is only possible to disable all the REST using this property and then injecting the engine directly and write your own REST endpoint as you need

danielezonca avatar Jun 30 '21 13:06 danielezonca