The domains migrated to PostgreSQL are showing errors when viewed or edited in the Domain Designer. The domains are not invalid or corrupted, they are valid domains. However, a known issue with the Domain Designer prevents the correct visualization of the tables and columns included in those migrated domains. In some cases, editing the domains via Domain Designer can also result in undesirable results.
In the Domain Designer, when you are editing a domain and you navigate to the Tables tab, the tables and columns listed in Selected Tables (right panel) display in red indicating that those database entities do not exist in the database. A pop-up message shows up explaining that the schema contains resources that are not in the selected data source and their information will be deleted.
Clarity with Jaspersoft in Google Cloud Platform
This is a defect DE53507 and fixed by upgrading to Jaspersoft 7.1.3
Click Cancel when prompted with the Export Bundle pop-up message. By clicking Cancel the resources incorrectly listed as not existing in the data source will not be deleted from the domain schema.
This issue applies to custom domains migrated to PostgreSQL and custom domains created from copies of OOTB domains. This issue only applies to PostgreSQL.
Please follow the instructions below in case you need to edit those custom domains.
Important! Always save a backup of the domain schema file before making any changes.
Instructions:
Default domains:
We strongly recommend that you do not make any changes to the default domains (OOTB domains) that come with the application and advanced reporting solution. These domains are dynamically updated and overwritten during upgrades and restore procedures. Changes to these domains can be lost in restore procedures or can damage their structure causing issues for the dynamic update. Instead, always make a copy of the default domain and then make your changes to the copy.
Custom Domains created in PostgreSQL:
The domains created from scratch in PostgreSQL environments do not have this issue. Only domains that are migrated from Oracle environments or are copies of the default domains have this issue. This issue only applies to PostgreSQL.
Custom Domains migrated to PostgreSQL:
Follow these instructions if you created a new attribute for an object in Clarity Studio, or included a new attribute to the Data Warehouse, and now you need to add the attribute to your existing custom domains so it can be exposed in your ad hoc reports.
In order to avoid syntax issues and incorrect data types, we recommend that you create a dummy domain and export its design so you can have an example of the <field> entry for the new custom attribute that you can use later.
To create the dummy domain:
For this example we are going to use the Investment object where a new_domain_attr attribute was created as data type String. In this case, we are going to select the dwh_inv_investment table.
For this example, the <field> entry is included as part of the DWH_INV_INVESTMENT table definition (tableName="dwh_inv_investment") as follows:
<field id="new_domain_attr" fieldDBName="new_domain_attr" type="java.lang.String"/>
To edit the custom domain:
Important! Always save a backup of the domain schema file before making any changes.
For this example, search for tableName="dwh_inv_investment".
<field id="NEW_DOMAIN_ATTR" fieldDBName="new_domain_attr" type="java.lang.String"/>
For this example, the <field> entry is included as part of the JoinTree_1 with all other DWH_INV_INVESTMENT attributes. Note that for this type of entry you need to include the table alias as part of the id.
<field id="DWH_INV_INVESTMENT.NEW_DOMAIN_ATTR" fieldDBName="new_domain_attr" type="java.lang.String"/>
Now that the field is part of the table, you can edit the domain again and expose it from the Display tab or use it in calculated attributes. These changes can be made from the Domain Designer.
Follow these instructions if you need to add a table that was not already selected to your existing custom domains so you can satisfy a join requirement or expose the columns on this table in your ad hoc reports.
Important! Always save a backup of the domain schema file before making any changes.
To edit the custom domain:
Important! If you click OK instead of Cancel, cancel editing the domain and start over. The resources won’t be removed if you do not save the domain.
Important! If after you click OK, you receive a message “Please Wait Loading…” and the application spins and does not respond, click the Refresh button available in Clarity (not the Refresh button in the browser) and click OK again.
Now that the table is included in the domain and the join established, you can edit the domain again and expose the table columns from the Display tab or use them in calculated attributes. These changes can be made from the Domain Designer.
This issue does not affect the Display tab. You can modify display sets and fields from the Domain Designer as you usually do.
When creating a calculated field for the domain, write the expression to compute a value based on the columns of the same join tree using the correct alias for those columns.
For example,
concat(DWH_INV_INVESTMENT.ENTITY,' - ',DWH_INV_INVESTMENT.DEPARTMENT )
“DWH_INV_INVESTMENT” is the table alias for the tableName="dwh_inv_investment" whereas “ENTITY” and “DEPARTMENT” are the column aliases for the fieldDBName="entity" and fieldDBName="department" respectively.
When adding a derived table for the domain, write the query as you would normally do. When you join the derived table and you click OK, if you receive a message “Please Wait Loading…” and the application spins and does not respond, click the Refresh button available in Clarity (not the Refresh button in the browser) and click OK again.
Follow these instructions if you need to remove a table that was already included in your custom domains.
You can only remove a table from a domain if its columns are not used by any ad hoc view/report. If your ad hoc views/reports are referencing any of the columns of that table, you need to first remove them from the ad hoc views/reports and then remove from the domain.
Once no ad hoc view/report is referencing the table columns, edit the domain and remove references to the table and columns from display fields, calculated fields, derived tables, pre-filters, joins and any other reference. After that you can navigate to the Tables tab and remove the table.
To edit the custom domain:
Important! If after you click OK, you receive a message “Please Wait Loading…” and the application spins and does not respond, click the Refresh button available in Clarity (not the Refresh button in the browser) and click OK again.
Important! If you click OK instead of Cancel, cancel editing the domain and start over. The resources won’t be removed if you do not save the domain.
Follow these instructions if you need to remove a column that was already included in your custom domains.
You can only remove a column from a domain if the column is not used by any ad hoc view/report. If your ad hoc views/reports are referencing that column, you need to first remove it from the ad hoc views/reports and then remove from the domain.
Once no ad hoc view/report is referencing the column, edit the domain and remove references to the column from display fields, calculated fields, derived tables, pre-filters, joins and any other reference. After that you can edit the XML file and remove it from the tables.
To edit the custom domain:
Important! If after you click OK, you receive a message “Please Wait Loading…” and the application spins and does not respond, click the Refresh button available in Clarity (not the Refresh button in the browser) and click OK again.
Important! Always save a backup of the domain schema file before making any changes.
For this example, search for fieldDBName="new_domain_attr" and remove all references as follows:
<field id="NEW_DOMAIN_ATTR" fieldDBName="new_domain_attr" type="java.lang.String"/>
<field id="DWH_INV_INVESTMENT.NEW_DOMAIN_ATTR" fieldDBName="new_domain_attr" type="java.lang.String" />
Now that the field is removed from the table, you can edit the domain again and make other changes as desired from the Domain Designer.
Understanding the issue in more detail:
In Jaspersoft, ad hoc queries are built using quoted table and column names and quoted names in PostgreSQL are case-sensitive. For instance, “dwh_inv_investment” is not equivalent to “DWH_INV_INVESTMENT”, they are two different tables.
Table and column names specified in the domain schema xml file must match the table and columns names used in the database.
In order to support ad hoc views and domains migrated to PostgreSQL that were previously created in Oracle, domains were modified to have lowercase references to table and column names whereas aliases were kept uppercase.
Table name example:
<jdbcTable id="DWH_INV_INVESTMENT" datasourceId="CA_PPM_DWH_BEAN" tableName="schema1.dwh_inv_investment">
The table name specified by the “tableName” property must be lowercase to match the table name in PostgreSQL.
The table alias specified by the “id” property must be uppercase to match existing references in ad hoc views and reports.
Column name example:
<field id="INVESTMENT_NAME" type="java.lang.String" fieldDBName="investment_name"/>
The column name specified by the “fieldDBName” property must be lowercase to match the column name in PostgreSQL.
The column alias specified by the “id” property must be uppercase to match existing references in ad hoc views and reports.