[jboss-user] [JBoss jBPM] - Re: Creating a timer doesn't save to the database

brado do-not-reply at jboss.com
Tue Aug 1 11:57:51 EDT 2006


Ugh...laptop gone wild. Sorry about the ugly post above. Accidental hit of the return key before I formatted the code. Anyway, here it is in readable form:


  | public void execute(ExecutionContext executionContext) throws Exception {
  |   log.debug("[execute]: Enter.");
  | 
  |   try {
  |     log.debug("[execute]: Getting context variables.");
  |     String transactionId = (String) executionContext.getVariable(NetworkNode.PVAR_transactionId);
  | 
  |     log.debug("[execute]: Creating solicit timer: " + executionContext.getTaskInstance());
  |     Timer timer = new Timer(executionContext.getToken());
  |     timer.setName("Solicit: " + transactionId);
  |     BusinessCalendar businessCalendar = new BusinessCalendar();
  |     Date dueDate = businessCalendar.findStartOfNextDay(new Date());
  |     timer.setDueDate(dueDate);
  |     timer.setTransitionName("solicitQuery");
  |     timer.setGraphElement(executionContext.getEventSource());
  |     timer.setTaskInstance(executionContext.getTaskInstance());
  |     SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER);
  |     schedulerService.createTimer(timer);
  |     log.info("[execute]: Solicit timer created: " + timer);
  |   } catch (Exception ex) {
  |     if (ex instanceof NodeException) {
  |       throw ex;
  |     }
  |     log.error("[execute]: Error creating solicit timer: " + ex.getMessage());
  |     throw new NodeException("Error creating solicit timer: " + ex.getMessage(),
  |     ex, IErrorCode.Code.E_UNKNOWN_ERROR);
  |   } finally {
  |     executionContext.leaveNode();
  |     log.debug("[execute]: Exit.");
  |   }
  | } 
  | 

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

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



More information about the jboss-user mailing list