Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-7712

Kogito's getById API returning null values for Enum fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.26.0.Final
    • None
    • Core Engine
    • None
    • False
    • None
    • False
    • ---
    • ---
    • 2022 Week 29-31 (from Jul 18), 2022 Week 32-34 (from Aug 8)

      Kogito's getById API returning null values for Enum fields (even though data is present in database).
      This happens only when enum is part of nested class in the Main Process model.

      Expected behavior

      get and getById API should return values as saved :

      {
      "id":"string",
      "a":{
      "abc": "abc",
      "classBvar":

      { "somevar":"var", "enumVar":"TEST1" }

      }
      }

      Actual behavior

      {
      "id":"string",
      "a":{
      "abc": "abc",
      "classBvar":

      { "somevar":"var", "enumVar":null }

      }
      }

      How to Reproduce?

      Scenario: 1) Add process variable of type class A in bpmn for any test process. and generate kogito code.
      2) run post API for test process with following payload:
      {
      "a":{
      "abc": "abc",
      "classBvar":

      { "somevar":"var", "enumVar":"TEST1" }

      }
      }

      Sample code:
      public Class A

      { private String abc; private B classBvar; }

      public class B

      { private String somevar; private TestEnum enumvar; }

      public enum TestEnum

      { TEST1, TEST2 }

       

      Reference to https://github.com/kiegroup/kogito-runtimes/issues/2365

              cnicolai@redhat.com Cristiano Nicolai (Inactive)
              cnicolai@redhat.com Cristiano Nicolai (Inactive)
              Marian Macik Marian Macik
              Marian Macik Marian Macik
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: