0 Replies Latest reply on Feb 15, 2010 9:18 AM by ciccio ciccio

    EL with arrays using Functions

    ciccio ciccio Newbie
      Hi guys,

      i have a node <decision>: i want to evaluate the size of my arraylist "output"

       

      <decision g="107,428,48,48" name="evaluate Complex">
           <transition g="-36,-18" name="to   end" to="end">
                <condition expr="#{output !=null &amp;&amp;  fn:length(output) == 1 &amp;&amp;  output[0] != null }"/>
           </transition>
              <transition g="6,-17" name="to initGlobal" to="initGlobal"/>
      </decision>
      

       

      the head of my process.jpdl.xml is

      <process name="example" xmlns="http://jbpm.org/4.3/jpdl" xmlns:fn="http://java.sun.com/jsp/jstl/functions">
      
       
      

       

      I explained xmlns:fn="http://java.sun.com/jsp/jstl/functions" to use function because calling directly, in EL expression,  #{output.size} and #{output.length} the result was an Exception.

       

      The exception is:

      org.jboss.resteasy.spi.UnhandledException: org.jbpm.api.JbpmException: script evaluation error: javax.el.ELException: Could not resolve function 'fn:length'
           org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
           org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
           org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
           org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
           org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
           org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
           org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
           org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
           org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      
      root cause
      org.jbpm.api.JbpmException: script evaluation error: javax.el.ELException: Could not resolve function 'fn:length'
           org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:130)
           org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:118)
      

       

       

      Any suggestions?

      Thanks in advance.