Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Index - Mapping Issue for duplicate Named Variables at top level #1611

Open
debu999 opened this issue Jan 30, 2023 · 7 comments
Open

Data Index - Mapping Issue for duplicate Named Variables at top level #1611

debu999 opened this issue Jan 30, 2023 · 7 comments

Comments

@debu999
Copy link

debu999 commented Jan 30, 2023

Describe the bug

if there is a variable at parent level in bpmn and similar variable name is also there inside of a java class then it seems data index does not map the data correctly.

Sample Example to demonstrate the issue.

{
  "cd": {
    "createdDate": "2022-03-08T00:00:00Z",
    "updatedDate": "2022-03-08T00:00:00Z",
    "cntdec": "cntDec"
  },
  "createdDate": "2022-03-11T00:00:00Z",
  "lc": {
    "createdDate": "2022-03-09T00:00:00Z",
    "updatedDate": "2022-03-09T00:00:00Z",
    "lc": "lc"
  },
  "updatedDate": "2022-03-12T00:00:00Z",
  "al": {
    "createdDate": "2022-03-10T00:00:00Z",
    "updatedDate": "2022-03-10T00:00:00Z",
    "al": "al"
  }
}

In the above payload we have createdDate inside of obejcts al/cd/lc variables as well as at parent level .
Though the data is persisted correctly but seems the mapping to push to data index overwrites the data.

We get the following output

{
  "data": {
    "Duplicate": [
      {
        "al": {
          "al": "al",
          "createdDate": "2022-03-10T00:00:00Z",
          "updatedDate": "2022-03-10T00:00:00Z"
        },
        "cd": {
          "cntdec": "cntDec",
          "createdDate": "2022-03-08T00:00:00Z",
          "updatedDate": "2022-03-08T00:00:00Z"
        },
        "createdDate": "2022-03-08T00:00:00Z",
        "id": "06ee32c1-e353-481f-8260-a96c2f0bc3a8",
        "lc": {
          "createdDate": "2022-03-09T00:00:00Z",
          "lc": "lc",
          "updatedDate": "2022-03-09T00:00:00Z"
        },
        "updatedDate": "2022-03-08T00:00:00Z",
        "metadata": {
          "lastUpdate": "2023-01-30T05:50:15.6Z",
          "processInstances": [
            {
              "id": "06ee32c1-e353-481f-8260-a96c2f0bc3a8",
              "state": "ACTIVE",
              "roles": null
            }
          ]
        }
      }
    ]
  }
}

You can see the top level createdDate and updatedDate are having value of "2022-03-08T00:00:00Z" This is coming from the data we see in variable cd which as the same variable name within it.
Need to check the mapping logic for the data index.
Screenshot 2023-01-30 at 11 30 17 AM
Screenshot 2023-01-30 at 11 40 06 AM

As you can see the data from cntDec is incorrectly added on createdDate and updatedDate in DI . Need to figure where the mapping have issue for parent level objects.

p.s. Data in db is persisted correclty.

Expected behavior

{
  "data": {
    "Duplicate": [
      {
        "al": {
          "al": "al",
          "createdDate": "2022-03-10T00:00:00Z",
          "updatedDate": "2022-03-10T00:00:00Z"
        },
        "cd": {
          "cntdec": "cntDec",
          "createdDate": "2022-03-08T00:00:00Z",
          "updatedDate": "2022-03-08T00:00:00Z"
        },
        "createdDate": "2022-03-11T00:00:00Z",
        "id": "06ee32c1-e353-481f-8260-a96c2f0bc3a8",
        "lc": {
          "createdDate": "2022-03-09T00:00:00Z",
          "lc": "lc",
          "updatedDate": "2022-03-09T00:00:00Z"
        },
        "updatedDate": "2022-03-12T00:00:00Z",
        "metadata": {
          "lastUpdate": "2023-01-30T05:50:15.6Z",
          "processInstances": [
            {
              "id": "06ee32c1-e353-481f-8260-a96c2f0bc3a8",
              "state": "ACTIVE",
              "roles": null
            }
          ]
        }
      }
    ]
  }
}

Above should have been the output viz. createdDate = 11 Mar and updatedDate=12-mar as per payload.

Actual behavior

{
  "data": {
    "Duplicate": [
      {
        "al": {
          "al": "al",
          "createdDate": "2022-03-10T00:00:00Z",
          "updatedDate": "2022-03-10T00:00:00Z"
        },
        "cd": {
          "cntdec": "cntDec",
          "createdDate": "2022-03-08T00:00:00Z",
          "updatedDate": "2022-03-08T00:00:00Z"
        },
        "createdDate": "2022-03-08T00:00:00Z",
        "id": "06ee32c1-e353-481f-8260-a96c2f0bc3a8",
        "lc": {
          "createdDate": "2022-03-09T00:00:00Z",
          "lc": "lc",
          "updatedDate": "2022-03-09T00:00:00Z"
        },
        "updatedDate": "2022-03-08T00:00:00Z",
        "metadata": {
          "lastUpdate": "2023-01-30T05:50:15.6Z",
          "processInstances": [
            {
              "id": "06ee32c1-e353-481f-8260-a96c2f0bc3a8",
              "state": "ACTIVE",
              "roles": null
            }
          ]
        }
      }
    ]
  }
}

How to Reproduce?

use the attached bpmn2 file to test the error.

duplicate_variable_name.zip

Output of uname -a or ver

Darwin Mac-mini.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103 arm64

Output of java -version

openjdk version "19.0.1" 2022-10-18 OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 19.0.1+10-jvmci-22.3-b08) OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build 19.0.1+10-jvmci-22.3-b08, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

1.33.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) Maven home: /Users/debabratapatnaik/.m2/wrapper/dists/apache-maven-3.8.6-bin/67568434/apache-maven-3.8.6 Java version: 19.0.1, vendor: GraalVM Community, runtime: /Library/Java/JavaVirtualMachines/graalvm-ce-java19-22.3.0/Contents/Home Default locale: en_IN, platform encoding: UTF-8 OS name: "mac os x", version: "13.1", arch: "aarch64", family: "mac"

Additional information

fix the issue in di mapping itsonly result mapping issue.

@debu999
Copy link
Author

debu999 commented Jan 31, 2023

cc @nmirasch @cristianonicolai

@nmirasch
Copy link
Contributor

nmirasch commented Feb 3, 2023

@debu999 Could you please create a jira with all this details in order to improve to have them into account when defining development priorities? Thanks!

@debu999
Copy link
Author

debu999 commented Feb 3, 2023

@nmirasch sure doing it

@nmirasch
Copy link
Contributor

nmirasch commented Feb 3, 2023

@debu999 if you could attach the .proto with the reproducer, could be helpful too

@debu999
Copy link
Author

debu999 commented Feb 3, 2023

Sure 20min will add in

debu999 referenced this issue in debu999/kogito-learn Feb 3, 2023
https://github.com/kiegroup/kogito-apps/issues/1611
change for the details on duplicage variable name mapping.
@debu999
Copy link
Author

debu999 commented Feb 3, 2023

new task jira https://issues.redhat.com/browse/KOGITO-8593 is now created.

@debu999
Copy link
Author

debu999 commented Mar 16, 2023

We will wait for a response on this @nmirasch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants