Skip to content

Commit

Permalink
JBPM-9884 Dont allow to modify process variable of type Integer/Boole…
Browse files Browse the repository at this point in the history
…an/..etc with invalid values through business-central console.
  • Loading branch information
bxf12315 committed Sep 7, 2021
1 parent ff1a56c commit faf0482
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void writeExternal(ObjectOutput out) throws IOException {

@Override
public boolean verifyDataType(final Object value) {
if ( value instanceof Boolean ) {
if (value instanceof Boolean || "true".equalsIgnoreCase(value.toString()) || "false".equalsIgnoreCase(value.toString())) {
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -41,9 +42,9 @@ public void writeExternal(ObjectOutput out) throws IOException {

@Override
public boolean verifyDataType(final Object value) {
if ( value instanceof Float ) {
if (value instanceof Float || StringUtils.isNumeric(value.toString())) {
return true;
} else if ( value == null ) {
} else if (value == null) {
return true;
} else {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.ObjectOutput;

import org.jbpm.process.core.datatype.DataType;
import org.apache.commons.lang3.StringUtils;

/**
* Representation of an integer datatype.
Expand All @@ -41,9 +42,9 @@ public void writeExternal(ObjectOutput out) throws IOException {

@Override
public boolean verifyDataType(final Object value) {
if ( value instanceof Integer ) {
if (value instanceof Integer || StringUtils.isNumeric(value.toString())) {
return true;
} else if ( value == null ) {
} else if (value == null) {
return true;
} else {
return false;
Expand Down

0 comments on commit faf0482

Please sign in to comment.