O'Reilly logo

Activiti 5.x Business Process Management Beginner's Guide by Irshad Mansuri, Dr. Zakir Laliwala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – querying for user tasks

Now, let's see how we can query user tasks. Let's say we want to find the tasks available for users of the engineering group; so, we will perform the following steps:

  1. To fetch the list of tasks, we have to create a class file, ListTaskDemo, with the following code:
    public class ListTaskDemo { public static void main(String ar[]) { ProcessEngine processEngine = ProcessEngineConfiguration .createStandaloneProcessEngineConfiguration() .setJdbcDriver("com.mysql.jdbc.Driver") .setJdbcUrl("jdbc:mysql://localhost:3306/activiti_book") .setJdbcPassword("root").setJdbcUsername("root") .buildProcessEngine(); TaskService taskService = processEngine.getTaskService(); List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup("engineering").list(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required