Previous Topic: CustomizationNext Topic: Customization of Attribute Mappings and Relationships


Customize the Attribute Transform

Crystal Reports Designer lets you customize the attribute Transform for system_name of Component CI by modifying formulas in the CompCI and parentcomp.rpt subreports.

<ftps>

  1. Log on to Crystal Report to the Enterprise where you deployed the CA CMDB Export report.
  2. From the CA Reports\CCA TO CMDB\ folder, right-click CA CMDB Export and select Open Report.

    The report appears.

  3. Right-click the CompCI subreport and select Edit Subreport.
  4. From the Field Explorer, open the fA_sysname formula.
  5. Edit the formula to the desired format.

    The following displays the formula definition of fA_sysname:

    local stringVar sysName;
    local stringVar bpName;
    local stringVar srvrName;
    local stringVar compVer;
    local stringVar compQual;
    local stringVar appName;
    local stringVar instDir;
    local stringVar portNo;
    local numberVar type; // typ will be 1, 2 or 3 depending upon bp name
    
    local stringVar temp;
    local stringVar tempQual;
    local numberVar diff;
    
    if (isnull(maximum({query_compci.Bp Name}, {query_compci.Comp Uuid}))) 
    then bpName := "" else bpName := maximum({query_compci.Bp Name}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Srvr Name}, {query_compci.Comp Uuid}))) 
    then srvrName := "" else srvrName := maximum({query_compci.Srvr Name}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Comp Qual}, {query_compci.Comp Uuid}))) 
    then compQual := "" else compQual := maximum({query_compci.Comp Qual}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Comp Ver}, {query_compci.Comp Uuid}))) 
    then compVer := "" else compVer := maximum({query_compci.Comp Ver}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Application Name}, {query_compci.Comp Uuid}))) 
    then appName := "" else appName := maximum({query_compci.Application Name}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Install Dir}, {query_compci.Comp Uuid}))) 
    then instDir := "" else instDir := maximum({query_compci.Install Dir}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Listen Port}, {query_compci.Comp Uuid}))) 
    then portNo := "" else portNo := maximum({query_compci.Listen Port}, {query_compci.Comp Uuid});
    if (bpName in ["J2EE Enterprise Application", "Java Web Application"]) then 
        type := 1
    else if (bpName in ["BEA WebLogic Domains (Windows)", "BEA WebLogic Domains (UNIX)", "BEA WebLogic Domain (Windows)", "BEA WebLogic Domain (UNIX)"]) then 
        type := 2
    else if (bpName in ["IBM WebSphere 6 Server Instance (UNIX)", "IBM WebSphere 6 Server Instance (Windows)", "IBM WebSphere 5 Server Instance (UNIX)", "IBM WebSphere 5 Server Instance (Windows)"]) then 
        type := 2
    else 
        type := 3;
    if(type=3) then
    (
        if(not(isnumeric(left(srvrName,(instr(srvrName,'.'))-1)))) then
        srvrName := left(srvrName,(instr(srvrName,'.'))-1)
        else
        srvrName := srvrName;
    )
    else
    srvrName := srvrName;
    
    if (type = 1) then 
    (
        sysName := "j2ee|" & srvrName & "|" & appName & "|" & instDir ;
        if (len(sysName) > 255) then
            sysName := left(sysName, 255);
    )
    else if (type = 2) then
    (
        sysName := "port|" & srvrName & "|" & portNo;
        if (len(sysName) > 255) then
            sysName := left(sysName, 255);
    )
    else (
        temp := srvrName & "|" & bpName & "|" & compVer & "|" ;
    
        if (len(temp) + len(compQual) <= 255) then
            (sysName := temp & compQual)
        else
            (
                diff:= (length(temp) + length(compQual))+ 3 -252;
                if ( length(compQual) > diff ) then
                    compQual:= mid(compQual,1,(length(compQual) - diff)\2+1)+"..."+ mid(compQual,(length(compQual) + diff)\2)
                else
                    compQual := "";
                sysName := temp & compQual;
            )
    );
    sysName;
    
  6. Close the CompCI subreport after modifying the fA_sysname formula.
  7. Open the parentcomp.rpt subreport and modify the system_name attributes for the fA_sysname and fA_sysname 2 formulas accordingly.

    The following displays the formula definition of fA_sysname:

    local stringVar sysName;
    local stringVar bpName;
    local stringVar srvrName;
    local stringVar compVer;
    local stringVar compQual;
    local stringVar appName;
    local stringVar instDir;
    local stringVar portNo;
    local numberVar type; // typ will be 1, 2 or 3 depending upon bp name
    
    local stringVar temp;
    local stringVar tempQual;
    local numberVar diff;
    
    if (isnull(maximum({query_compci.Bp Name}, {query_compci.Comp Uuid}))) 
    then bpName := "" else bpName := maximum({query_compci.Bp Name}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Srvr Name}, {query_compci.Comp Uuid}))) 
    then srvrName := "" else srvrName := maximum({query_compci.Srvr Name}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Comp Qual}, {query_compci.Comp Uuid}))) 
    then compQual := "" else compQual := maximum({query_compci.Comp Qual}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Comp Ver}, {query_compci.Comp Uuid}))) 
    then compVer := "" else compVer := maximum({query_compci.Comp Ver}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Application Name}, {query_compci.Comp Uuid}))) 
    then appName := "" else appName := maximum({query_compci.Application Name}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Install Dir}, {query_compci.Comp Uuid}))) 
    then instDir := "" else instDir := maximum({query_compci.Install Dir}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_compci.Listen Port}, {query_compci.Comp Uuid}))) 
    then portNo := "" else portNo := maximum({query_compci.Listen Port}, {query_compci.Comp Uuid});
    if (bpName in ["J2EE Enterprise Application", "Java Web Application"]) then 
        type := 1
    else if (bpName in ["BEA WebLogic Domains (Windows)", "BEA WebLogic Domains (UNIX)", "BEA WebLogic Domain (Windows)", "BEA WebLogic Domain (UNIX)"]) then 
        type := 2
    else if (bpName in ["IBM WebSphere 6 Server Instance (UNIX)", "IBM WebSphere 6 Server Instance (Windows)", "IBM WebSphere 5 Server Instance (UNIX)", "IBM WebSphere 5 Server Instance (Windows)"]) then 
        type := 2
    else 
        type := 3;
    if(type=3) then
    (
        if(not(isnumeric(left(srvrName,(instr(srvrName,'.'))-1)))) then
        srvrName := left(srvrName,(instr(srvrName,'.'))-1)
        else
        srvrName := srvrName;
    )
    else
    srvrName := srvrName;
    
    if (type = 1) then 
    (
        sysName := "j2ee|" & srvrName & "|" & appName & "|" & instDir ;
        if (len(sysName) > 255) then
            sysName := left(sysName, 255);
    )
    else if (type = 2) then
    (
        sysName := "port|" & srvrName & "|" & portNo;
        if (len(sysName) > 255) then
            sysName := left(sysName, 255);
    )
    else (
        temp := srvrName & "|" & bpName & "|" & compVer & "|" ;
    
        if (len(temp) + len(compQual) <= 255) then
            (sysName := temp & compQual)
        else
            (
                diff:= (length(temp) + length(compQual))+ 3 -252;
                if ( length(compQual) > diff ) then
                    compQual:= mid(compQual,1,(length(compQual) - diff)\2+1)+"..."+ mid(compQual,(length(compQual) + diff)\2)
                else
                    compQual := "";
                sysName := temp & compQual;
            )
    );
    sysName;
    

    The following displays the formula definition of fA_sysname 2:

    local stringVar sysName;
    local stringVar bpName;
    local stringVar srvrName;
    local stringVar compVer;
    local stringVar compQual;
    local stringVar appName;
    local stringVar instDir;
    local stringVar portNo;
    local numberVar type; // typ will be 1, 2 or 3 depending upon bp name
    
    local stringVar temp;
    local stringVar tempQual;
    local numberVar diff;
    
    if (isnull(maximum({query_parentCompDetails.Bp Name}, {query_compci.Comp Uuid}))) 
    then bpName := "" else bpName := maximum({query_parentCompDetails.Bp Name}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_parentCompDetails.Srvr Name}, {query_compci.Comp Uuid}))) 
    then srvrName := "" else srvrName := maximum({query_parentCompDetails.Srvr Name}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_parentCompDetails.Comp Qual}, {query_compci.Comp Uuid}))) 
    then compQual := "" else compQual := maximum({query_parentCompDetails.Comp Qual}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_parentCompDetails.Comp Ver}, {query_compci.Comp Uuid}))) 
    then compVer := "" else compVer := maximum({query_parentCompDetails.Comp Ver}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_parentCompDetails.Application Name}, {query_compci.Comp Uuid}))) 
    then appName := "" else appName := maximum({query_parentCompDetails.Application Name}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_parentCompDetails.Install Dir}, {query_compci.Comp Uuid}))) 
    then instDir := "" else instDir := maximum({query_parentCompDetails.Install Dir}, {query_compci.Comp Uuid});
    if (isnull(maximum({query_parentCompDetails.Listen Port}, {query_compci.Comp Uuid}))) 
    then portNo := "" else portNo := maximum({query_parentCompDetails.Listen Port}, {query_compci.Comp Uuid});
    
    if (bpName in ["J2EE Enterprise Application", "Java Web Application"]) then 
        type := 1
    else if (bpName in ["BEA WebLogic Domains (Windows)", "BEA WebLogic Domains (UNIX)", "BEA WebLogic Domain (Windows)", "BEA WebLogic Domain (UNIX)"]) then 
        type := 2
    else if (bpName in ["IBM WebSphere 6 Server Instance (UNIX)", "IBM WebSphere 6 Server Instance (Windows)", "IBM WebSphere 5 Server Instance (UNIX)", "IBM WebSphere 5 Server Instance (Windows)"]) then 
        type := 2
    else 
        type := 3;
    if(type=3) then
    (
        if(not(isnumeric(left(srvrName,(instr(srvrName,'.'))-1)))) then
        srvrName := left(srvrName,(instr(srvrName,'.'))-1)
        else
        srvrName := srvrName;
    )
    else
    srvrName := srvrName;
    if (type = 1) then 
    (
        sysName := "j2ee|" & srvrName & "|" & appName & "|" & instDir ;
        if (len(sysName) > 256) then
            sysName := left(sysName, 256);
    )
    else if (type = 2) then
    (
        sysName := "port|" & srvrName & "|" & portNo;
        if (len(sysName) > 256) then
            sysName := left(sysName, 256);
    )
    else (
        temp := srvrName & "|" & bpName & "|" & compVer & "|" ;
    
        if (len(temp) + len(compQual) <= 256) then
            (sysName := temp & compQual)
        else
            (
                diff:= (length(temp) + length(compQual))+ 3 -252;
                if ( length(compQual) > diff ) then
                    compQual:= mid(compQual,1,(length(compQual) - diff)\2+1)+"..."+ mid(compQual,(length(compQual) + diff)\2)
                else
                    compQual := "";
                sysName := temp & compQual;
            )
    );
    sysName;
    
  8. Close the parentcomp.rpt subreport.

    The Transform attributes are customized.

