AnsweredAssumed Answered

QueryVariableValue error

Question asked by bwolin on May 23, 2013
Latest reply on May 27, 2013 by jbarrez
My company is doing an evaluation of Activiti with Grails and I'm getting an error trying to query tasks based on process variables.

I'm trying to get tasks associated with a specific company. I created the process and passed in a map with an integer in it for companyID.

I can see the variables for my process instance and the variable's type is shown to be java.lang.Integer, but I get an exception that my variable is of type ByteArray. Error shown below:

groovy:000> runtimeService.getVariables('28')
===> {documentID=null, companyID=51613, initiator=mwalker, personID=4132522       }
groovy:000> runtimeService.getVariables('28').companyID.class
===> class java.lang.Integer
groovy:000> taskService.createTaskQuery().processVariableValueEquals("companyID", 51613).list()
ERROR org.activiti.engine.ActivitiIllegalArgumentException:
Variables of type ByteArray cannot be used to query
        at org.activiti.engine.impl.QueryVariableValue.initialize (
        at org.activiti.engine.impl.TaskQueryImpl.ensureVariablesInitialized (
        at org.activiti.engine.impl.TaskQueryImpl.executeList (
        at org.activiti.engine.impl.AbstractQuery.execute (
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute (
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute (
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction (
        at org.activiti.spring.SpringTransactionInterceptor.execute (
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute (
        at org.activiti.engine.impl.AbstractQuery.list (
        at (groovysh_evaluate:2)

Any idea what the problem is or what I'm doing wrong?

Thanks for any help on this!