The websale example does exactly this in one of its nodes:
<task-node name="evaluate web order"> <task swimlane="salesman"> <timer duedate="20 seconds" repeat="10 seconds"> <action class="org.jbpm.websale.RemindActor"> <swimlaneName>salesman</swimlaneName> </action> </timer> <controller> <variable name="item" access="read"/> <variable name="quantity" access="read"/> <variable name="address" access="read"/> <variable name="comment"/> </controller> </task> <transition name="ok" to="salefork" /> <transition name="more info needed" to="fix web order data" /> </task-node>
The code for RemindActor is also there.
Thanks, but I do NOT want to use the timer functionality, I want to use the duedate on the task as I had in my example.
That will set the due date in jbpm_taskinstance, but I cannot find any documentation how that due date is used.
I would expect that some kind of event is thrown, but I cannot find any information about it.
Sorry, I missed that in your first post.
I am curious (I'm a beginner) as to why a timer wouldn't work for you.
I want to be able to extract the information for each task, when it was created/started/when it is due
(to be able to show this information in a todo list for the user and as overall information for managers, e.g. highlight all tasks where the due date is overdue etc)
In the jbpm_taskinstance I have all this info, which would mean that I wouldnt have to lookup the timers (which I think will be a pain, if I am wrong, please provide any pointers how it could be done).
Unfortunately I cannot find a single example that actually uses the due date in a taskinstance.
Is this duedate deprecated? I would be thankful for any information.
isn't there anything in the testcases?
You specify the due date in the process definition as a duration (e.g., "2 hours"), and when the task instance is created it converts it to the actual date/time. You can use TaskInstance.getDueDate() to retrieve the calculated date.
The following event types are supported by jBPM:
There is no task-due event. Unlike the events above, firing a task-due event would require interaction with the scheduler. Some time ago I wrote a quick and dirty patch to support a task-due event, but did not integrate it into the main jBPM codebase because there are other ways to get the same effect (e.g. a timer on the task). In fact, my solution sets up a timer internally.
"cwad0000", would that do the job for you? If so, please file a feature request in our issue tracking system and assign it to me.
That's exactly what I am doing.
I am inserting the due date (duration) in the process definition as BOTH the task instance due date AND the expriration time on a timer on the task. The absolute due date (i.e., a real date) shows in the UI and my task fires when the due date expires.
ah, thanks folks for clearing it up.
The trick with adding both a timer and due date seems to serve the purpose fine for me, many thanks for that.