commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Woonsan Ko <>
Subject Re: [SCXML] mapping of data types used to store values of datamodel with the java datatypes
Date Sat, 19 Jul 2014 23:06:22 GMT

> On Wednesday, July 16, 2014 10:02 AM, anshul gangwar <>
> > Hi,
> I have one query regarding datatypes used to store values of SCXM datamodel.
> Suppose there is a string A = "1234567891". This variable is sent in
> payload when event is fired and is assigned in the SCXML datamodel through
> <assign> tag.

Is it like <assign ... expr="'1234567891'" /> or <assign ... expr="1234567891" />?
The former is handed as a string, but the latter is handled as a number.

> Now when I am fetching this variable A in invoker class, its value is in
> exponential form. So, in order to get the actual value I have perform below
> steps:
>                 double d =
> Double.parseDouble(String.valueOf(lastParams.get("A")));
>                 String deviceId = BigDecimal.valueOf(d).toPlainString();

If it was passed as string, then you could use new BigDecimal(lastParams.get("A")).
But, I guess you got a numeric object from lastParams.get("A") instead.

> If the value of A does not reach to specific range then it simply convert
> it into float instead of converting it in exponential form.
> I would like to know how commons SCXML datatypes are mapped with the java
> datatypes? Is this the right way of doing converting Integer values from
> Which document can I refer for such details?

Expressions are evaluated by an Evaluator. If you're using JexlEvaluator, then you can refer
to this:

I think you can treat it as a string with single quotes or as a number with a suffix (e.g,
1234567891B or 1234567891.0H).



> Thanks in advance.
> Regards,
> Anshul

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message