How to activate Relationships information for Velocity reports?

Victor Cheung
Victor Cheung Member, Data Exchange Posts: 95

In this Youtube video showing Velocity Overview help information, it says that relationships are only available when the "parameter is configured".  What does this mean and how to configure this?

image
I have tried looping each document item's relationships (which I know have relationships) but the result is nothing, the report never shows any relationships.  The $vDoc.relationships.size() is always evaluated to 0 (zero) - the collection is empty:

#foreach( $vDoc in $documentList ) 
     #if( $vDoc.relationships && $vDoc.relationships.size() > 0  ) 
            <br/>
            <b>Relationships</b>
                <table class="grid" cellpadding="0" cellspacing="0" border="0" width="100%">
                    <thead>
                        <tr>
                            <td bgcolor="f0f0f0">Item ID</td>
                            <td bgcolor="f0f0f0">Name</td>
                            <td bgcolor="f0f0f0">Direction</td>
                            <td bgcolor="f0f0f0">Project</td>
                            <td bgcolor="f0f0f0">Item Type</td>
                            <td bgcolor="f0f0f0">Relationship</td>
                        </tr>
                    </thead>
                    <tbody>
                    #foreach ( $trace in $vDoc.relationships )
                    <tr>
                        <td>
                            ${trace.documentKey}
                        </td> 
                        <td>
                            ${trace.documentName}
                        </td> 
                        <td>
                            #if( $trace.forward ) Downstream #else Upstream #end
                        </td> 
                        <td>
                            $trace.projectName
                        </td> 
                        <td>
                            $trace.documentType
                        </td> 
                        <td>
                            #if($trace.relationshipType)
                            $trace.relationshipType.name
                            #end
                        </td> 
                    </tr>
                    #end
                    </tbody>
                </table>
                <br>
            #end
#end

------------------------------
victor
------------------------------
victor

