<?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: JUEL Exception evaluating variables with punctuation in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/juel-exception-evaluating-variables-with-punctuation/m-p/235635#M188765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A SOLUTION!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So although the exception is showing AstBinary, the real culprit is the original suspect: the bean resolver (to be fair, this is well documented in the User Guide under Expressions)…so…for anyone encountering this problem, here's the way I solved it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added a bean id to my socflow.cfg.xml, that points to a simple bean resolver class, passing the DelegateExecution and the key.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the sequenceFlow xml looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="sid-DF4F1F47-4C84-45BE-BF9F-C297DFDC88D3" name="approved" sourceRef="sid-6C005338-CA27-4D4E-B969-BA2410284FFE" targetRef="doapproved"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${global.resolve('global.response', execution) == 'approve'}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sequenceFlow&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My bean id looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;bean id="global" class="package.where.your.resolover.lives.NamespaceResolver" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And my bean looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;package package.where.your.resolover.lives;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import java.io.*;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.activiti.engine.delegate.*;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public class NamespaceResolver implements Serializable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public CNamespaceResolver() {}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; public Object resolve(String key, DelegateExecution execution)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; /*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; This will return an Object. When comparing in UEL, you'll need to know it's a String - see the single-quotes 'approve'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return execution.getVariable(key); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doing it this way allows JUEL to stay happy and evaluate 'string' values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Peter&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Sep 2016 23:47:36 GMT</pubDate>
    <dc:creator>midiman</dc:creator>
    <dc:date>2016-09-23T23:47:36Z</dc:date>
    <item>
      <title>JUEL Exception evaluating variables with punctuation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/juel-exception-evaluating-variables-with-punctuation/m-p/235634#M188764</link>
      <description>Hi,I've encountered an issue when setting a juel conditionExpression that contains a period '.'My sequence flow looks like this: [extract from the model]&amp;lt;sequenceFlow id="sid-DF4F1F47-4C84-45BE-BF9F-C297DFDC88D3" name="approved" sourceRef="sid-6C005338-CA27-4D4E-B969-BA2410284FFE" targetRef="doap</description>
      <pubDate>Fri, 23 Sep 2016 23:01:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/juel-exception-evaluating-variables-with-punctuation/m-p/235634#M188764</guid>
      <dc:creator>midiman</dc:creator>
      <dc:date>2016-09-23T23:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: JUEL Exception evaluating variables with punctuation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/juel-exception-evaluating-variables-with-punctuation/m-p/235635#M188765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A SOLUTION!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So although the exception is showing AstBinary, the real culprit is the original suspect: the bean resolver (to be fair, this is well documented in the User Guide under Expressions)…so…for anyone encountering this problem, here's the way I solved it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added a bean id to my socflow.cfg.xml, that points to a simple bean resolver class, passing the DelegateExecution and the key.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the sequenceFlow xml looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="sid-DF4F1F47-4C84-45BE-BF9F-C297DFDC88D3" name="approved" sourceRef="sid-6C005338-CA27-4D4E-B969-BA2410284FFE" targetRef="doapproved"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${global.resolve('global.response', execution) == 'approve'}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sequenceFlow&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My bean id looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;bean id="global" class="package.where.your.resolover.lives.NamespaceResolver" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And my bean looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;package package.where.your.resolover.lives;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import java.io.*;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.activiti.engine.delegate.*;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public class NamespaceResolver implements Serializable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public CNamespaceResolver() {}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; public Object resolve(String key, DelegateExecution execution)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; /*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; This will return an Object. When comparing in UEL, you'll need to know it's a String - see the single-quotes 'approve'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return execution.getVariable(key); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doing it this way allows JUEL to stay happy and evaluate 'string' values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Peter&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 23:47:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/juel-exception-evaluating-variables-with-punctuation/m-p/235635#M188765</guid>
      <dc:creator>midiman</dc:creator>
      <dc:date>2016-09-23T23:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: JUEL Exception evaluating variables with punctuation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/juel-exception-evaluating-variables-with-punctuation/m-p/235636#M188766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Peter!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use execution.getVariable("global.response") in JUEL expression, there's no need to derive new bean in this case .&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 11:34:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/juel-exception-evaluating-variables-with-punctuation/m-p/235636#M188766</guid>
      <dc:creator>warper</dc:creator>
      <dc:date>2016-09-26T11:34:51Z</dc:date>
    </item>
  </channel>
</rss>

