Here you can find the source of convertToJBPM(Object value)
Parameter | Description |
---|---|
value | The input value, String or BigDecimal |
public static Object convertToJBPM(Object value)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { /**/* w ww . j a v a2 s . c o m*/ * A helper to convert result variables for jBPM. * Afm will return integer and double values as BigDecimal, this * helper will convert those to Integer and Double for jBPM compatibility. * * @param value The input value, String or BigDecimal * @return Value jBPM output value, Integer, Double or String */ public static Object convertToJBPM(Object value) { if (BigDecimal.class.isInstance(value)) { BigDecimal v = (BigDecimal) value; if (v.scale() == 0) { return v.intValue(); } return v.doubleValue(); } return value; } }