-
1. Re: Get tasks by a user's group
kukeltje Mar 24, 2009 6:55 PM (in response to dnowak)the findPooledTaskInstances both work for me...
So please provide a unittest with everything embedded that demonstrates the problem. -
2. Re: Get tasks by a user's group
dnowak Mar 25, 2009 4:34 AM (in response to dnowak)Thanks for your reply.
Just to make sure:
You provide an ActorID with the TaskMgmtSession.findPooledTaskInstances method and receive the tasks which are assigned to the group the actorID belongs to? -
3. Re: Get tasks by a user's group
kukeltje Mar 25, 2009 8:00 AM (in response to dnowak)No, the core engine does *not* resolve group id's to individual id's since many companies use their own IDM solution
You have to do that yourself in advance and provide the names of the groups then. -
4. Re: Get tasks by a user's group
dnowak Mar 25, 2009 8:11 AM (in response to dnowak)Thanks, I've managed to get the groups and users from the jbpm identity library:
Session session = JbpmContext.getCurrentJbpmContext().getSession(); IdentitySession identitySession = new IdentitySession(session); for (int j = 0; j < identitySession.getUsers().size(); j++) { User jbpmUser = identitySession.getUsers().get(j); List actorsList = new ArrayList(); Iterator i = jbpmUser.getMemberships().iterator(); while (i.hasNext()) { Membership m = (Membership) i.next(); actorsList.add(m.getGroup().getName()); } List pooledTaskInstances = jbpmContext.getTaskMgmtSession().findPooledTaskInstances(actorsList);
Unfortunately, I get a ClassCastException while calling the findPooledTaskInstances method:11:15:51,833 ERROR [jsp] java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken at org.hibernate.hql.ast.HqlLexer.makeToken(HqlLexer.java:39) at org.hibernate.hql.antlr.HqlBaseLexer.mIDENT(HqlBaseLexer.java:580) at org.hibernate.hql.antlr.HqlBaseLexer.nextToken(HqlBaseLexer.java:264) at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:139) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:248) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1113) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.jbpm.db.TaskMgmtSession.findPooledTaskInstances(TaskMgmtSession.java:133) at com.empolis.processus.jbpm.eval.tasks.TaskProviderJbpmImpl.getAllTasksForUser(TaskProviderJbpmImpl.java:92) at com.empolis.processus.portlet.tasks.TaskListBean.updateTableModel(TaskListBean.java:143) at com.empolis.processus.portlet.tasks.TaskListBean.refreshTaskInstancesTable(TaskListBean.java:134) at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146) at javax.faces.component.UICommand.broadcast(UICommand.java:325) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
Anyone got a hint? -
5. Re: Get tasks by a user's group
kukeltje Mar 25, 2009 11:57 AM (in response to dnowak)have you searched using google? and is this the full stacktrace?
-
6. Re: Get tasks by a user's group
dnowak Mar 25, 2009 12:15 PM (in response to dnowak)Yes and no. The rest of the stacktrace are just follow-ups though...
I have the feeling, that this is a classpath problem - but the libs are fine as far as I can tell.
I really have NO idea - anyone has a hint? -
7. Re: Get tasks by a user's group
dnowak Mar 25, 2009 6:28 PM (in response to dnowak)OK it is getting strange (for me).
I've set up a simple, new jBPM Project in Eclipse. Also, I've defined and deployed a simple Process, which calls some Java Method using an event.
This method basically does exactly what my application should - and it works!
The strange thing is, that I do NOT get the error in my application after the test-process ran. If I fire up my JBoss and try my application -> still error.
So I suppose I've got some hibernate or context problem.
Does that ring any bell? I suppose it must be a stupid error - but I am unable to find it and will go home after over 14 hours of work now :(
Best,
D. -
8. Re: Get tasks by a user's group
kukeltje Mar 26, 2009 5:36 AM (in response to dnowak)There are some things mentioned on the net regarding this classcast issue. And yes it is related to the classpath or even the appserver. In that way it 'rang' a bell, but nothing more. Look at the articles you can find with google and see if there is something in there.
-
9. Re: Get tasks by a user's group
dnowak Mar 26, 2009 6:22 AM (in response to dnowak)Believe me - I did. I will stick to it, but if anyone has any idea where to look at, I'd really appreciate it.
Best,
Damian -
10. Re: Get tasks by a user's group
kukeltje Mar 26, 2009 11:25 AM (in response to dnowak)so you are saying that none of the articles you found gave any hint to a possible solution?
- It is not classloader isolation (or lack thereof, UCL)
- it is not a classpath 'conflict' somewhere
- it is not an issue that you run on an appserver whith limited support for hibernate 3 (Weblogic)
- you are running a recent version of JBoss AS (what are you running?)
- you are running a recent jdk (1.5 / 1.6) (what are you running?)
Then I have *no* idea... maybe the hibernate forum can help out.