Skip to main content

Having problems with something that would seem rather simple but doesnt appear to be.  I have an activity and from that activity I have two lines/line rules.  I set the line rules to check a process data field to determine if it is empty or not (one rule for empty, one rule for not empty... I did this in the Line Rule GUI... K2ProcessData Variable = "" (I didnt have to put in the quotes) or K2 ProcessData Variable <> "" (again, I just left it blank, no quotes needed).  When the process gets to that step, I get the following error in K2 Service Manager: 


System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.String.System.IConvertible.ToInt32(IFormatProvider provider)
   at System.Convert.ToInt32(Object value)
   at K2Code202258.Func2(LineRuleContext& K2)
   at K2Code202258.Main(LineRuleContext& K2)


 


I havent seen this before and think it has something to do with the null value in that field, and it trying to convert the null to an integer.. Anyone run into this before.?  I know how to get to the code underneath, and can change the destination rules there if need be... All I am trying to do is figure out if a K2 process variable is empty or not.  Thanks for any help... !! 


 


 


 

What is the variable type of the process variable? It sounds like it is a numeric of some kind, so the "empty" value is going to be whatever you specified as the Initial Value (0 by default). That's what you should compare it against.


Reply