apache / incubator-kie-kogito-runtimes

Kogito Runtimes - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
Apache License 2.0
491 stars 192 forks source link

[Fix_#3465] Adds DMN support to SonataFlow #3468

Closed fjtirado closed 2 months ago

fjtirado commented 2 months ago

Fixes https://github.com/apache/incubator-kie-kogito-runtimes/issues/3465 A new DMN custom type (called "dmn") has been added to swf parser. The mapping is either automatically performed from the workflow model (if the name matches), so there is not need to provide args. If the workflow model names does not match, the workflow writer should provide the mapping as argument of the function call.

This is the workflow definition used in the unit test (which just calls the traffiction violation decision from the workflow)

{
  "id" : "traffic-violation",
  "name" : "traffic-violation",
  "version" : "1_0",
  "start" : "traffic-violation",
  "functions" : [ {
    "name" : "DMNTest",
    "operation" : "dmn",
    "type" : "custom",
    "metadata" : {
      "file" : "Traffic Violation.dmn",
      "namespace" : "https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF",
      "model" : "Traffic Violation"
    }
  } ],
  "states" : [ {
    "actions" : [ {
      "functionRef" : "DMNTest"
    } ],
    "name" : "traffic-violation",
    "type" : "operation",
    "end" : true
  } ]
}

See example https://github.com/apache/incubator-kie-kogito-examples/pull/1906

baldimir commented 2 months ago

Hi, I opened a thread on the dev mailing list about this, because I didn't saw one there. Let's see if we have an agreement about this there. I think it is worth discussing it.