AnsweredAssumed Answered

unit testing and service task expressions

Question asked by robmckinnon on Aug 11, 2012
Latest reply on Oct 19, 2012 by frederikheremans1
Activiti: 5.9

I am having trouble with unit testing an activiti process that contains an expression.

Consider the following task:
<serviceTask id="getAlfrescoGuid" name="Get Alfresco Guid" activiti:expression="#{alfrescoGuid.execute(execution)}"></serviceTask>

I have the bean defined in my src/main/test/resources/activiti.cfg.xml  file
<bean id="alfrescoGuid" class="com.myco.activiti.pos.GetAlfrescoGuid">
      <property name="user" value="ldapuser-rex"/>
</bean>

I get the following error when running the test case:
Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'alfrescoGuid'
   at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)
   at org.activiti.engine.impl.juel.AstMethod.invoke(AstMethod.java:79)
   at org.activiti.engine.impl.juel.AstMethod.eval(AstMethod.java:75)
   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.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:33)
   at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
   at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
   at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:50)
   … 111 more

Has anybody seen this before? Am I missing something? Is it a bug with activiti? Any response would be appreciated.

Thanks

Outcomes