This content has been marked as final.
Show 3 replies
-
1. Re: question regarding some 'dates' in task instance
kukeltje Aug 22, 2008 8:18 AM (in response to memius)-Is there a concept like 'suspend until' ? I know you can suspend a task, but can you also suspend a task till some date ?
No unless you implement some scheduling for this yourself- when the due date expires ? how can you neatly define the transitions (one transition for leaving the node in a regular way, another transition that should be taken if the due date is exceeded (expiration date ?) )
You can't, at least not declarative. You have to define both in your processdefinition and e.g. in the UI filter one out -
2. Re: question regarding some 'dates' in task instance
memius Aug 27, 2008 7:17 AM (in response to memius)At this moment, I am trying to implement 'suspend until' like this (note, I will call this method in some kind of service class, so not in an ActionHandler) :
public void suspendTaskInstanceUntil(final TaskInstance taskInstance, final String suspendUntilDate){ taskInstance.suspend(); CreateTimerAction cta = new CreateTimerAction(); cta.setName("suspendUntilTimer"); cta.setDueDate(suspendUntilDate); Action action = null; String actionName = "resume action"; Delegation delegation = new Delegation("foo.bar.ResumeAction"); // will call taskInstance.resume() delegation.setProcessDefinition(taskInstance.getProcessInstance().getProcessDefinition()); action= new Action(delegation); action.setName(actionName); cta.setTimerAction(action); try { cta.execute(ExecutionContext.currentExecutionContext()); } catch (Exception e) { throw new RuntimeException(e); // e.printStackTrace(); } jbpmContext.save(taskInstance); }
I saw sth like this (as a poc) in an actionhandler and wanted a similar behaviour (but without the action handler )
My problem is now : ExecutionContext.currentExecutionContext() returns null...
So what I am trying to do does not work
Could anyone suggest a fix / alternative / workaround for this ?
(btw : the similar resume task method, would first kill the dynamic timer (if existing) and then resume the task
Sincerely,
Dieter D'haeyere. -
3. Re: question regarding some 'dates' in task instance
memius Aug 27, 2008 7:19 AM (in response to memius)I see that I left some errors in the code :
you will find a jbpmContext (which is not declared in this piece of code), but normally I execute this code within a callback, so the jbpmContext is actually there...
I thought to remove the callback code to make things simpler