Search in sources :

Example 6 with TablePage

use of org.activiti.engine.management.TablePage in project Activiti by Activiti.

the class TablePageQueryTest method testGetSortedTablePage.

public void testGetSortedTablePage() {
    String tablePrefix = processEngineConfiguration.getDatabaseTablePrefix();
    List<String> taskIds = generateDummyTasks(15);
    // With an ascending sort
    TablePage tablePage = managementService.createTablePageQuery().tableName(tablePrefix + "ACT_RU_TASK").orderAsc("NAME_").listPage(1, 7);
    String[] expectedTaskNames = new String[] { "B", "C", "D", "E", "F", "G", "H" };
    verifyTaskNames(expectedTaskNames, tablePage.getRows());
    // With a descending sort
    tablePage = managementService.createTablePageQuery().tableName(tablePrefix + "ACT_RU_TASK").orderDesc("NAME_").listPage(6, 8);
    expectedTaskNames = new String[] { "I", "H", "G", "F", "E", "D", "C", "B" };
    verifyTaskNames(expectedTaskNames, tablePage.getRows());
    taskService.deleteTasks(taskIds, true);
}
Also used : TablePage(org.activiti.engine.management.TablePage)

Aggregations

TablePage (org.activiti.engine.management.TablePage)6 HashMap (java.util.HashMap)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Map (java.util.Map)2 TablePageQuery (org.activiti.engine.management.TablePageQuery)2 RowBounds (org.apache.ibatis.session.RowBounds)2 Collections.singletonMap (java.util.Collections.singletonMap)1 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)1 ActivitiObjectNotFoundException (org.activiti.engine.ActivitiObjectNotFoundException)1 DataResponse (org.activiti.rest.common.api.DataResponse)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 DataResponse (org.wso2.carbon.bpmn.rest.model.common.DataResponse)1