BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
Expand all | Collapse all

Difference in float values returned by initializeContentObject in BAW process started from Case

  • 1.  Difference in float values returned by initializeContentObject in BAW process started from Case

    Posted 11 days ago

    Hi,

    I have an issue in a BAW process started from IBM Case Manager – I've noticed that the system method initializeContentObject sometimes returns slightly different float values (a difference of about 0.02) compared to what's actually stored in the case property.

    In DB2, the value is correct. When retrieving the same property via REST API or a CMIS query, the returned values are also accurate. 

    However, when using the system method, the returned value contains four decimal places, and after rounding, the difference can be up to 0.02 compared to the original value.

    Has anyone encountered this behavior before or knows why this method might return a slightly altered float value?
    Any suggestions or explanations would be greatly appreciated.

    Thanks in advance!



    ------------------------------
    Kamil Pruszynski
    ------------------------------


  • 2.  RE: Difference in float values returned by initializeContentObject in BAW process started from Case

    Posted 3 days ago

    The behavior you're seeing happens because Float properties in Case Manager use 32-bit binary floating-point numbers, which cannot exactly represent many decimal fractions. So when initializeContentObject() reads the value, small rounding differences appear (e.g., 571,216.04 might show as 571,216.06).

    DB2, REST, and CMIS return the correct value because they use exact decimal types, bypassing the float conversion.

    For financial values, the usual workarounds are:

    • Store amounts as String to keep exact decimals.

    • Store amounts as Integer (cents) to allow calculations without rounding.

    • Use a Business Object property with decimal type (as a workaround if you are using Workflows along with solutions.)

    In short: the difference comes from how Float stores numbers, not from your database or import.
    ----------------------

    Kindly open a IBM support case for further assistance. 

    Best Regards,
    Sriram



    ------------------------------
    Sriram Bharadwaj Sampathkumar
    ------------------------------