Comments

  • Patrick Szabo
    Patrick Szabo Member, Medical Devices & Life Sciences Solution Posts: 55
    edited May 2023

    Hi Victor, 
    I assume you have loaded the data sources first, right? 

    #if( $documentSource )
      ## Jama 8.44 or greater
    	#set( $docDao = $documentSource)
    	#set( $relDao = $documentSource)
    #else
      ## Jama 8.36 or older
    	#set( $docDao = $applicationContext.getBean("documentDao"))
    	#set( $relDao = $applicationContext.getBean("relationshipDao"))
     #end

    Then you should be able to get the relationships with the following commands:

    #foreach( $vDoc in $documentList )
        #set ( $uprels = $relDao.getRelationshipsForDocument($vDoc.id, false) )
        #set ( $downrels = $relDao.getRelationshipsForDocument($vDoc.id, true) )
        #if ( $uprels.size() > 0 && $downrels.size() > 0 )
           enter your code here
        #end
    #end
    

    I recommend to have a look at the example reports on Github here:
    GitHub - jamasoftware-ps/Community-Reports

    ------------------------------
    Patrick
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 05-11-2023 16:22
    From: Victor Cheung
    Subject: How to activate Relationships information for Velocity reports?

    In this Youtube video showing Velocity Overview help information, it says that relationships are only available when the "parameter is configured".  What does this mean and how to configure this?

    image
    I have tried looping each document item's relationships (which I know have relationships) but the result is nothing, the report never shows any relationships.  The $vDoc.relationships.size() is always evaluated to 0 (zero) - the collection is empty:

    #foreach( $vDoc in $documentList )      #if( $vDoc.relationships && $vDoc.relationships.size() > 0  )             <br/>            <b>Relationships</b>                <table class="grid" cellpadding="0" cellspacing="0" border="0" width="100%">                    <thead>                        <tr>                            <td bgcolor="f0f0f0">Item ID</td>                            <td bgcolor="f0f0f0">Name</td>                            <td bgcolor="f0f0f0">Direction</td>                            <td bgcolor="f0f0f0">Project</td>                            <td bgcolor="f0f0f0">Item Type</td>                            <td bgcolor="f0f0f0">Relationship</td>                        </tr>                    </thead>                    <tbody>                    #foreach ( $trace in $vDoc.relationships )                    <tr>                        <td>                            ${trace.documentKey}                        </td>                         <td>                            ${trace.documentName}                        </td>                         <td>                            #if( $trace.forward ) Downstream #else Upstream #end                        </td>                         <td>                            $trace.projectName                        </td>                         <td>                            $trace.documentType                        </td>                         <td>                            #if($trace.relationshipType)                            $trace.relationshipType.name                            #end                        </td>                     </tr>                    #end                    </tbody>                </table>                <br>            #end#end

    ------------------------------
    victor
    ------------------------------
    Patrick
  • Victor Cheung
    Victor Cheung Member, Data Exchange Posts: 95
    edited May 2023

    Hi Patrick,

    Many thanks, and appreciate your help!  I believe your approach of using the DocumentSource class should work for me as well.  However, because the $documentList is a collection of VelocityReportDocumentDTO objects, and this class has a convenient getRelationships() method I am seeking to find out how to use this method.  If this method is deprecated it should be documented as such, but according to the API it is still valid and returns a collection of DocumentTraceDTO objects (which is different than the collection of DocumentDocument objects that are returned by the DocumentSource methods).

    I want to know what I am doing incorrectly, or why the VelocityReportDocumentDTO.getRelationships() method is not working for me.  The youtube video tutorial by Jama shows documentation which states that relationships are only available when the "parameter is configured".  However, it is not documented what exact parameter needs to be configured to enable the relationships. 

    This appears to be a "lack of proper documentation" issue.

    ------------------------------
    victor
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 05-12-2023 00:03
    From: Patrick Szabo
    Subject: How to activate Relationships information for Velocity reports?

    Hi Victor, 
    I assume you have loaded the data sources first, right? 

    #if( $documentSource )  ## Jama 8.44 or greater	#set( $docDao = $documentSource)	#set( $relDao = $documentSource)#else  ## Jama 8.36 or older	#set( $docDao = $applicationContext.getBean("documentDao"))	#set( $relDao = $applicationContext.getBean("relationshipDao")) #end

    Then you should be able to get the relationships with the following commands:

    #foreach( $vDoc in $documentList )    #set ( $uprels = $relDao.getRelationshipsForDocument($vDoc.id, false) )    #set ( $downrels = $relDao.getRelationshipsForDocument($vDoc.id, true) )    #if ( $uprels.size() > 0 && $downrels.size() > 0 )       enter your code here    #end#end

    I recommend to have a look at the example reports on Github here:
    GitHub - jamasoftware-ps/Community-Reports

    ------------------------------
    Patrick
    ------------------------------

    Original Message:
    Sent: 05-11-2023 16:22
    From: Victor Cheung
    Subject: How to activate Relationships information for Velocity reports?

    In this Youtube video showing Velocity Overview help information, it says that relationships are only available when the "parameter is configured".  What does this mean and how to configure this?

    image
    I have tried looping each document item's relationships (which I know have relationships) but the result is nothing, the report never shows any relationships.  The $vDoc.relationships.size() is always evaluated to 0 (zero) - the collection is empty:

    #foreach( $vDoc in $documentList )      #if( $vDoc.relationships && $vDoc.relationships.size() > 0  )             <br/>            <b>Relationships</b>                <table class="grid" cellpadding="0" cellspacing="0" border="0" width="100%">                    <thead>                        <tr>                            <td bgcolor="f0f0f0">Item ID</td>                            <td bgcolor="f0f0f0">Name</td>                            <td bgcolor="f0f0f0">Direction</td>                            <td bgcolor="f0f0f0">Project</td>                            <td bgcolor="f0f0f0">Item Type</td>                            <td bgcolor="f0f0f0">Relationship</td>                        </tr>                    </thead>                    <tbody>                    #foreach ( $trace in $vDoc.relationships )                    <tr>                        <td>                            ${trace.documentKey}                        </td>                         <td>                            ${trace.documentName}                        </td>                         <td>                            #if( $trace.forward ) Downstream #else Upstream #end                        </td>                         <td>                            $trace.projectName                        </td>                         <td>                            $trace.documentType                        </td>                         <td>                            #if($trace.relationshipType)                            $trace.relationshipType.name                            #end                        </td>                     </tr>                    #end                    </tbody>                </table>                <br>            #end#end

    ------------------------------
    victor
    ------------------------------
    victor
  • [Deleted User]
    [Deleted User] Posts: 152
    edited May 2023

    Hi Victor, 

    Thanks for posting this! It looks like you're digging into this with our Support team now, and that'd be the best team to work with on issues such as this.

    ------------------------------
    Carly Rossi // she/her/hers
    Community Program Manager // Jama Software
    Portland, OR
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 05-12-2023 06:00
    From: Victor Cheung
    Subject: How to activate Relationships information for Velocity reports?

    Hi Patrick,

    Many thanks, and appreciate your help!  I believe your approach of using the DocumentSource class should work for me as well.  However, because the $documentList is a collection of VelocityReportDocumentDTO objects, and this class has a convenient getRelationships() method I am seeking to find out how to use this method.  If this method is deprecated it should be documented as such, but according to the API it is still valid and returns a collection of DocumentTraceDTO objects (which is different than the collection of DocumentDocument objects that are returned by the DocumentSource methods).

    I want to know what I am doing incorrectly, or why the VelocityReportDocumentDTO.getRelationships() method is not working for me.  The youtube video tutorial by Jama shows documentation which states that relationships are only available when the "parameter is configured".  However, it is not documented what exact parameter needs to be configured to enable the relationships. 

    This appears to be a "lack of proper documentation" issue.

    ------------------------------
    victor
    ------------------------------

    Original Message:
    Sent: 05-12-2023 00:03
    From: Patrick Szabo
    Subject: How to activate Relationships information for Velocity reports?

    Hi Victor, 
    I assume you have loaded the data sources first, right? 

    #if( $documentSource )  ## Jama 8.44 or greater	#set( $docDao = $documentSource)	#set( $relDao = $documentSource)#else  ## Jama 8.36 or older	#set( $docDao = $applicationContext.getBean("documentDao"))	#set( $relDao = $applicationContext.getBean("relationshipDao")) #end

    Then you should be able to get the relationships with the following commands:

    #foreach( $vDoc in $documentList )    #set ( $uprels = $relDao.getRelationshipsForDocument($vDoc.id, false) )    #set ( $downrels = $relDao.getRelationshipsForDocument($vDoc.id, true) )    #if ( $uprels.size() > 0 && $downrels.size() > 0 )       enter your code here    #end#end

    I recommend to have a look at the example reports on Github here:
    GitHub - jamasoftware-ps/Community-Reports

    ------------------------------
    Patrick

    Original Message:
    Sent: 05-11-2023 16:22
    From: Victor Cheung
    Subject: How to activate Relationships information for Velocity reports?

    In this Youtube video showing Velocity Overview help information, it says that relationships are only available when the "parameter is configured".  What does this mean and how to configure this?

    image
    I have tried looping each document item's relationships (which I know have relationships) but the result is nothing, the report never shows any relationships.  The $vDoc.relationships.size() is always evaluated to 0 (zero) - the collection is empty:

    #foreach( $vDoc in $documentList )      #if( $vDoc.relationships && $vDoc.relationships.size() > 0  )             <br/>            <b>Relationships</b>                <table class="grid" cellpadding="0" cellspacing="0" border="0" width="100%">                    <thead>                        <tr>                            <td bgcolor="f0f0f0">Item ID</td>                            <td bgcolor="f0f0f0">Name</td>                            <td bgcolor="f0f0f0">Direction</td>                            <td bgcolor="f0f0f0">Project</td>                            <td bgcolor="f0f0f0">Item Type</td>                            <td bgcolor="f0f0f0">Relationship</td>                        </tr>                    </thead>                    <tbody>                    #foreach ( $trace in $vDoc.relationships )                    <tr>                        <td>                            ${trace.documentKey}                        </td>                         <td>                            ${trace.documentName}                        </td>                         <td>                            #if( $trace.forward ) Downstream #else Upstream #end                        </td>                         <td>                            $trace.projectName                        </td>                         <td>                            $trace.documentType                        </td>                         <td>                            #if($trace.relationshipType)                            $trace.relationshipType.name                            #end                        </td>                     </tr>                    #end                    </tbody>                </table>                <br>            #end#end

    ------------------------------
    victor
    ------------------------------
  • Victor Cheung
    Victor Cheung Member, Data Exchange Posts: 95
    edited May 2023

    Hi Carly,

    Jama Support (Luis) was very helpful and pointed out that those reports are only manageable/editable when logged in as root user.  This was a revelation to me since I usually log in as org admin, but seldom as root.

    When I looked at the settings for the All Item Details velocity report (which was what I based my own report on), I saw the magical parameter that the youtube tutorial documentation alluded to in order to activate the relationships data for the VelocityReportDocumentDTO objects from the $documentList variable.  As soon as I configured the same parameter name (report_relate) for my report everything just worked and the exported report suddenly displayed all the relationships I was expecting to see from the items.

    image
    Perhaps this kind of hidden behavior that relies on specific parameters should be documented explicitly within the code itself (allFieldsReport.vm).  I saw other reports with wonderful comments by Shawnna Williams which is extremely helpful especially since it seems much of the helpful legacy Velocity documentation is no longer available.

    ------------------------------
    victor
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 05-15-2023 12:42
    From: Carly Rossi
    Subject: How to activate Relationships information for Velocity reports?

    Hi Victor, 

    Thanks for posting this! It looks like you're digging into this with our Support team now, and that'd be the best team to work with on issues such as this.

    ------------------------------
    Carly Rossi // she/her/hers
    Community Program Manager // Jama Software
    Portland, OR
    ------------------------------

    Original Message:
    Sent: 05-12-2023 06:00
    From: Victor Cheung
    Subject: How to activate Relationships information for Velocity reports?

    Hi Patrick,

    Many thanks, and appreciate your help!  I believe your approach of using the DocumentSource class should work for me as well.  However, because the $documentList is a collection of VelocityReportDocumentDTO objects, and this class has a convenient getRelationships() method I am seeking to find out how to use this method.  If this method is deprecated it should be documented as such, but according to the API it is still valid and returns a collection of DocumentTraceDTO objects (which is different than the collection of DocumentDocument objects that are returned by the DocumentSource methods).

    I want to know what I am doing incorrectly, or why the VelocityReportDocumentDTO.getRelationships() method is not working for me.  The youtube video tutorial by Jama shows documentation which states that relationships are only available when the "parameter is configured".  However, it is not documented what exact parameter needs to be configured to enable the relationships. 

    This appears to be a "lack of proper documentation" issue.

    ------------------------------
    victor

    Original Message:
    Sent: 05-12-2023 00:03
    From: Patrick Szabo
    Subject: How to activate Relationships information for Velocity reports?

    Hi Victor, 
    I assume you have loaded the data sources first, right? 

    #if( $documentSource )  ## Jama 8.44 or greater	#set( $docDao = $documentSource)	#set( $relDao = $documentSource)#else  ## Jama 8.36 or older	#set( $docDao = $applicationContext.getBean("documentDao"))	#set( $relDao = $applicationContext.getBean("relationshipDao")) #end

    Then you should be able to get the relationships with the following commands:

    #foreach( $vDoc in $documentList )    #set ( $uprels = $relDao.getRelationshipsForDocument($vDoc.id, false) )    #set ( $downrels = $relDao.getRelationshipsForDocument($vDoc.id, true) )    #if ( $uprels.size() > 0 && $downrels.size() > 0 )       enter your code here    #end#end

    I recommend to have a look at the example reports on Github here:
    GitHub - jamasoftware-ps/Community-Reports

    ------------------------------
    Patrick

    Original Message:
    Sent: 05-11-2023 16:22
    From: Victor Cheung
    Subject: How to activate Relationships information for Velocity reports?

    In this Youtube video showing Velocity Overview help information, it says that relationships are only available when the "parameter is configured".  What does this mean and how to configure this?

    image
    I have tried looping each document item's relationships (which I know have relationships) but the result is nothing, the report never shows any relationships.  The $vDoc.relationships.size() is always evaluated to 0 (zero) - the collection is empty:

    #foreach( $vDoc in $documentList )      #if( $vDoc.relationships && $vDoc.relationships.size() > 0  )             <br/>            <b>Relationships</b>                <table class="grid" cellpadding="0" cellspacing="0" border="0" width="100%">                    <thead>                        <tr>                            <td bgcolor="f0f0f0">Item ID</td>                            <td bgcolor="f0f0f0">Name</td>                            <td bgcolor="f0f0f0">Direction</td>                            <td bgcolor="f0f0f0">Project</td>                            <td bgcolor="f0f0f0">Item Type</td>                            <td bgcolor="f0f0f0">Relationship</td>                        </tr>                    </thead>                    <tbody>                    #foreach ( $trace in $vDoc.relationships )                    <tr>                        <td>                            ${trace.documentKey}                        </td>                         <td>                            ${trace.documentName}                        </td>                         <td>                            #if( $trace.forward ) Downstream #else Upstream #end                        </td>                         <td>                            $trace.projectName                        </td>                         <td>                            $trace.documentType                        </td>                         <td>                            #if($trace.relationshipType)                            $trace.relationshipType.name                            #end                        </td>                     </tr>                    #end                    </tbody>                </table>                <br>            #end#end

    ------------------------------
    victor
    ------------------------------
    victor
  • [Deleted User]
    [Deleted User] Posts: 152
    edited May 2023

    Hi Victor, 

    Thanks for following up! I'm glad working with Support (and Luis) was meaningful; they're a wonderful team. We're working on refining our documentation strategy, and a part of that is retiring content that's no longer applicable or relevant. If you haven't taken it already, I'd recommend looking into taking the Custom Export Training Using Velocity -- it's very helpful and would provide you with the resources (such as documentation, tools, instruction, and sample snippets) needed when it comes to creating custom reports with Velocity.

    ------------------------------
    Carly Rossi // she/her/hers
    Community Program Manager // Jama Software
    Portland, OR
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 05-16-2023 05:51
    From: Victor Cheung
    Subject: How to activate Relationships information for Velocity reports?

    Hi Carly,

    Jama Support (Luis) was very helpful and pointed out that those reports are only manageable/editable when logged in as root user.  This was a revelation to me since I usually log in as org admin, but seldom as root.

    When I looked at the settings for the All Item Details velocity report (which was what I based my own report on), I saw the magical parameter that the youtube tutorial documentation alluded to in order to activate the relationships data for the VelocityReportDocumentDTO objects from the $documentList variable.  As soon as I configured the same parameter name (report_relate) for my report everything just worked and the exported report suddenly displayed all the relationships I was expecting to see from the items.

    image
    Perhaps this kind of hidden behavior that relies on specific parameters should be documented explicitly within the code itself (allFieldsReport.vm).  I saw other reports with wonderful comments by Shawnna Williams which is extremely helpful especially since it seems much of the helpful legacy Velocity documentation is no longer available.

    ------------------------------
    victor
    ------------------------------

    Original Message:
    Sent: 05-15-2023 12:42
    From: Carly Rossi
    Subject: How to activate Relationships information for Velocity reports?

    Hi Victor, 

    Thanks for posting this! It looks like you're digging into this with our Support team now, and that'd be the best team to work with on issues such as this.

    ------------------------------
    Carly Rossi // she/her/hers
    Community Program Manager // Jama Software
    Portland, OR

    Original Message:
    Sent: 05-12-2023 06:00
    From: Victor Cheung
    Subject: How to activate Relationships information for Velocity reports?

    Hi Patrick,

    Many thanks, and appreciate your help!  I believe your approach of using the DocumentSource class should work for me as well.  However, because the $documentList is a collection of VelocityReportDocumentDTO objects, and this class has a convenient getRelationships() method I am seeking to find out how to use this method.  If this method is deprecated it should be documented as such, but according to the API it is still valid and returns a collection of DocumentTraceDTO objects (which is different than the collection of DocumentDocument objects that are returned by the DocumentSource methods).

    I want to know what I am doing incorrectly, or why the VelocityReportDocumentDTO.getRelationships() method is not working for me.  The youtube video tutorial by Jama shows documentation which states that relationships are only available when the "parameter is configured".  However, it is not documented what exact parameter needs to be configured to enable the relationships. 

    This appears to be a "lack of proper documentation" issue.

    ------------------------------
    victor

    Original Message:
    Sent: 05-12-2023 00:03
    From: Patrick Szabo
    Subject: How to activate Relationships information for Velocity reports?

    Hi Victor, 
    I assume you have loaded the data sources first, right? 

    #if( $documentSource )  ## Jama 8.44 or greater	#set( $docDao = $documentSource)	#set( $relDao = $documentSource)#else  ## Jama 8.36 or older	#set( $docDao = $applicationContext.getBean("documentDao"))	#set( $relDao = $applicationContext.getBean("relationshipDao")) #end

    Then you should be able to get the relationships with the following commands:

    #foreach( $vDoc in $documentList )    #set ( $uprels = $relDao.getRelationshipsForDocument($vDoc.id, false) )    #set ( $downrels = $relDao.getRelationshipsForDocument($vDoc.id, true) )    #if ( $uprels.size() > 0 && $downrels.size() > 0 )       enter your code here    #end#end

    I recommend to have a look at the example reports on Github here:
    GitHub - jamasoftware-ps/Community-Reports

    ------------------------------
    Patrick

    Original Message:
    Sent: 05-11-2023 16:22
    From: Victor Cheung
    Subject: How to activate Relationships information for Velocity reports?

    In this Youtube video showing Velocity Overview help information, it says that relationships are only available when the "parameter is configured".  What does this mean and how to configure this?

    image
    I have tried looping each document item's relationships (which I know have relationships) but the result is nothing, the report never shows any relationships.  The $vDoc.relationships.size() is always evaluated to 0 (zero) - the collection is empty:

    #foreach( $vDoc in $documentList )      #if( $vDoc.relationships && $vDoc.relationships.size() > 0  )             <br/>            <b>Relationships</b>                <table class="grid" cellpadding="0" cellspacing="0" border="0" width="100%">                    <thead>                        <tr>                            <td bgcolor="f0f0f0">Item ID</td>                            <td bgcolor="f0f0f0">Name</td>                            <td bgcolor="f0f0f0">Direction</td>                            <td bgcolor="f0f0f0">Project</td>                            <td bgcolor="f0f0f0">Item Type</td>                            <td bgcolor="f0f0f0">Relationship</td>                        </tr>                    </thead>                    <tbody>                    #foreach ( $trace in $vDoc.relationships )                    <tr>                        <td>                            ${trace.documentKey}                        </td>                         <td>                            ${trace.documentName}                        </td>                         <td>                            #if( $trace.forward ) Downstream #else Upstream #end                        </td>                         <td>                            $trace.projectName                        </td>                         <td>                            $trace.documentType                        </td>                         <td>                            #if($trace.relationshipType)                            $trace.relationshipType.name                            #end                        </td>                     </tr>                    #end                    </tbody>                </table>                <br>            #end#end

    ------------------------------
    victor
    ------------------------------