diff --git a/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/BooleanDataType.java b/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/BooleanDataType.java index 36eeed2658..2fe2a42778 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/BooleanDataType.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/BooleanDataType.java @@ -41,7 +41,9 @@ public void writeExternal(ObjectOutput out) throws IOException { @Override public boolean verifyDataType(final Object value) { - if ( value instanceof Boolean ) { + if (value == null) { + return true; + } else if (value instanceof Boolean || "true".equalsIgnoreCase(value.toString()) || "false".equalsIgnoreCase(value.toString())) { return true; } return false; diff --git a/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/FloatDataType.java b/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/FloatDataType.java index e3fa20d017..ae12910029 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/FloatDataType.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/FloatDataType.java @@ -20,6 +20,7 @@ import java.io.ObjectInput; import java.io.ObjectOutput; +import org.apache.commons.lang3.StringUtils; import org.jbpm.process.core.datatype.DataType; /** @@ -41,12 +42,15 @@ public void writeExternal(ObjectOutput out) throws IOException { @Override public boolean verifyDataType(final Object value) { - if ( value instanceof Float ) { - return true; - } else if ( value == null ) { + if (value == null) { return true; } else { - return false; + try { + Float.parseFloat(value.toString()); + return true; + } catch (NumberFormatException e) { + return false; + } } } diff --git a/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/IntegerDataType.java b/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/IntegerDataType.java index a0a2194e06..fe246f5718 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/IntegerDataType.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/IntegerDataType.java @@ -41,12 +41,15 @@ public void writeExternal(ObjectOutput out) throws IOException { @Override public boolean verifyDataType(final Object value) { - if ( value instanceof Integer ) { - return true; - } else if ( value == null ) { + if (value == null) { return true; } else { - return false; + try { + Integer.parseInt(value.toString()); + return true; + } catch (NumberFormatException e) { + return false; + } } } @@ -74,5 +77,4 @@ public Object valueOf(String value) { return value; } } - }