-
1. Re: task-node Q
enazareno Jan 5, 2006 7:33 PM (in response to fmuhlenberg)Hi fmuhlenberg,
If I remember, I think by default tasks will be created automatically in a task-node unless you specify create-tasks attribute to false. You dont need to specify it in a node-enter event. If you want blocking or signalling tasks, you need to specify blocking attribute from the task to true, and signalling to true. Again if I remember correctly, by default tasks are signalling but not blocking. A task is also automatically assigned if you specify a swimlane for it.
Regards,
Elmo -
2. Re: task-node Q
brittm Jan 6, 2006 1:13 PM (in response to fmuhlenberg)enazareno is correct. Specifically, a <task-node> has these default properties:
create-tasks="true"
signal="last" //completion of the last task also signals the default transition
And a <task'> element under the <task-node> by default has:
blocking="no"
See the user guide, sections 13.3.7 and 13.3.23 for other options and what they all mean.
With default settings, tasks defined in a <task'> element will be automatically created when the <task-node> is entered. The only reason you wouldn't want this behavior, is if you need to programatically determine which tasks need to be created based on process instance specific data; in that case, you would set create-tasks="false" and would need to create your task(s) with an action handler on the node-enter event. Remember that if you are programatically creating tasks, you'll have to be careful that your blocking boolean (and other properties) is set according to your expectations. Also, while the documentation doesn't provide for a "signaling" property on <task'> in the process definition XML, you can turn signaling on or off for individual taskInstances via the API to suit your needs when you create the tasks in your action handler.
If you create your tasks programatically and receive errors when trying to retreive them from the database, check that you have specified any appropriate object or circular references, ie:
taskInstance.setToken(yourToken);
-Britt -
3. Re: task-node Q
fmuhlenberg Jan 6, 2006 5:08 PM (in response to fmuhlenberg)I'm not having success with your suggestions.
The configuration below allows creation of tasks upon entering the NotifyApprovers
node but the node does not block and the Assignment handler is never called.
I can view the tasks by accessing the (terminated) process instance by callingProcessInstance pi pi.getTaskMgmtInstance().getTaskInstances()
<task-node name="NotifyApprovers" create-tasks="false" signal="true"> <task name="ApproveDocument" blocking="true"> <assignment class="workflow.assignment.ApproveDocumentAssignmentHandler" config-type="bean"></assignment> </task> <event type="node-enter"> <action name="CreateTasks" class="workflow.action.CreateApproverTasksAction" config-type="bean"></action> </event> <transition name="Process" to="ExecuteDocument"></transition> </task-node>
Is there something specific I need to do when creating my tasks that would
enable blocking at the task-node?
The configuration below blocks upon entering the NotifyApprovers node and
calls the Assignment handler. An ApproveDocument task is created but not
filled with any data (everything except the name is null or empty) and I
cannot access the task through the process instance. CallingProcessInstance pi pi.getTaskMgmtInstance().getTaskInstances()
generates an exception.
org.hibernate.HibernateException: null index column for collection: org.jbpm.graph.exe.ProcessInstance.instances<task-node name="NotifyApprovers"> <task name="ApproveDocument"> <assignment class="workflow.assignment.ApproveDocumentAssignmentHandler" config-type="bean"></assignment> </task> <transition name="Process" to="ExecuteDocument"></transition> </task-node>
-
4. Re: task-node Q
fmuhlenberg Jan 27, 2006 10:21 PM (in response to fmuhlenberg)I found the error of my ways.
In the action handler of node-enter, I needed to remove code that specified an exit transition (as in remove the code ectx.leaveNode() )
Now, the workflow pauses as I expect.
Now, I'm off to look at some other issues related to assignment handlers.
-fm