Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/BranchCondition.java =================================================================== diff -u -r97612142f4697066beb66064e83ff31fef1712b9 -r735d44a0f14aa89d71703c3c6637231d845aa529 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/BranchCondition.java (.../BranchCondition.java) (revision 97612142f4697066beb66064e83ff31fef1712b9) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/BranchCondition.java (.../BranchCondition.java) (revision 735d44a0f14aa89d71703c3c6637231d845aa529) @@ -236,7 +236,7 @@ public boolean exactMatchMet(ToolOutputValue outputValue) { if ( "OUTPUT_LONG".equals(type) ) { - Long exactMatchObj = exactMatchValue != null ? Long.parseLong(exactMatchValue) : null; + Long exactMatchObj = exactMatchValue != null ? convertToLong(exactMatchValue) : null; Long actualValue = outputValue.getLong(); return ( actualValue != null && actualValue.equals(exactMatchObj)); } else if ( "OUTPUT_DOUBLE".equals(type) ) { @@ -256,8 +256,8 @@ public boolean inRange(ToolOutputValue outputValue) { if ( "OUTPUT_LONG".equals(type) ) { - Long startValueLong = startValue != null ? Long.parseLong(startValue) : null; - Long endValueLong = endValue != null ? Long.parseLong(endValue) : null; + Long startValueLong = startValue != null ? convertToLong(startValue) : null; + Long endValueLong = endValue != null ? convertToLong(endValue) : null; Long actualValue = outputValue.getLong(); return ( actualValue != null && ( startValueLong==null || actualValue.compareTo(startValueLong) >= 0 ) && @@ -287,4 +287,15 @@ return false; } + /** The data may have come in from WDDX and have .0 on the end of Longs, so eliminate that */ + private Long convertToLong( String textValue ) { + if ( textValue.length() == 0 ) + return null; + + int posPeriod = textValue.indexOf('.'); + if ( posPeriod > 0 ) { + textValue = textValue.substring(0,posPeriod); + } + return new Long (textValue); + } }