PW01-L06 · Logic change

Fallback value for null

Replace SQL ISNULL with an explicit null check.

ProjectWise-specific
Migration outcome

Avoid confusing null, a missing object, and an empty string.

ProjectWise context

General expression in ProjectWise CEL

SQL functionLegacy ProjectWise configuration
ISNULL(prop, 'ABC')
CELProjectWise CEL
prop == null ? 'ABC' : prop

What is different

CEL makes the condition and both result branches explicit, exposing the decision that SQL ISNULL hides inside a function.

  1. null is not the same as an empty string.
  2. Dereferencing a null object fails before a fallback can be applied.
  3. Some ProjectWise object properties return an empty object rather than null.

Migration goal

Return fallback text only when the original value is null.

What changes

Instead of a SQL function, CEL uses an explicit condition. This does not catch an error caused by dereferencing a null object earlier in the expression.

Why the CEL solution is clearer

A reviewer can inspect the condition and both results. It is also clear that an empty string does not become the fallback.

Before deployment

Test null, an empty string, and a valid value separately. If prop comes from an object, guard that object first.

Sources

  • BENTLEY-PW-CEL-SQL-FUNCTIONSISNULL replacement.
  • BENTLEY-PW-CEL-NULLS — null objects versus empty objects.