Support

Expand all | Collapse all

Discrepancy of handling of velocity objects of type "document"

  • 1.  Discrepancy of handling of velocity objects of type "document"

    Posted 11-12-2019 01:49
    Hi,

    we have found a major discrepancy about how the old and new velocity engine handle objects of type "document".
    Please see the following code snippet:
    #set( $docList = [] )

    #foreach( $vDoc in $documentList )
    #set( $listAddSuccess = $docList.add($vDoc.document))
    Document added: $vDoc.document<br>

    #if( $docList.contains( $vDoc.document ))
    Document found in list<br>
    #else
    Document NOT found in list<br>
    #end
    #end

    In the old velocity engine the script works as expected: After adding a document of the selected documentList to a list and checking if it is contained in the list, is is found by velocity.
    In the new velocity engine the contains() function does not return that the object is present in the list.

    If changing the code to not add $vDoc.document, but $vDoc instead, the result is as expected:

    #set( $vDocList = [] )

    #foreach( $vDoc in $documentList )
    #set( $listAddSuccess = $vDocList.add($vDoc))
    Document added: $vDoc<br>

    #if( $vDocList.contains( $vDoc ))
    vDoc found in list<br>
    #else
    vDoc NOT found in list<br>
    #end
    #end

    With the current knowledge about this we consider this as a showstopper for switching to the new velocity engine as provided in 8.42.1. There is a workaround available, but finding all reports that are affected by this and fixing them accordingly is very tricky, because the affected code is not easly detactable.

    Please let us know if this is a reproducible behaviour and what the plans are to address this.

    Thank you,
    Anna

    ------------------------------
    Anna Henke
    MeVis BreastCare GmbH & Co. KG
    ------------------------------


  • 2.  RE: Discrepancy of handling of velocity objects of type "document"

    Posted 11-12-2019 15:43
    Hi Anna,

    I'm looking into this issue to see if I can replicate it. Can you tell me what type the variable $vDoc is? Also, it would be helpful to know how the list $documentList is populated.

    Thanks!

    Ken

    ------------------------------
    Ken Richards
    Jama Software
    ------------------------------



  • 3.  RE: Discrepancy of handling of velocity objects of type "document"

    Posted 11-14-2019 07:10
    Hi Ken,
    I have created a support request for this as well, as Chloe suggested to do so.
    As I am not sure where we handle this, I am putting answers in both places.
    The report is run on any node in the explorer tree, so $documentList contains should contain the documents under the selected node.
    $vDoc.getClass() returns "class com.jamasoftware.contour.report.velocity.proxy.VelocityReportDocumentDTOProxy" for new velocity.
    For old velocity the same statement returns " class com.jamasoftware.contour.api.plugin.VelocityReportDTO", which is expectable I guess.

    Further testing gives these results - I don't know enough about the internals of velocity to fully understand what is going on though:
    Regards
    Anna

    ------------------------------
    Anna Henke
    MeVis BreastCare GmbH & Co. KG
    ------------------------------



  • 4.  RE: Discrepancy of handling of velocity objects of type "document"

    Posted 11-14-2019 08:59
    Hi Anna,

    Thank you for the additional information. I was able to find the problem and fix it. The fix will be included in the 8.44 release.

    Ken


    ------------------------------
    Ken Richards
    Senior Engineering Team Lead
    Jama Software
    ------------------------------



  • 5.  RE: Discrepancy of handling of velocity objects of type "document"

    Posted 11-14-2019 09:09
    Hi Ken,

    this is good news. Will 8.44 also be rolled out for on-premise? Or can on-premise customers expect a patch die 8.42?

    Thank you,
    Anna

    ------------------------------
    Anna Henke
    MeVis BreastCare GmbH & Co. KG
    ------------------------------



  • 6.  RE: Discrepancy of handling of velocity objects of type "document"

    Posted 11-14-2019 23:39
    Oh - and can you provide with an issue ID, so that we can reference it here?

    Thank you

    ------------------------------
    Anna Henke
    MeVis BreastCare GmbH & Co. KG
    ------------------------------



  • 7.  RE: Discrepancy of handling of velocity objects of type "document"

    Posted 11-15-2019 09:07
    Anna:

    The defect key for your reference is: SOS-DEF-4511

    Best,


    ------------------------------
    Chloe Elliott
    Jama Software
    Portland OR
    ------------------------------