> On Wednesday, July 16, 2014 10:02 AM, anshul gangwar > <anshul.mit20...@gmail.com> wrote: > > 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 > SCXML? > 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: - http://commons.apache.org/proper/commons-jexl/reference/syntax.html 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). Regards, Woonsan > > Thanks in advance. > > Regards, > Anshul > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org