JBoss Community

Re: From where taskClient.getTasksAssignedAsPotentialOwner(user, "en-UK", taskSummaryHandler); picks up the tasks

created by Rajan Bansal in jBPM - View the full discussion

Actually I start the "HumanTaskService" with my own in JBoss using the below code:-

 

        EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");

        TaskService taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());

        TaskServiceSession taskSession = taskService.createSession();

       

         Map vars = new HashMap();

        Reader reader = new InputStreamReader( StartTaskService.class.getResourceAsStream( "LoadUsers.mvel" ) );    

        Map<String, User> users = ( Map<String, User> ) eval( reader, vars );  

        for ( User user : users.values() ) {

            taskSession.addUser( user );

        }          

       

        reader = new InputStreamReader( StartTaskService.class.getResourceAsStream( "LoadGroups.mvel" ) );     

        Map<String, Group> groups = ( Map<String, Group> ) eval( reader, vars );    

        for ( Group group : groups.values() ) {

            taskSession.addGroup(group);

        }

     

        MinaTaskServer server = new MinaTaskServer(taskService);

        Thread thread = new Thread(server);

        thread.start();

        taskSession.dispose();

        System.out.println("Task service started correctly !");

        System.out.println("Task service running ...YAHOOO..");

 

and I make the changes in jbpm-human-task-5.1.0.Final.jar's Persistence.xml, so it now points to my db.

And with this all the task related imformation is stored in my db and I can see it properly.

 

But the only thing is: if a "Process" having "3UserTasks" then on starting the Process, the db can contain only the imformation about the "first pending" but not others 2.

 

But as soon as I complete the first task then its status changes to pending and then "second pending user" shows in my db.

 

So please tell me how I store "session db" to my own db.

Reply to this message by going to Community

Start a new discussion in jBPM at Community