AnsweredAssumed Answered

Access to bpm:comment in javaScript WF

Question asked by chicco0386 on Jun 25, 2009
Hi,
my problem is that I can't store in a variable the value of the comment that the user can write in a task…

I want to do a text file that contains the three comments of three different task…but I can't read the bpm:comment property into the script of my WF…
CAN you help me PLEASE?

I try this,
<task-node name="UfficioA">
      <task name="wfEntePAD:UfficioA" swimlane="ufficioA"></task>
      <transition to="join1" name="Invia Risposta"></transition>
      <event type="node-leave">
         <script>
         <variable name="CommentoA" access="write"></variable>
         <expression>
               task.comments.get(0).message;
         </expression>
         </script>
      </event>
   </task-node>
but it return this error (alfresco.log):
Caused by: java.lang.NullPointerException: Null Pointer while evaluating: task.comments
   at bsh.Name.consumeNextObjectField(Unknown Source)
   at bsh.Name.toObject(Unknown Source)
   at bsh.Name.toObject(Unknown Source)
   at bsh.Name.invokeMethod(Unknown Source)
   at bsh.BSHMethodInvocation.eval(Unknown Source)
   at bsh.BSHPrimarySuffix.doSuffix(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at org.jbpm.graph.action.Script.eval(Script.java:130)
   … 75 more


In this code I want to store in a variable the content of the comment in the current task…
This code is equals for the other two task, so my idea is that when I've the three variables that contains the three differents contents build with this a text file that containt all three comments…

HELP ME PLEASE

Outcomes