本文主要是介绍Variables of type ByteArray cannot be used to query,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题描述
Activiti使用processVariableValueLessThanOrEqual()方法根据变量查询报错,报错信息如下
org.activiti.engine.ActivitiIllegalArgumentException: Variables of type ByteArray cannot be used to queryat org.activiti.engine.impl.QueryVariableValue.initialize(QueryVariableValue.java:52)at org.activiti.engine.impl.TaskQueryImpl.ensureVariablesInitialized(TaskQueryImpl.java:1141)at org.activiti.engine.impl.TaskQueryImpl.executeCount(TaskQueryImpl.java:1282)at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:170)at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)at org.activiti.engine.impl.AbstractQuery.count(AbstractQuery.java:157)
原因分析:
Activiti 不支持使用 ByteArray 类型的变量进行查询。
解决方案:
提示:查询的变量是ByteArray 类型的,Activiti 就会抛出这个错误。检查代码,确保查询的变量不是使用的 ByteArray 类型。如果一定要查询这个变量,可以把将 ByteArray 转换为 Activiti 支持查询的其他类型,然后再进行查询
这篇关于Variables of type ByteArray cannot be used to query的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!