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

MongoDB only persist single item in model containing list attribute

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.20.0.Final
    • 1.18.0.Final
    • Core Engine
    • None
    • False
    • None
    • False
    • 2022 Week 11-13 (from Mar 14)

      create new request:
       
      {
      "request" :

      { "idenpn": "232jjjG", "isclient": false }

      }
       
      and the response shows the two consents (list):
       
      {
      "id": "bba52957-973b-4bf2-9232-cdc31adff736",
      "request":

      { "idenpn": "232jjjG", "isclient": false, "consentTypes": [ "c", "d" ] }

      ,
      "consents": [

      { "type": "c", "accepted": false }

      ,

      { "type": "d", "accepted": false }

      ]
      }
       
       
      but when I get the task, only receive one consent:
       
      [
      {
      "id": "6fa308e5-fb9b-4f43-85ae-93f74ac6af0f",
      "name": "accept",
      "state": 0,
      "phase": "active",
      "phaseStatus": "Ready",
      "parameters": {
      "request":

      { "idenpn": "232jjjG", "isclient": false, "consentTypes": [ "d" ] }

      ,
      "consents": [

      { "type": "d", "accepted": false }

      ]
      },
      "results": {}
      }
      ]
       
       
      The problem only occurs when persist the state in Mongo. When the state is only in memory the list is complete:
       
       
      [
          {
              "id": "817f634a-0b9d-406e-99a4-4494babce2c6",
              "name": "accept",
              "state": 0,
              "phase": "active",
              "phaseStatus": "Ready",
              "parameters": {
                  "request": 

      {                 "idenpn": "4567890H",                 "isclient": false,                 "consentTypes": [                     "c",                     "d"                 ]             }

      ,
                  "consents": [
                      

      {                     "type": "c",                     "accepted": false                 }

      ,
                      

      {                     "type": "d",                     "accepted": false                 }

                  ]
              },
              "results": {}
          }
      ]
       
       The git repository with both examples (wit and without mongo) is here:
       
      https://github.com/ivancordonm/consents/tree/with_mongo
       
      https://github.com/ivancordonm/consents/tree/without_mongo
      For more details, see https://groups.google.com/d/msgid/kogito-development/686f85c5-f0f0-4256-beb8-25ea40221481n%40googlegroups.com

       

              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: