cancel
Showing results for 
Search instead for 
Did you mean: 

query error

r3dge
Champ in-the-making
Champ in-the-making
Hello,

I'm trying to perform a query with the Activiti 5.17 API. I don't understand why the "includeProcessVariable" change the number of result : the same query with "includeProcessVariables" does not retrieve the same number of results.

Here is the JUnit test case :


public void test() {
      ProcessEngineConfiguration pec = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
      ProcessEngine pe = pec.buildProcessEngine();
      TaskService taskService = pe.getTaskService();
      
      assertEquals(
            taskService.createTaskQuery().includeProcessVariables().active().list().size()
            ,
            taskService.createTaskQuery().active().list().size());
   }


Is there a problem ?

Regards,
8 REPLIES 8

martin_grofcik
Confirmed Champ
Confirmed Champ
That's strange.
Can you share the whole jUnit test?

Regards
Martin

r3dge
Champ in-the-making
Champ in-the-making
Here is the whole JUnit test :

<code>
package tests;

import static org.junit.Assert.assertEquals;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.TaskService;
import org.junit.Test;

public class TestQuery {

@Test
public void test() {
  ProcessEngineConfiguration pec = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
  ProcessEngine pe = pec.buildProcessEngine();
  TaskService taskService = pe.getTaskService();
 
  assertEquals(
    taskService.createTaskQuery().includeProcessVariables().active().list().size()
    ,
    taskService.createTaskQuery().active().list().size());
 
}

}
</code>

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

works fine
https://github.com/martin-grofcik/activiti-unit-test-template/tree/forum/query_error

Create failing jUnit test. (it can depend on the engine configuration too)

Regards
Martin

r3dge
Champ in-the-making
Champ in-the-making
Thank you for your answer.

Wich configuration parameter could be involved ?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

try to reproduce the issue in the jUnit test
https://github.com/martin-grofcik/activiti-unit-test-template/tree/forum/query_error

and create a pull request.

Regards
Martin

r3dge
Champ in-the-making
Champ in-the-making
The pull request is created.

Please let me know if i have to upgrade to 5.21.

r3dge
Champ in-the-making
Champ in-the-making
I tried the jUnit with version 5.18 and it works.

This issue seems to occur only with version 5.17.

martin_grofcik
Confirmed Champ
Confirmed Champ
I do not see any pull request.
For me query test works fine with 5.17.0 too.

Regards
Martin