Activiti5 learning materials-query API query method 1. Version: activiti5.12Query API: There are two query methods: full and secure query through API, and addition of your own query through SQL statements. Method 1: Query the Code through the Query API: [java] List <Task> tasks = taskService. createTaskQuery (). taskAssignee ("kermit "). processVariableValueEquals ("orderId", "0815 "). orderByDueDate (). asc (). list (); Method 2: Query code using SQL statements: [java] List <Task> tasks = taskService. createNativeTaskQuery (). SQL ("SELECT count (*) FROM" + managementService. getTableName (Task. class) + "t where t. NAME _ = # {taskName }"). parameter ("taskName", "gonzoTas K "). list (); long count = taskService. createNativeTaskQuery (). SQL ("SELECT count (*) FROM" + managementService. getTableName (Task. class) + "T1," + managementService. getTableName (VariableInstanceEntity. class) + "V1 WHERE V1.TASK _ ID _ = T1.ID _"). count (); Remarks: Process instances, tasks, and Execution can all be queried using the original SQL statements.