<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to cast  a context variable in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-cast-a-context-variable/m-p/321670#M8671</link>
    <description>&lt;P&gt;thank's alot for this explanation
Raymond&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jun 2013 01:12:27 GMT</pubDate>
    <dc:creator>raymond16_</dc:creator>
    <dc:date>2013-06-28T01:12:27Z</dc:date>
    <item>
      <title>how to cast  a context variable</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-cast-a-context-variable/m-p/321668#M8669</link>
      <description>&lt;P&gt;I create a new document Type called calcul1
with field1 type double
with field2 type double
in the scheme I create an other field named total
In the edit  form I create a button called add which sould add  field1 + field2
when total is declared as string I get the good result
When total is declared as double I get an error
the chain is :
FETCH&amp;gt;DOCUMENT
EXECUTION CONTEXT &amp;gt; SET CONTEXT VARIABLE
name=field1
value=@{Document["calcul1:champ1"]}
EXECUTION CONTEXT &amp;gt; SET CONTEXT VARIABLE
name=field2
value=@{Document["calcul1:champ2"]}
and then I declare :
DOCUMENT &amp;gt; UPDATE PROPERTY
value = @{Context["field1"]} + @{Context["field2"]}
xpath = calcul1:total&lt;/P&gt;
&lt;P&gt;i have got a good result when total is declared as a string( xxx+oooo )
but nothing when declared as a double, and I need a doubled summ in this field
thanks for help
Raymond&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2013 01:45:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-cast-a-context-variable/m-p/321668#M8669</guid>
      <dc:creator>raymond16_</dc:creator>
      <dc:date>2013-06-20T01:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to cast  a context variable</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-cast-a-context-variable/m-p/321669#M8670</link>
      <description>&lt;P&gt;There is a much simpler way to do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;FETCH&amp;gt;DOCUMENT
DOCUMENT &amp;gt; UPDATE PROPERTY 
  value = @{Document["calcul1:champ1"] + Document["calcul1:champ2"]}
  xpath = calcul1:total
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your issue comes from here:&lt;/P&gt;
&lt;P&gt;DOCUMENT &amp;gt; UPDATE PROPERTY value = @{Context["field1"]} + @{Context["field2"]} xpath = calcul1:total&lt;/P&gt;
&lt;P&gt;Value will be evaluated as a string if you have @{Context["field1"]} + @{Context["field2"]}  instead of  @{Context["field1"] + Context["field2"]}&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2013 19:19:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-cast-a-context-variable/m-p/321669#M8670</guid>
      <dc:creator>Laurent_Doguin</dc:creator>
      <dc:date>2013-06-27T19:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to cast  a context variable</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-cast-a-context-variable/m-p/321670#M8671</link>
      <description>&lt;P&gt;thank's alot for this explanation
Raymond&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2013 01:12:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-cast-a-context-variable/m-p/321670#M8671</guid>
      <dc:creator>raymond16_</dc:creator>
      <dc:date>2013-06-28T01:12:27Z</dc:date>
    </item>
  </channel>
</rss>

