-
1. Re: From where taskClient.getTasksAssignedAsPotentialOwner(user, "en-UK", taskSummaryHandler); picks up the tasks
salaboy21 Sep 23, 2011 10:23 AM (in response to rajan01)For retrieving the human task information you are using the Human Task services that is running here:
taskClient.connect("127.0.0.1", 9123);
That service has its own database decoupled from the session database to store the information about the human tasks. When you connect to that server and call the getTasks... or start.. it go to that database and niteracts with the information there.
Cheers
-
2. Re: From where taskClient.getTasksAssignedAsPotentialOwner(user, "en-UK", taskSummaryHandler); picks up the tasks
rajan01 Sep 23, 2011 10:40 AM (in response to salaboy21)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 "complete" and then "second pending user" shows in my db.
So please tell me how I store "session db" to my own db.
-
3. Re: From where taskClient.getTasksAssignedAsPotentialOwner(user, "en-UK", taskSummaryHandler); picks up the tasks
salaboy21 Sep 23, 2011 10:41 AM (in response to rajan01)you can have two different persistence units.. one for the JPAKnoledgeService and the other to the minaTask Server in this case. That will allow you to configure different databases for the sessions and for the tasks.
Cheers
-
4. Re: From where taskClient.getTasksAssignedAsPotentialOwner(user, "en-UK", taskSummaryHandler); picks up the tasks
rajan01 Sep 23, 2011 10:47 AM (in response to salaboy21)In the first reply you told that :
That(HumanTask) service has its own database decoupled from the session database to store the information about the human tasks.
Is it possible to re-direct service db to my own db?
if yes, then HOW???
Regards.
-
5. Re: From where taskClient.getTasksAssignedAsPotentialOwner(user, "en-UK", taskSummaryHandler); picks up the tasks
salaboy21 Sep 23, 2011 10:51 AM (in response to rajan01)I've already explained how:
"you can have two different persistence units.. one for the JPAKnoledgeService and the other to the minaTask Server in this case. That will allow you to configure different databases for the sessions and for the tasks."
Probably right now you have a single persistence unit that includes the SessionInfo and ProcessInstanceInfo entities plus all the Task Related entities. You can basically create to different persistence units and configure different databases for each of them. All that configuration is related with JPA and HIbernate, it is not really dependant on jBPM5.
Cheers
-
6. Re: From where taskClient.getTasksAssignedAsPotentialOwner(user, "en-UK", taskSummaryHandler); picks up the tasks
rajan01 Sep 23, 2011 11:01 AM (in response to salaboy21)Thanks.
I ll try with it and revert back if any problem occurs.
Regards.