Object cannot be cast from DB.Null to other types on opening a project

3 Years Ago
JorgeR
BIZAGI STUDIO

Summary

An error message is displayed when trying to open Studio, related to null values in the Database (BDNull). This usually happens after creating or changing Business rules in Bizagi Studio and reopening the program. 

Applies to

Bizagi JEE 10.x. using SQL Server

Symptoms

A user opens Bizagi Studio, selects a project to open and after loading the project Bizagi displays an error message and fails to start:

Cause

This problem has two possible causes:

  • The Protocols TCP/IP and Named Pipes are enabled.
  • There are assignations or comparisons to NULL in date-type attributes or parameters in rules execution.

Solution

1. Verify that the protocols mentioned above are enabled:

1.1 Open SQL Server Configuration Manager.

1.2 Expand node SQL Server Network Configuration and select the Protocols of your SQL Server instance.  

1.3 Enable the Protocols TCP/IP and Named Pipes.

2. If the protocols are enabled and the problem continues, check for assignations or comparisons with null to date-type attrbutes or parameters in rules execution. The following are some examples of what you need to avoid and what you have to use:

Incorrect Correct
if(<XPath.DateParameter> != null)
{
   ...
}
var VariableDate = <XPath.DateParameter>;
if(!CHelper.IsNull(VariableDate))
{
   ...
}
if(<XPath.DateParameter> == null)
{
   ...
}
var VariableDate = <XPath.DateParameter>;
if(CHelper.IsNull(VariableDate))
{
   ...
}
<XPath.DateParameter> = null Me.setXPath(<XPath.DateParameter>, null);

Rate this Article:

Details

Last Modified:3 Years Ago
Last Modified By: Andread
Type: ERROR
Level: Intermediate
Article not rated yet.
Article has been viewed 4.8K times.

Options