AnsweredAssumed Answered

WorkflowTaskQuery, setProcessCustomProps and DatePosition

Question asked by vincent-kali on Aug 7, 2018

Hi,
When running a workflow query using date parameters it works fine:

Map<QName, Serializable) myCustomProps = new HashMap<QName, Serializable>();
Map<DatePosition, Date> dateParams = new HashMap<DatePosition, Date>();
dateParams.put(DatePosition.BEFORE, endRange);
dateParams.put(DatePosition.AFTER, startRange);
myCustomProps.put(propQName, dateParams);
myWorkflowInstanceQuery.setCustomProps(myCustomProps);

When running a task query with same custom props parameters (myWorkflowTaskQuery.setProcessCustomProps(...)),
it fails with error below.

Would date range param (Map<DatePosition, Date>) be only supported for WorkflowInstanceQuery ??
BTW, is there any way use pagination with workflowTaskQuery ?


 2018-08-07 15:14:00,589  ERROR [extensions.webscripts.AbstractRuntime] [http-apr-8080-exec-8] Exception from executeScript: Variables of type ByteArray cannot be used to query
 org.activiti.engine.ActivitiIllegalArgumentException: Variables of type ByteArray cannot be used to query
        at org.activiti.engine.impl.QueryVariableValue.initialize(QueryVariableValue.java:52)
        at org.activiti.engine.impl.TaskQueryImpl.ensureVariablesInitialized(TaskQueryImpl.java:1138)
        at org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:1256)
        at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:164)
        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:131)
        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.list(AbstractQuery.java:138)
        at org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine.queryRuntimeTasks(ActivitiWorkflowEngine.java:1784)
        at org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine.queryTasks(ActivitiWorkflowEngine.java:1756)
        at org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine.queryTasks(ActivitiWorkflowEngine.java:1726)
        at org.alfresco.repo.workflow.WorkflowServiceImpl.queryTasks(WorkflowServiceImpl.java:955)

Thanks !

Outcomes