Support Article

When-rule not being properly performed in precondition

SA-25671

Summary



A When-rule referenced in an activity step precondition is not being properly evaluated.

Error Messages



com.pega.pegarules.pub.clibpboard.InvalidParameterException: cannot be null/empty. page: MyWhenRule. Details: Invalid value for a Reference passed to com.pega.pegarules.data.intern . . .


Steps to Reproduce



Use an expression similar to this in an activity step pre-condition:

 
(pyWorkPage.MyProperty==Primary.MyProperty) && MyWhenRule
 


Root Cause



The assembler is interpreting MyWhenRule in that expression as a page name instead of a when-rule.  

Preconditions should either be When-rules or expressions but not a combination.  Instead, use two pre-condition lines, as shown below.

Resolution



The particular solution chosen was to replace the reference to MyWhenRule with the definition of MyWhenRule in the expression.

 The drawback to this is that if the definition of MyWhenRule is changed later, the expression will need to be edited again.

User is suggested that two pre-condition lines be used, similar to the following logic:


If (pyWorkPage.MyProperty==Primary.MyProperty) then continue else skip step
If MyWhenRule then continue else skip step
 

 

Published July 15, 2016 - Updated July 29, 2016

Have a question? Get answers now.

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