Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9454

Enable multiple mapped variables

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Minor
    • None
    • 7.45.0.Final
    • Persistence, Runtime Engine
    • None

    Description

      Context:

      Configuring JPA persistence for process variables

      http://mswiderski.blogspot.com/2014/02/jbpm-6-store-your-process-variables.html

      https://karinavarela.me/2018/12/22/persisting-custom-process-variables-in-different-db-on-jbpm/

      Implementation example:

      https://github.com/jbossdemocentral/rhpam7-order-management-demo-repo

      Issue:

      If you try to bind more than one process variable to a process or if you deploy two projects requiring a JPA persistence you get at runtime a foreign constraint violation error. E.g.

       

      Caused by: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "FK97CT3G3OQBWV7W3FQR12KHWA4: PUBLIC.MAPPEDVARIABLE FOREIGN KEY(MAP_VAR_ID) REFERENCES PUBLIC.TRAVEL(ID) (1)"; SQL statement:
      update MappedVariable set MAP_VAR_ID=? where mappedVarId=? [23506-193]

       

      Reason:

      The JPA implementation of org.drools.persistence.jpa.marshaller.VariableEntity create a foreign constraints on the table MAPPEDVARIABLE due the one to many relationship 
      mappedVariables.
      Solution:

      Add an annotation to avoid the foreign key constraint:

      @JoinColumn(name = "MAP_VAR_ID", nullable = true, foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))

       

      Attachments

        Activity

          People

            elguardian@gmail.com Enrique González Martínez (Inactive)
            dmarrazz@redhat.com Donato Marrazzo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: