Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-3274

Persisting in mappedvariable table comes null entry in its map_var_id

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • None
    • 7.7.0.GA
    • jBPM Core, Kie-Server
    • Red Hat Process Automation Manager 7.7.0 (RHPAM)

      Openshift (OCP) 3.11

    • False
    • False
    • Undefined
    • Hide

       
       
      I made some modifications in the pom.xml file from the attached project using <version>7.33.0.Final</version> in its dependencies instead of <version>7.14.0.Final</version>, also I added the drool-persistence-jpa such as:

       <dependency>
            <groupId>org.drools</groupId>
             <artifactId>drools-persistence-jpa</artifactId>
             <version>7.33.0.Final</version>
            <scope>provided</scope>
        </dependency>
      

       
      Also I modified Person class to extend org.drools.persistence.jpa.marshaller.VariableEntity to have the persistence in the mappedvariable table.
       
      1. We used the same payload to start the process instance:
       

       {
           "Person": {
               "org.kvarela.pvp_example.Person": {
                   "age": 25,         
                   "name": "teste"     
                }
            }
       }
      

       

       jbpmdb=# select * from mappedvariable;
        mappedvarid | processinstanceid | taskid | variableid|          variabletype                 | optlock | workitemid | map_var_id 
       -----------------++-----------------------------++--------------------------------------------------------++------------------------------------------------------------------------------
                -38         |                    60           |            |        -27    | org.kvarela.pvp_example.Person | 0   |                    |        -27
       (1 row)
      
       jbpmdb=# select * from person;
        id  | age | name  
       -----++------------
        -27 |  25 | teste
       (1 row)
        
      

      2. to complete the task we used the following payload if I don't want a duplicate record from person table and you will see that that person is not duplicated, but the map_var_id field updates with null in mappedvariable table.

      {
          "person":{
             "org.kvarela.pvp_example.Person": {
                   "id": -27,
                   "name": "teste",
                   "age": 25             
             } 
           }
      }
       jbpmdb=# select * from person;
      
        id  | age | name  
       -----++------------
        -27 |  25 | teste
      
       (1 row)
      
      jbpmdb=# select * from mappedvariable;
      
        mappedvarid | processinstanceid | taskid | variableid|          variabletype                 | optlock | workitemid | map_var_id 
       -----------------++-----------------------------++--------------------------------------------------------++------------------------------------------------------------------------------
                -38         |                    60           |            |        -27    | org.kvarela.pvp_example.Person | 0   |                    |        
       (1 row)
        
      Show
          I made some modifications in the pom.xml file from the attached project using <version>7.33.0.Final</version> in its dependencies instead of <version>7.14.0.Final</version>, also I added the drool-persistence-jpa such as: <dependency>      <groupId>org.drools</groupId>       <artifactId>drools-persistence-jpa</artifactId>       <version>7.33.0.Final</version>      <scope>provided</scope>  </dependency>   Also I modified Person class to extend org.drools.persistence.jpa.marshaller.VariableEntity to have the persistence in the mappedvariable table.   1. We used the same payload to start the process instance:   {     "Person": {         "org.kvarela.pvp_example.Person": {         "age": 25,         "name": "teste"     }     } }   jbpmdb=# select * from mappedvariable;  mappedvarid | processinstanceid | taskid | variableid|          variabletype                 | optlock | workitemid | map_var_id -----------------++-----------------------------++--------------------------------------------------------++------------------------------------------------------------------------------          -38         |                    60           |            |        -27    | org.kvarela.pvp_example.Person | 0   |                    |        -27 (1 row) jbpmdb=# select * from person;  id  | age | name   -----++------------  -27 |  25 | teste (1 row)   2. to complete the task we used the following payload if I don't want a duplicate record from person table and you will see that that person is not duplicated, but the map_var_id field updates with null in mappedvariable table. {    "person":{       "org.kvarela.pvp_example.Person": {             "id": -27,             "name": "teste",             "age": 25             }     } } jbpmdb=# select * from person;  id  | age | name   -----++------------  -27 |  25 | teste (1 row) jbpmdb=# select * from mappedvariable;  mappedvarid | processinstanceid | taskid | variableid|          variabletype                 | optlock | workitemid | map_var_id -----------------++-----------------------------++--------------------------------------------------------++------------------------------------------------------------------------------          -38         |                    60           |            |        -27    | org.kvarela.pvp_example.Person | 0   |                    |        (1 row)  
    • ---
    • ---
    • 2020 Week 46-48 (from Nov 9)

    Description

      Customer worked with a sample project from Karina Varela related "persisting-custom-process-variables-in-different-db-on-jbpm". They tried to use the request to complete a task without Id field and the map_var_id column doesn't set to null, but it created a second record in the Person table instead of updating the existing one.

      In another way, it happens if they use the complete request with Id field but map_var_id field from the mappedvariable table is set to null without creating a second record from the table person

       

       

      Attachments

        Issue Links

          Activity

            People

              elguardian@gmail.com Enrique González Martínez (Inactive)
              rhn-support-luzrodri Luz Rodriguez
              Tomas David Tomas David
              Tomas David Tomas David
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: