[jboss-user] [JBoss jBPM] - How to retrieve the Task list of a user ?
francis1970
do-not-reply at jboss.com
Thu Jan 17 09:30:24 EST 2008
Hi all !
I have developed a web application which should be a front-end for a Jbpm process.
In the main Servlet I should list all Task pending for a user.
Unfortunately the task list is empty, where do I am wrong ??
This is the simple process:
<process-definition
| xmlns="urn:jbpm.org:jpdl-3.2"
| name="simple">
| <swimlane name="user">
| </swimlane>
| <start-state name="start">
| <transition name="" to="state1"></transition>
| </start-state>
| <state name="state1">
| <transition name="" to="task1"></transition>
| </state>
| <task-node name="task1">
| <task name="task1" swimlane="user"></task>
| <transition name="" to="end1"></transition>
| </task-node>
|
| <end-state name="end1"></end-state>
|
| </process-definition>
Inside the servlet I signal the process until it reaches the Task1.
Then I expect to find one pending task for user "user". But the list is empty.
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
|
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
|
| ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("processDefinition.xml");
|
| jbpmContext.deployProcessDefinition(processDefinition);
|
| ProcessInstance instance = new ProcessInstance(processDefinition);
|
|
| // Move the process instance from its start state to the state1.
| instance.signal();
|
| System.out.println("You are in state: "+instance.getRootToken().getNode().getName());
|
| // Move to Task1
| instance.signal();
|
| Vector vec = new Vector();
| vec.add("user");
|
| List list = jbpmContext.getGroupTaskList(vec);
|
| if (list != null) {
| for (int ii=0;ii<list.size();ii++){
| System.out.println(list.get(ii));
| }
| }
Unfortunaly the List is empty.
What is missing ? Have I assigned uncorrectly the task to "user" ??
or Should I istantiate the Actor class and inject the "user" as userId ?
I'm using JBoss 4.0.2 and JBPM 3.2
Thanks
Francesco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120900#4120900
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120900
More information about the jboss-user
mailing list