Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2608

Variable Persistence Overwrites NULL Values over Persisted Values

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Hide

      run the "PassingListAlongUnitTest" attached

      Show
      run the "PassingListAlongUnitTest" attached

    Description

      Drools Flow
      =========

      For non-String variables (Serializ..ble, Entities, etc..), Drools overwrites NULLs when a (JPA) process is resumed ( a workitem is completed ).

      1. Here is a use case: a List ( ArrayList ) is passed to the process in start as a parameter
      2. First work item sees ( maps in ) the List, and can work with it inside the work item handler
      3. First work item does not complete: process goes to sleep.
      4. When the session is reloaded, the first work item is completed
      5. All the persisted variables ( including the "list" ) are restored
      6. Second work item is taking in the list ( it maps in )
      7. However at this point it is NULL

      It seems that when the context is closed, after resolving variables, the following (WorkItemNodeInstance):

      VariableScopeInstance variableScopeInstance = ( VariableScopeInstance )
      resolveContextInstance( VariableScope.VARIABLE_SCOPE, mapping.getValue() );

      does no longer have the restored variables, and rather NULLs, since internally variables are compared with a "result map" that was passed to the previous work item.

      This means that persisted variables are restored internally, but then overwritten internally by NULLs.

      /Anatoly

      Attachments

        Activity

          People

            salaboy@gmail.com Mauricio Salatino (Inactive)
            Anat0ly Anatoly Polinsky (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified

                PagerDuty