Purpose (problem description)

This page provides assistance with problems that might happen when packages are not being included in the user defined module content. This is when an explicit content query needs to be used.

The following documentation pages provide further information in this area:

User defined modules - CMS - User Defined Module editor

Explicit Content information - CMS - Information about Object Filters/Explicit Content in a User Defined Module 

Observed in CAST Version


Release

Yes/No

8.3(tick)
Observed in RDBMS

RDBMS

Yes/No

CSS (tick)
Step by Step scenario
  1. Create User defined module using explicit content
  2. Packages are not included
Action Plan

Perform the below actions

  1. Use the following explicit content query to add packages in a specific path to your module in addition to other objects already defined for that module in the object filters ( you need to modify the below with your specific source code path):
    INSERT
    INTO   §CI_OBJECTS_SET
           (
                  SET_NAME ,
                  OBJECT_ID,
                  ERROR_ID
           )
    SELECT DISTINCT '$(ModuleName)',
                    p.IdKey        ,
                    0
    FROM            §Keys p
                    JOIN §KeyPar kp
                    ON              p.IdKey  = kp.IdParent
                    AND             p.ObjTyp = 99
                    /*Java Package*/
                    JOIN §Keys k
                    ON              kp.IdKey = k.IdKey
                    JOIN §ObjFilRef r
                    ON              k.IdKey = r.IdObj
                    JOIN §RefPath rp
                    ON              r.IdFilRef = rp.IdFilRef
    WHERE           rp.Path                 LIKE ('%YOUR PATH%')/
    1. The following query run on the local database can be used to verify the specific paths for each package to verify the module content results:

      SELECT p.IdKey AS "JAVA PACKAGE ID" ,
      p.keyNam AS "JAVA PACKAGE NAME" ,
      p.ObjTyp AS "TYPE" ,
      'package' AS "TYPE NAME" ,
      FullName AS "PACKAGE FULL NAME" ,
      k.IdKey AS "PARENT ID" ,
      k.Keynam AS "PARENT NAME" ,
      k.ObjTyp AS "PARENT TYPE ID" ,
      TypDsc AS "PARENT TYPE NAME" ,
      rp.Path AS "PATH OF THE PARENT OBJECT"
      FROM Keys p
      JOIN KeyPar kp
      ON p.IdKey = kp.IdParent
      AND p.ObjTyp = 99
      /*Java Package*/
      JOIN ObjFulNam of1
      ON p.IdKey = of1.IdObj
      JOIN Keys k
      ON kp.IdKey = k.IdKey
      JOIN ObjFilRef r
      ON k.IdKey = r.IdObj
      JOIN RefPath rp
      ON r.IdFilRef = rp.IdFilRef
      JOIN Typ
      ON IdTyp = k.ObjTyp
      
    2. If you want to have a module with just packages, then you could do a delete followed by the insert in your explicit query:
      DELETE
      FROM   §CI_OBJECTS_SET
      WHERE  SET_NAME = '$(ModuleName)' /
      INSERT
      INTO   §CI_OBJECTS_SET
             (
                    SET_NAME ,
                    OBJECT_ID,
                    ERROR_ID
             )
      SELECT DISTINCT '$(ModuleName)',
                      p.IdKey        ,
                      0
      FROM            §Keys p
                      JOIN §KeyPar kp
                      ON              p.IdKey  = kp.IdParent
                      AND             p.ObjTyp = 99
                      /*Java Package*/
                      JOIN §Keys k
                      ON              kp.IdKey = k.IdKey
                      JOIN §ObjFilRef r
                      ON              k.IdKey = r.IdObj
                      JOIN §RefPath rp
                      ON              r.IdFilRef = rp.IdFilRef
      WHERE           rp.Path                 LIKE ('%YOUR PATH%')/
  2. For a Generic query to add packages to .NET or Java analysis, please see below (this query needs either a substitution for object_fullname or another filter criteria):

    DELETE
    FROM   §CI_OBJECTS_SET
    WHERE  SET_NAME = '$(ModuleName)' ;
    
    INSERT
    INTO   §CI_OBJECTS_SET
           (
                  SET_NAME ,
                  OBJECT_ID,
                  ERROR_ID
           )
           WITH recursive ParentPackages AS
           ( SELECT DISTINCT co.PARENT_ID
                            FROM             §CSV_OBJECTS co
                            WHERE            co.PARENT_TYPE IN ('Java Package',
                                                                '.NET Namespace')
                            AND              lower(co.OBJECT_FULLNAME) LIKE '%xxx%' -- adapt filter criteria here
                            
                            UNION
                            
                            SELECT DISTINCT co.PARENT_ID
                            FROM            ParentPackages pp
                                            JOIN §CSV_OBJECTS co
                                            ON              co.OBJECT_ID = pp.PARENT_ID
                                            AND             co.OBJECT_TYPE IN ('Java Package',
                                                                               '.NET Namespace')
                                            AND             co.PARENT_TYPE IN ('Java Package',
                                                                               '.NET Namespace')
           )
    SELECT '$(ModuleName)',
           PARENT_ID      ,
           0
    FROM   ParentPackages ;
  3. If the above steps do not solve your issue contact CAST Technical Support with the following Relevant input in order to help Support to reproduce the issue.

 

Notes/comments

Ticket # 19516, 30931

Related Pages