[JBoss Seam] - Re: Seam jBPM: use annotation or pages.xml to get next task?
by avbentem
"petemuir" wrote : Then wire it up
| <page view-id="/assignTask.xhtml" action="#{taskFinder.autoStart()}">
| | <navigation>
| | ...
| | </navigation>
| | </page>
This works great for some process definitions, but I cannot get this to work with sub-processes.
When I start some process that immediately delegates to some sub-process, then a ProcessInstance is injected, but TaskMgmtInstance#getTaskInstances() returns zero elements in the getSingleTaskInstance I posted earlier:
@In ProcessInstance processInstance;
|
| public TaskInstance getSingleTaskInstance() {
| // BEWARE: THIS IS WRONG. This returns all the taskInstances
| // for the process instance, which includes task instances
| // that have already been completed previously.
| Collection<TaskInstance> taskInstances =
| processInstance.getTaskMgmtInstance().getTaskInstances();
|
| if (taskInstances.size() != 1) {
| log.error("Expected single task, found #0", taskInstances.size());
| return null;
| }
| return taskInstances.iterator().next();
| }
So I guess jBPM simply has not created the sub-process yet. Debugging shows that the process instance is indeed the parent process instance at that point.
As for the warning in the code above: I guess I should use getUnfinishedTasks(Token), or discard the finished tasks that getTaskInstances() returns.
Arjan.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033174#4033174
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033174
17Â years, 9Â months
[JBoss jBPM] - How to assign multiple actors to a task
by alasiraj
Hi All,
I am newbie to jbpm and use jbpm 3.1.2 version.
This is my requirement: I want to assign a task to multiple actors so that any of assinged actor can perform the task. In the following example, when process reaches 'test' task, i want to assing this task to two users.
This is my sample prcessdefinition.xml
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.1" name="ORPG_Dummy">
| <start-state name="start">
| <transition name="t1" to="Test"></transition>
| </start-state>
| <task-node name="Test">
| <task name="task1">
| <assignment class="com.sample.action.MyAssignHandlerAction" config-type="bean"></assignment>
| </task>
| <transition name="t2" to="end1"></transition>
| </task-node>
| <end-state name="end1"></end-state>
| </process-definition>
|
And this is my assign handler class
|
| public class MyAssignHandlerAction implements AssignmentHandler {
|
| private static final long serialVersionUID = 1L;
|
| public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
|
| String[] pooledActors = new String[] {"user1", "user2"};
| assignable.setPooledActors(pooledActors);
| }
|
|
| }
|
When i deploy and test above sample, the task is not assinged to given actors and am I doing wrong or missing some thing else here?
I appriciate your answer.
Regards,
Siraj
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033173#4033173
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033173
17Â years, 9Â months