Package org.jbpm.calendar

Examples of org.jbpm.calendar.Duration


    workItem.setParameter("Description", description);
    initializeVariables(workItem, task, nodeInstance);
    if (task.getDueDate() != null) {
        BusinessCalendar businessCalendar = new BusinessCalendar();
        workItem.setParameter("dueDate",
              businessCalendar.add(new Date(), new Duration(task.getDueDate())));
      }
    if (task.getSwimlane() != null) {
        String swimlaneName = task.getSwimlane().getName();
        SwimlaneContextInstance swimlaneContextInstance = (SwimlaneContextInstance)
            nodeInstance.resolveContextInstance(SwimlaneContext.SWIMLANE_SCOPE, swimlaneName);
View Full Code Here


      if (action instanceof CreateTimerAction) {
          CreateTimerAction createTimerAction = (CreateTimerAction) action;
          String timerName = createTimerAction.getTimerName();
          TimerInstance timer = new TimerInstance();
          long delay = BUSINESS_CALENDAR.add(new Date(0),
                new Duration(createTimerAction.getDueDate())).getTime();
            timer.setDelay(delay);
            if (createTimerAction.getRepeat() != null) {
                long period = BUSINESS_CALENDAR.add(new Date(0),
                    new Duration(createTimerAction.getRepeat())).getTime();
                timer.setPeriod(period);
            }
          if (timerActions.isEmpty()) {
              addTimerListener();
          }
View Full Code Here

                            || (signal==TaskNode.SIGNAL_LAST_WAIT )
                          );
    }
    if (task.getDueDate()!=null) {
      BusinessCalendar businessCalendar = new BusinessCalendar();
      this.dueDate = businessCalendar.add(Clock.getCurrentTime(), new Duration(task.getDueDate()));
    }
  }
View Full Code Here

      // very long time to execute the timers.
      // then the repeat action dueDate could already have passed.
      while (dueDate.getTime()<=System.currentTimeMillis()) {
        dueDate = businessCalendar
              .add(dueDate,
                new Duration(repeat));
      }
      log.debug("updated timer for repetition '"+this+"' in '"+(dueDate.getTime()-System.currentTimeMillis())+"' millis");
    }
   
    return deleteThisJob;
View Full Code Here

  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);
View Full Code Here

TOP

Related Classes of org.jbpm.calendar.Duration

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.