Package org.jbpm.job

Examples of org.jbpm.job.Timer


      query.setParameter("token", token);
      List results = query.list();
      if (results!=null) {
        Iterator iter = results.iterator();
        while (iter.hasNext()) {
          Timer timer = (Timer) iter.next();
          log.debug("deleting timer "+timer+" by name "+name);
          session.delete(timer);
        }
      }
View Full Code Here


    }
    transitionName = actionElement.attributeValue("transition");
  }

  public void execute(ExecutionContext executionContext) throws Exception {
    Timer timer = createTimer(executionContext);
    SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER);
    schedulerService.createTimer(timer);
  }
View Full Code Here

    SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER);
    schedulerService.createTimer(timer);
  }

  protected Timer createTimer(ExecutionContext executionContext) {
    Timer timer = new Timer(executionContext.getToken());
    timer.setName(timerName);
    timer.setRepeat(repeat);
    if (dueDate!=null) {
      Duration duration = new Duration(dueDate);
      Date dueDateDate = businessCalendar.add( new Date(), duration );
      timer.setDueDate(dueDateDate);
    }
    timer.setAction(timerAction);
    timer.setTransitionName(transitionName);
    timer.setGraphElement(executionContext.getEventSource());
    timer.setTaskInstance(executionContext.getTaskInstance());
   
    // if this action was executed for a graph element
    if ( (getEvent()!=null)
         && (getEvent().getGraphElement()!=null)
       ) {
View Full Code Here

      jpdlReader.addProblem(new Problem(Problem.LEVEL_WARNING, "ignoring repeat on timer with transition "+actionElement.asXML()));
    }
  }

  public void execute(ExecutionContext executionContext) throws Exception {
    Timer timer = createTimer(executionContext);
    SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER);
    schedulerService.createTimer(timer);
  }
View Full Code Here

    SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER);
    schedulerService.createTimer(timer);
  }

  protected Timer createTimer(ExecutionContext executionContext) {
    Timer timer = new Timer(executionContext.getToken());
    timer.setName(timerName);
    timer.setRepeat(repeat);
    if (dueDate!=null) {
      Duration duration = new Duration(dueDate);
      Date dueDateDate = businessCalendar.add( Clock.getCurrentTime(), duration );
      timer.setDueDate(dueDateDate);
    }
    timer.setAction(timerAction);
    timer.setTransitionName(transitionName);
    timer.setGraphElement(executionContext.getEventSource());
    timer.setTaskInstance(executionContext.getTaskInstance());
   
    // if this action was executed for a graph element
    if ( (getEvent()!=null)
         && (getEvent().getGraphElement()!=null)
       ) {
View Full Code Here

TOP

Related Classes of org.jbpm.job.Timer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.