AnsweredAssumed Answered

start process Exception.

Question asked by evan on Feb 15, 2011
Latest reply on Feb 18, 2011 by mproch
Hi All ,

    When I start a process . Server throw exception : 01150000 Wrapped Exception (with status template): org.activiti.engine.impl.el.Expression.getValue(Lorg/activiti/engine/delegate/DelegateExecution;)Ljava/lang/Object;

I can't understand where is wrong , my code is:


<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
   typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath"
   targetNamespace="http://www.activiti.org/test">
   
   <process id="TREX-OPTIONS2" name="TREX-OPTIONS2">
      
       <extensionElements>
               <activiti:executionListener class="org.test.Setvalue" event="start">
              <activiti:field name="x" stringValue="Yes, I am " />
              <activiti:field name="y" expression="No , I am not" />
              </activiti:executionListener>
          </extensionElements>

      <startEvent id="theStart" />
      <sequenceFlow id="flow0" sourceRef="theStart" targetRef="STRO_OPTIONS_START" />
      <userTask id="STRO_OPTIONS_START" name="STRO_OPTIONS_START" activiti:formKey="approve.form">
         <extensionElements>
             <activiti:taskListener event="create" class="org.test.Start" />
          </extensionElements>
      </userTask>
      <sequenceFlow id="log1" sourceRef="STRO_OPTIONS_START" targetRef="exclusiveGw1" />
      <exclusiveGateway id="exclusiveGw1" name="exclusiveGw1" />
      <sequenceFlow id="pass1" sourceRef="exclusiveGw1" targetRef="OKIT_KIT_VERIFY">
         <conditionExpression xsi:type="tFormalExpression">${vacationApproved}
         </conditionExpression>
      </sequenceFlow>
      <sequenceFlow id="fail1" sourceRef="exclusiveGw1" targetRef="end">
         <conditionExpression xsi:type="tFormalExpression">${!vacationApproved}
         </conditionExpression>
      </sequenceFlow>

      <userTask id="OKIT_KIT_VERIFY" name="OKIT_KIT_VERIFY"
         activiti:formKey="approve.form">
         <documentation>
            Request by ${employeeName}
            </documentation>
         <extensionElements>
             <activiti:taskListener event="create" class="org.test.TestAssign" />
         </extensionElements>
      </userTask>

      <sequenceFlow id="log2" sourceRef="OKIT_KIT_VERIFY" targetRef="exclusiveGw2" />
      <exclusiveGateway id="exclusiveGw2" name="exclusiveGw2" />
      <sequenceFlow id="pass2" sourceRef="exclusiveGw2" targetRef="PCK_OPTIONS_PACK1">
         <conditionExpression xsi:type="tFormalExpression">${vacationApproved}
         </conditionExpression>
      </sequenceFlow>
      <sequenceFlow id="fail2" sourceRef="exclusiveGw2" targetRef="end">
         <conditionExpression xsi:type="tFormalExpression">${!vacationApproved}
         </conditionExpression>
      </sequenceFlow>

      <userTask id="PCK_OPTIONS_PACK1" name="PCK_OPTIONS_PACK1" activiti:formKey="approve.form">
         <documentation>
            Request by ${employeeName}
            </documentation>
         <extensionElements>
             <activiti:taskListener event="create" class="org.test.TestAssign" />
           </extensionElements>
      </userTask>

      <sequenceFlow id="log3" sourceRef="PCK_OPTIONS_PACK1" targetRef="exclusiveGw3" />
      <exclusiveGateway id="exclusiveGw3" name="exclusiveGw3" />
      <sequenceFlow id="pass3" sourceRef="exclusiveGw3" targetRef="OINS_OPTIONS_INSPECT">
         <conditionExpression xsi:type="tFormalExpression">${vacationApproved}
         </conditionExpression>
      </sequenceFlow>
      <sequenceFlow id="fail3" sourceRef="exclusiveGw3" targetRef="end">
         <conditionExpression xsi:type="tFormalExpression">${!vacationApproved}
         </conditionExpression>
      </sequenceFlow>

      <userTask id="OINS_OPTIONS_INSPECT" name="OINS_OPTIONS_INSPECT" activiti:formKey="approve.form">
         <documentation>
            Request by ${employeeName}
            </documentation>
         <extensionElements>
             <activiti:taskListener event="create" class="org.test.TestAssign" />
           </extensionElements>
      </userTask>

      <sequenceFlow id="log4" sourceRef="OINS_OPTIONS_INSPECT" targetRef="exclusiveGw4" />
      <exclusiveGateway id="exclusiveGw4" name="exclusiveGw4" />
      <sequenceFlow id="pass4" sourceRef="exclusiveGw4" targetRef="PCK_OPTIONS_PACK2">
         <conditionExpression xsi:type="tFormalExpression">${vacationApproved}
         </conditionExpression>
      </sequenceFlow>
      <sequenceFlow id="fail4" sourceRef="exclusiveGw4" targetRef="end">
         <conditionExpression xsi:type="tFormalExpression">${!vacationApproved}
         </conditionExpression>
      </sequenceFlow>

      <userTask id="PCK_OPTIONS_PACK2" name="PCK_OPTIONS_PACK2" activiti:formKey="approve.form" />
      <sequenceFlow id="log5" sourceRef="PCK_OPTIONS_PACK2" targetRef="end" />

      <endEvent id="end" />
   </process>
</definitions>



java code is :

package org.test;

import org.activiti.engine.impl.el.Expression;
import org.activiti.engine.impl.pvm.delegate.ExecutionListener;
import org.activiti.engine.impl.pvm.delegate.ExecutionListenerExecution;


public class Setvalue implements ExecutionListener {

     private Expression x;

     private Expression y;

     public void notify(ExecutionListenerExecution execution) throws Exception {
       execution.setVariable("x", x.getValue(execution).toString());
       execution.setVariable("y", y.getValue(execution).toString());
       System.out.println("————————"+x.getValue(execution).toString()+"========="+y.getValue(execution).toString());
     }
}


who can help me?

thanks ,

Evan.

Outcomes