File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ public void writeExternal(ObjectOutput out) throws IOException {
41
41
42
42
@ Override
43
43
public boolean verifyDataType (final Object value ) {
44
- if ( value instanceof Boolean ) {
44
+ if (value == null ) {
45
+ return true ;
46
+ } else if (value instanceof Boolean || "true" .equalsIgnoreCase (value .toString ()) || "false" .equalsIgnoreCase (value .toString ())) {
45
47
return true ;
46
48
}
47
49
return false ;
Original file line number Diff line number Diff line change 20
20
import java .io .ObjectInput ;
21
21
import java .io .ObjectOutput ;
22
22
23
+ import org .apache .commons .lang3 .StringUtils ;
23
24
import org .jbpm .process .core .datatype .DataType ;
24
25
25
26
/**
@@ -41,9 +42,9 @@ public void writeExternal(ObjectOutput out) throws IOException {
41
42
42
43
@ Override
43
44
public boolean verifyDataType (final Object value ) {
44
- if ( value instanceof Float ) {
45
+ if (value == null ) {
45
46
return true ;
46
- } else if ( value == null ) {
47
+ } else if (value instanceof Float || StringUtils . isNumeric ( value . toString ()) ) {
47
48
return true ;
48
49
} else {
49
50
return false ;
Original file line number Diff line number Diff line change 21
21
import java .io .ObjectOutput ;
22
22
23
23
import org .jbpm .process .core .datatype .DataType ;
24
+ import org .apache .commons .lang3 .StringUtils ;
24
25
25
26
/**
26
27
* Representation of an integer datatype.
@@ -41,9 +42,9 @@ public void writeExternal(ObjectOutput out) throws IOException {
41
42
42
43
@ Override
43
44
public boolean verifyDataType (final Object value ) {
44
- if ( value instanceof Integer ) {
45
+ if (value == null ) {
45
46
return true ;
46
- } else if ( value == null ) {
47
+ } else if (value instanceof Integer || StringUtils . isNumeric ( value . toString ()) ) {
47
48
return true ;
48
49
} else {
49
50
return false ;
@@ -75,4 +76,8 @@ public Object valueOf(String value) {
75
76
}
76
77
}
77
78
79
+ public static void main (String [] args ){
80
+ IntegerDataType idt = new IntegerDataType ();
81
+ idt .verifyDataType ("1234567" );
82
+ }
78
83
}
You can’t perform that action at this time.
0 commit comments