File tree Expand file tree Collapse file tree 3 files changed +20
-11
lines changed
jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,13 @@ 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
45
return true ;
46
+ } else if (value instanceof Boolean ) {
47
+ return true ;
48
+ } else {
49
+ return Boolean .parseBoolean (value .toString ());
46
50
}
47
- return false ;
48
51
}
49
52
50
53
@ Override
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,12 +42,15 @@ 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
- return true ;
46
- } else if ( value == null ) {
45
+ if (value == null ) {
47
46
return true ;
48
47
} else {
49
- return false ;
48
+ try {
49
+ Float .parseFloat (value .toString ());
50
+ return true ;
51
+ } catch (NumberFormatException e ) {
52
+ return false ;
53
+ }
50
54
}
51
55
}
52
56
Original file line number Diff line number Diff line change @@ -41,12 +41,15 @@ public void writeExternal(ObjectOutput out) throws IOException {
41
41
42
42
@ Override
43
43
public boolean verifyDataType (final Object value ) {
44
- if ( value instanceof Integer ) {
45
- return true ;
46
- } else if ( value == null ) {
44
+ if (value == null ) {
47
45
return true ;
48
46
} else {
49
- return false ;
47
+ try {
48
+ Integer .parseInt (value .toString ());
49
+ return true ;
50
+ } catch (NumberFormatException e ) {
51
+ return false ;
52
+ }
50
53
}
51
54
}
52
55
@@ -74,5 +77,4 @@ public Object valueOf(String value) {
74
77
return value ;
75
78
}
76
79
}
77
-
78
80
}
You can’t perform that action at this time.
0 commit comments