In the script task, when attempting to locate a case using the 'findCaseByCriteria(String DQL)' method with a caseIdentifier containing eight or more digits, an error is encountered:
e.g.
Parameter = 10470836;
var query = "caseIdentifier = :Parameter";
var cert = cac_com_example_casedatademo_Case1.createCriteria(query);
cert.setQueryParameter("Parameter", Parameter);
cac_com_example_casedatademo_Case1.findByCriteria(cert);
Error - com.tibco.bds.common.exception.BDSDAInvalidDataViewException: A value specified was not of the appropriate type for the data type [Operator=EQ,Value=1.0470836E7,Class=java.math.BigInteger,AttributePath=caseIdentifier]Cause :BPM Enterprise uses the Rhino JavaScript engine to execute scripts. JavaScript, including Rhino, treats all numbers as double-precision floating-point numbers. Consequently, when the Parameter is set to 10470836 initially, it is treated as a double-precision floating-point number.
However, the caseIdentifier is expected to be of type
java.math.BigInteger, which is an arbitrary-precision integer type. When the floating-point number 10470836 is directly passed as a query parameter, it gets automatically converted to its scientific notation (1.0470836E7), which is a common way to represent large floating-point numbers in scientific and engineering contexts.
JavaScript can accurately represent numbers up to seven digits, as it utilizes double-precision floating-point:
e.g.
9999999 will be represented as 9999999.0 and
10000000 will be represented as 1.0E7