CMS Snapshot Analysis - Generate Modules

Purpose (problem description)

This page provides approach to troubleshoot the problems related to Generate Modules feature under CMS Snapshot Analysis.

Modules are used to configure analysis results into meaningful groups or sets for display purposes.Objects cannot be seen in the CAST Dashboard if they are not part of a Module.

Observed in CAST AIP

ReleaseYes/No
8.3.x
8.2.x
8.1.x
8.0.x
7.3.x
7.2.x
7.0.x

Observed on RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS3
CSS2
CSS1

Action Plan

  1. If the number of objects in modules is not as expected:
    1. Run the following queries to check the number of objects in Modules :

      1. The below query is based on the result of Analysis :

SELECT km.idkey AS “Module ID”, km.keynam AS “Module Name”, kp.idkey AS “Project ID”, kp.keynam AS “Project name”, tm.typnam AS “Type of Project”, tob.idtyp AS “Type ID of objects”, tob.typdsc AS “Type of Objects”, Count(DISTINCT k1.idkey) AS “Number Of Objects” FROM .setroot sr JOIN .keys km ON km.idkey = sr.idset JOIN .objpro op ON op.idpro = sr.idroot AND prop = 0 JOIN .keys k1 ON k1.idkey = op.idobj JOIN .keys kp ON kp.idkey = op.idpro JOIN .typ tm ON tm.idtyp = kp.objtyp JOIN .typ tob ON tob.idtyp = k1.objtyp GROUP BY km.idkey, km.keynam, kp.idkey, kp.keynam, tm.typnam, tob.typdsc, tob.idtyp ORDER BY count(1) DESC, kp.keynam, tob.typdsc


         ![](https://doc-data.castsoftware.com/TG/attachments/566532937/566532938.png)
      2. The below query is based on Result of Analysis AND the Generate Module Step :

         ```sql
-- Number of objects, per module, per type 
SELECT   cpf.object_name      AS "Module Name", 
         k.objtyp             AS "Type ID", 
         t.typnam             AS "Type Name", 
         Count(pso.object_id) AS "Objects Count" 
FROM     <mngt>.cms_portf_module cpf 
JOIN     <mngt>.cms_dynamicfields cdf 
ON       cdf.object_id = cpf.object_id 
AND      cdf.field_guid = 'entry' 
JOIN     <local>.pmc_subsets ps 
ON       ps.subset_name = 'CMS_MOD__' || cdf.field_value || '_Preparation2' 
JOIN     <local>.pmc_subset_objects pso 
ON       pso.subset_id = ps.subset_id 
JOIN     <local>.keys k 
ON       k.idkey = pso.object_id 
JOIN     <local>.typ t 
ON       t.idtyp = k.objtyp 
GROUP BY cpf.object_name, 
         k.objtyp, 
         t.typnam 
ORDER BY cpf.object_name, 
         t.typnam;
     ![](https://doc-data.castsoftware.com/TG/attachments/566532937/566532936.png)
  3. The result of both the queries must be consistent.
  4. If the results are not consistent :
     1. Check if there are external objects involved in the second query by running the below query :

        ```sql

SELECT cpf.object_name AS “Module Name”, k.objtyp AS “Type ID”, t.typnam AS “Type Name”, k.idkey AS “Object ID”, k.keynam AS “Object Name”, CASE WHEN op.prop = 1 THEN ‘External object’ WHEN op.prop = 0 THEN ‘Internal object’ END FROM .cms_portf_module cpf JOIN .cms_dynamicfields cdf ON cdf.object_id = cpf.object_id AND cdf.field_guid = ’entry’ JOIN .pmc_subsets ps ON ps.subset_name = ‘CMS_MOD__’ || cdf.field_value || ‘_Preparation2’ JOIN .pmc_subset_objects pso ON pso.subset_id = ps.subset_id JOIN .keys k ON k.idkey = pso.object_id JOIN .typ t ON t.idtyp = k.objtyp JOIN objpro op ON op.idobj = k.idkey AND op.prop = 1

         2. This query must not return rows. If it does, that means that the objects that are displayed are external objects:
            1. In CAST Management Studio check if there are tools after analysis and tools after module generation that change the properties of the object, turning it from Internal to External object.
      5. If the results of both queries are not as expected :
         1. Check and clean any ghost objects by running the queries described in the page [SQL Queries - CAST Knowledge Base - Queries on objects - Identify and clean up all the ghost objects and ghost projects in your knowledge base](/export-v2/tg/sql-queries/sql-queries-cast-knowledge-base/sql-queries-cast-knowledge-base-queries-on-objects/sql-queries-cast-knowledge-base-queries-on-objects-identify-and-clean-up-all-the-ghost-objects-and-ghost-projects-in-your-knowledge-base/)
2. If you are not facing issues related to incorrect number of objects, select the type of issue you are facing:
3. If you do not find the information you are looking for or solution for your problem, in this page, contact [CAST Technical Support](https://help.castsoftware.com/hc/en-us/requests/new) with the below [relevant input](#CMSSnapshotAnalysisGenerateModules-RelevantInput) to help CAST Support team investigate your problem or procure the required information.

#### **Relevant Input**

- **[CAST Support Tool (CST) - alias Sherlock](https://help.castsoftware.com/hc/en-us/articles/203751708-CAST-Support-Tool-CST-alias-Sherlock)** : Option to select are **Export Cast Dabatase, Export logs, Export Configuration files, Export source code**. (Source code is required if we need to test corruptions that have been fixed)
- Screenshot describing the error/warning

**Notes/comments**

**Related Pages**