Support Article

Declare Expression fires with null input values

SA-28029

Summary



Declare expressions fire incorrectly when one or more input properties lack a value, and "Enable Expression Calculation" does not halt Forward Chaining.
When declare expressions fire, screens are not updated until after refresh.
End result – In the Review Harness (note that on-screen value is not updated, which would be correct):
But the Clipboard… – Declarative fired unexpectedly:


Error Messages



Not applicable


Steps to Reproduce



A) Create "Source1" property.
B) Create "Source2" property.
C) Create "Target" property.
D) Create a new case, set "Source1" to "5" and "Target" to "2" manually.
E) Now at this point the case has been created but the property called "Source2" does not exist.
F) Create a Declare Expression ("Target" = "Source1" + "Source2") - Tracking set to "Whenever inputs change".
G) Create a custom REVIEW harness which is presenting "Source2" (on review mode obviously).
H) If user opens the case on REVIEW harness, "Source2" property will be created and set to "null". This will be considered as an input change and the declare expression fires.



Root Cause



The property was not existing and is set to null after having reviewed the case. For the system, this is actually an input change, so the declare expression fires. 

Resolution



The behaviour reported is the expected one. Concerning the checkbox on HARNESS form called “Enable expression calculation” it is a bit misleading.

This option is presented on all harnesses but mainly used for PERFORM harness.

The idea is to make sure the form will be refreshed to present the correct value if the user change an input. The documentation is showing the following:

Still this expected behaviour is not compatible with the business needs, so a local change has been proposed to check the scenario on the declare expression with a WHEN condition and avoid the execution:


 

Published September 15, 2016 - Updated September 27, 2016

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.