Database CI for Integrating CA Configuration Automation and CMDB

When you integrate CA Configuration Automation and CMDB, a new CI named Database Name is created in the cmdbexport.xml file, and in CA SDM. The Database Name CI exports the database name values obtained for the Component Parameters and Variables, and the File Structure class parameters.

When you create a custom blueprint set the Component Parameter, or File Structure class Parameter to Interpret As Database Name in the Value Details attribute panel. Set the Interpret As Database Name to a specific parameter depending on your requirements. We recommend you to set the Database Name for the blueprint parameters that belongs to the Relational Databases category.

For example, follow these steps to set a Database Name for Oracle Database 11g (Windows) component blueprint:

  1. Create a copy of the Oracle Database 11g (Windows) component blueprint.
  2. Select a Component or File Structure class parameter (OracleSID in this example) and set it to Interpret As = Database Name.
  3. Add the following query in the acmbo_classmapping table:

    INSERT INTO acmbo_classmapping VALUES('component','Copy of Oracle Database 11g (Windows)','Software.Database','Oracle')

4. Discover the copy of Oracle Database 11g (Windows) component blueprint for any Windows computer where Oracle 11g is installed.

After the discovery is complete, the relationships are displayed in the Configuration Relationships view of the respective server.

5. Run the CMDB Export Report to verify the database name in the cmdbexport.xml file. A code sample follows:

<ci> 
<name>orcl</name> 
<dns_name /> 
<serial_number /> 
<system_name>orcl</system_name> 
<family>Software.Database</family> 
<class>Oracle</class> 
<mdr_name>lodivmlcvs2026.ca.com</mdr_name> 
<mdr_class>CCA r12.8</mdr_class> 
<federated_asset_id>&amp;objtype=database&amp;name=orcl</federated_asset_id> 
</ci> 
<relation> 
<type>communicates with</type> 
<provider> 
<name>Copy of Oracle Database 11g (Windows) 11.2.0.1.0 (C:\app\Administrator\product\11.2.0\dbhome_1)</name> 
<system_name> 
bgunn03-i44401.ca.com|Copy of Oracle Database 11g (Windows)|11.2.0.1.0|C:\oracle\product\11.2.0\dbhome_1) 
</system_name> 
</provider> 
<dependent> 
<name>orcl</name> 
<dns_name></dns_name> 
<serial_number></serial_number> 
<system_name>orcl</system_name> 
</dependent> 
</relation> 
The name and system_name (shown in bold in this example) are the discovered values. The family and class are derived based on the provider component.
After the export, the CA Service Desk UI displays the relationship, and the CMDB Visualizer displays the component relationships.