[jboss-user] [JBoss jBPM] - Re: question regarding some 'dates' in task instance

memius do-not-reply at jboss.com
Wed Aug 27 07:17:09 EDT 2008


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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172781#4172781

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172781



More information about the jboss-user mailing list