Symptoms
Unable to compare values that are not of the same type
Diagnoses
We are working on a new workflow project and are in the process of designing the workflow blocks and testing the logic to make sure the logic is correct.
to check the logic I have line rules which are comparing a column from the database. the column is of data type bit has a "yes" value stored in it as default. (see attached image 'data type.jpg')
on the line rule in the input mapping I have hardcoded the value so It reads the 'yes' value from the database column. (see attached image 'Input Mapping.Jpg')
when I run the workflow, I get an error on the defaultline2 saying" Unable to compare values that are not of the same type" not sure why it says that because the column datatype is 'bit' and on the line rule I have a condition 'column = yes' (see attached image 'Line Rule.Jpg'). I have also tried to amend the Line rule to say "column = 1' but I got the same exact error saying unable to compare.
I have also attached the screenshot of the smo tester where it is showing a list of data from the sql table. also attached is the screenshot of the workspace errors.
could you please let me know how to rectify the problem.
fyi : our dev server is on K2 Blackpearl version 4.6.10(4.12060.1690.1)
Resolution
It's important to remember that a BIT column is not a String or Integer DataType but BOOLEAN . Therefore , the 1 or 0 stored in the Column denotes a True/False BOOLEAN Object value and not a True/False or Yes/No STRING Object or even a 1/0 INT Object ... So whenever you return that value from the DB , due to the BIT DataType , it will be treated as a Boolean . In your Line rule what you are trying to do is compare a BOOL Object (True/False) against a String value of True/False or Yes/No and this is why you are getting the Cast errors
To fix this , what you need to do on your Line Rule is keep it as is , but for your Qualifier , the second value , that you currently have as "Yes" ... Instead of typing in Yes , goto the Content Browser , Functions/Expressions tab , Logical and use the True or False Bool objects from there