Code Fix: An error occurs in K2 Rules that evaluates Boolean fields to 0 and 1

  • 16 February 2021
  • 0 replies
  • 5 views

Userlevel 3
Badge +8
 

Code Fix: An error occurs in K2 Rules that evaluates Boolean fields to 0 and 1

KB000476

PRODUCT
K2 blackpearl
SEE ALSO

K2 blackpearl Downloads Page

LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

 

Introduction

After upgrading to KB000450 an error occurs in K2 Rules (Line Rule, Succeeding Rules, Preceding Rules, Start and Finish Rules) which evaluates Boolean fields to 0 and 1. This behavior does not affect the normal functions of K2 rules, but rather only affects those rules where the evaluation of Boolean fields in the rule is 0 and 1. This is not default K2 behavior.

 

 

Error Scenario Steps

This is one example where the error might occur. When upgrading to KB000450 a problem with K2 SmartObject comparison might occur, for more information on KB000450 see here K2 blackpearl 0807 Update (4.8210.2.450)

Note: The steps below describe scenarios under which these errors may occur. These steps are simplified and not all steps are shown or described.
  1. Create a K2 SmartObject with the following fields
    • ID [autonumber]
    • Name [Text]
    • Surname [Text]
    • BeenInAccident [YesNo]
  2. Created a record in K2 SmartBox
    • 1;            John;     Doe;      True;
  3. Create a process
    • Configure the SmartObject Event Wizard to load the record from K2 SmartBox (using the load method) and saves the “BeenInAccident” property into a Datafield.
    • Create a K2 Server Event “Console.WriteLine(“Done!”); 
    • Configure line between the SmartObjectEvent Wizard and the Server Event as follows : Datafield (point “a”) = 1
  4. Start a new instance
  5. The error occurs

 

 

Error Messages

The following error message applies to this article:

  • Unable to compare values that is not of the same type.

 

 

Error Resolution

This Hotfix is contained within the latest K2 blackpearl 0807 Update. Install the update package to resolve the error.

The latest K2 blackpearl 0807 Update is available as an independent installation package which can be found here: https://portal.k2.com/downloads/bp/default.aspx

 


0 replies

Be the first to reply!

Reply