Kogito DMN - endpoint with version

167 views
Skip to first unread message

francisco boato

unread,
Apr 11, 2022, 8:50:33 AM4/11/22
to Kogito development mailing list
Hello, i would like to know if there is any configuration option for kogito (under spring-boot) to add a version to the endpoint generated from a DMN model.  For example  if my DMN Model Name si "TrafficViolation" i would like and endpoint like this "..../v1/ TrafficViolation".
Francisco

Marco Iannelli

unread,
Apr 12, 2022, 3:55:09 AM4/12/22
to Kogito development mailing list
Hi,
check this if it might be helpful  Spring Boot Change Context Path | Baeldung 

regards
Marco

francisco boato

unread,
Apr 12, 2022, 8:44:30 AM4/12/22
to Kogito development mailing list

Hi, it wont' work changing the context-path of the application, for example if I have 2 DMN i may want to create a new version of just one dmn.  I know I can just change the name of the dmn model, but I was just wandering if there is some functionality or configuration of KOGITO  that enable to handle the versioning of the rest api generated from the dmn model.

Matteo Mortari

unread,
Apr 12, 2022, 6:13:39 PM4/12/22
to Kogito development mailing list
Hi Fancisco,
one option is that you could "scaffold" the rest endpoint and change their @Path annotation to suit your needs.

My personal suggestion however, would be first to actually define your own endpoints "in parallel" of the code-generated ones, having the @Path you want, and delegate the invocation.
Next, you can decide if to implement the scaffold approach, or just "adopt" the inner code, or keep them in parallel and forbid direct access to the code-generated via Quarkus/SB configurations.

Hope this helps!
MM

On Mon, 11 Apr 2022 at 14:50, francisco boato <francis...@gmail.com> wrote:
Hello, i would like to know if there is any configuration option for kogito (under spring-boot) to add a version to the endpoint generated from a DMN model.  For example  if my DMN Model Name si "TrafficViolation" i would like and endpoint like this "..../v1/ TrafficViolation".
Francisco

--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/78b5307a-26fc-4211-a270-5c0430c14a20n%40googlegroups.com.


--

Rhett S

unread,
May 6, 2022, 11:22:27 PM5/6/22
to Kogito development mailing list
Francisco, you can copy the generated code from the target folder, move it into the src folder, disable the generate-code plugin. then can modify the kogito controller all you want. 
worked in kogito 1.17- at least. R

Ravi Mangalagiri

unread,
May 7, 2022, 8:34:22 AM5/7/22
to Kogito development mailing list
I agree with Matteo. This is what I tried for versioning.
1. Define the version in the namespace, so that codegen generates in the right package.
 Screen Shot 2022-05-07 at 8.05.53 AM.png
2. Make sure to add the package in the component scan 
Screen Shot 2022-05-07 at 8.13.18 AM.png
3. Follow Matteo's instructions by creating a new controller with the required endpoint for now.
4. And follow me 😎 in the queue waiting for the feature below in Kogito's future releases, to be able to do run dmn through its namespace
var id = appRoot
.get(DecisionIds.class)
"Traffic Violation")
.services()
.get("my-service-id");
// evaluate the decision and return the result
var res = dmnSvc.evaluate(id, ctx);

Thanks
Ravi M



--
Ravi Mangalagiri
Reply all
Reply to author
Forward
0 new messages