AnsweredAssumed Answered

Exception starting process instance

Question asked by gant on Jul 22, 2011
Latest reply on Jul 25, 2011 by gant
Hi,

I try to start a process instance:

HashMap<String,Object> variables = new HashMap<String,Object>(); 
      variables.put("payload", req);
      
      runtimeService.startProcessInstanceByKey("requestProcess", variables);

and get the following exception:
Caused by: java.lang.IllegalArgumentException: Cannot parse list index: requestState
        at org.activiti.engine.impl.javax.el.ListELResolver.toIndex(ListELResolver.java:307)
        at org.activiti.engine.impl.javax.el.ListELResolver.getValue(ListELResolver.java:159)
        at org.activiti.engine.impl.javax.el.CompositeELResolver.getValue(CompositeELResolver.java:231)
        at org.activiti.engine.impl.juel.AstProperty.eval(AstProperty.java:61)
        at org.activiti.engine.impl.juel.AstBinary$SimpleOperator.eval(AstBinary.java:27)
        at org.activiti.engine.impl.juel.AstBinary.eval(AstBinary.java:106)
        at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50)
        at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26)
        at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)
        at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:46)
        at org.activiti.engine.impl.el.UelExpressionCondition.evaluate(UelExpressionCondition.java:37)
        at org.activiti.engine.impl.bpmn.behavior.ExclusiveGatewayActivityBehavior.leave(ExclusiveGatewayActivityBehavior.java:63)
        at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:48)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:44)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:61)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:111)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.runtime.ExecutionEntity.take(ExecutionEntity.java:341)
        at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:92)
        at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:49)
        at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44)
        at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnActivityBehavior.java:37)
        at org.activiti.engine.impl.bpmn.behavior.BusinessRuleTaskActivityBehavior.execute(BusinessRuleTaskActivityBehavior.java:90)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:48)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:44)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:61)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:111)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.runtime.ExecutionEntity.take(ExecutionEntity.java:341)
        at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:92)
        at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:49)
        at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44)
        at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:44)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:44)
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:63)
        at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:496)
        at org.activiti.engine.impl.runtime.ExecutionEntity.start(ExecutionEntity.java:289)
        at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:66)
        at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:29)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:49)
        at ch.itartis.engine.ui.CreateRequestBean.sendRequest(CreateRequestBean.java:21)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.el.parser.AstValue.invoke(AstValue.java:191)
        at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
        at org.apache.myfaces.view.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:83)
        … 23 more

If I understand this correctly, it's because 'requestState' should be converted to a Integer and used as a list index. But there is no list at all in my 'req' object that contains the 'requestState'-property:

public class Request implements Serializable {
   
   private static final long serialVersionUID = 1L;

   private String requestTitle;
   
   private Date requestDate;
   private int   requestAmount;
   private String requestState;
   private String requestorEmail;

// getters & setters
}

The requestState-property is used in an expression at this place in my process-model:
 <sequenceFlow id="flow3" name="" sourceRef="exclusivegateway1" targetRef="usertask2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${payload.requestState != "approved"}]]></conditionExpression>
    </sequenceFlow>

What am I doing wrong?

regards,
michael

Outcomes