This article refers to legacy products, components or features. Therefore, the content in this article is offered "as is" and will no longer be updated. 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.
When a comparison is performed between two data fields that may be of the same type, an exception is thrown when the need arises to cast the comparative value to a different data type.
- The circumstances described in this article are one scenario under which this issue may, or is known to occur. The description is intended to be specific to the scenario described and does not take into account all possible scenarios or circumstances.
- This error scenario is related to the K2 Rules engine and applies to all instances where a comparison takes place between two values using a line rule to perform the evaluation.
When the comparison takes place, the value on the left is not altered i.e. the data type is retained, for the value on the right a casting is performed when required to ensure that the value is the same type as the value on the left.
As shown in the example below, the data fields are both type string. However, owing to the characters used to represent the data the comparison engine sees the numerical characters as a numeric data type e.g. int but the text on the right hand side remains as string. When the comparison is performed, the exception is thrown.
|Note: In the image above L refers to the First Variable and the R refers to the Second Variable.|
- In A above, both data types are string even though the left hand value's characters are numeric. The expected result of a comparison tales place
- In B because the left hand value uses numeric characters, these are interpreted as INT or Double. When the comparison is performed with the right hand value, the exception results as the right hand value is not type INT or Double.
Steps to reproduce this error
The steps provided below can be used to reproduce the error, not all steps are listed.
- Create a new process
- Drag a new activity onto the canvas,
- Add a Server event
- Connect the Start Activity to the Sever Event with a line and create a simple line rule evaluating a process level string value with a blank value
- Plan the process and populate the datafield (or set it as the default) with a value of "1234"
- As soon as the line rule is evaluated, it will fail with the exception
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: http://portal.k2.com/downloads/bp/default.aspx