Examples of BusinessCalendar


Examples of org.jbpm.calendar.BusinessCalendar

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

Examples of org.jbpm.calendar.BusinessCalendar

      }
    }
    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

Examples of org.jbpm.calendar.BusinessCalendar

                            || (signal==TaskNode.SIGNAL_FIRST_WAIT )
                            || (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

Examples of org.jbpm.pvm.internal.cal.BusinessCalendar

       ) {
      Environment environment = Environment.getCurrent();
      if (environment==null) {
        throw new JbpmException("no environment to get business calendar for calculating duedate "+dueDateDescription);
      }
      BusinessCalendar businessCalendar = environment.get(BusinessCalendar.class);
      dueDate = businessCalendar.add(now, duration);

    } else {
      long millis = duration.getMillis() +
                    1000*( duration.getSeconds() +
                           60*( duration.getMinutes() +
View Full Code Here

Examples of org.jbpm.pvm.internal.cal.BusinessCalendar

  public BusinessCalendarBinding() {
    super("business-calendar");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    BusinessCalendar businessCalendar = new BusinessCalendar();
   
    TimeZone timeZone = null;
    if (element.hasAttribute("timezone")) {
      timeZone = TimeZone.getTimeZone(element.getAttribute("timezone"));
    } else {
      timeZone = TimeZone.getDefault();
    }
    businessCalendar.setTimeZone(timeZone);
   
    String hourFormatText = "HH:mm";
    if (element.hasAttribute("hour-format")) {
      hourFormatText = element.getAttribute("hour-format");
    }
    DateFormat hourFormat = new SimpleDateFormat(hourFormatText);

    Day[] days = new Day[8];
    days[Calendar.SUNDAY] = parseDay(element, "sunday", hourFormat, businessCalendar, parse);
    days[Calendar.MONDAY] = parseDay(element, "monday", hourFormat, businessCalendar, parse);
    days[Calendar.TUESDAY] = parseDay(element, "tuesday", hourFormat, businessCalendar, parse);
    days[Calendar.WEDNESDAY] = parseDay(element, "wednesday", hourFormat, businessCalendar, parse);
    days[Calendar.THURSDAY] = parseDay(element, "thursday", hourFormat, businessCalendar, parse);
    days[Calendar.FRIDAY] = parseDay(element, "friday", hourFormat, businessCalendar, parse);
    days[Calendar.SATURDAY] = parseDay(element, "saturday", hourFormat, businessCalendar, parse);
    businessCalendar.setDays(days);

    String dayFormatText = "dd/MM/yyyy";
    if (element.hasAttribute("day-format")) {
      dayFormatText = element.getAttribute("day-format");
    }
    DateFormat dayFormat = new SimpleDateFormat(dayFormatText);

    Holiday[] holidays = null;
    List<Element> holidayElements = XmlUtil.elements(element, "holiday");
    if (!holidayElements.isEmpty()) {
      holidays = new Holiday[holidayElements.size()];
      for (int i=0; i<holidayElements.size(); i++) {
        holidays[i] = parseHoliday(holidayElements.get(i), dayFormat, businessCalendar, parse);
      }
    }
    businessCalendar.setHolidays(holidays);
   
    ProvidedObjectDescriptor descriptor = new ProvidedObjectDescriptor(businessCalendar, true);
    return descriptor;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.cal.BusinessCalendar

  public void setDueDateDescription(String dueDateDescription) {
    ScriptManager scriptManager = ScriptManager.getScriptManager();
    dueDateDescription = (String) scriptManager.evaluateExpression(dueDateDescription, null);
    Date now = Clock.getCurrentTime();
    BusinessCalendar businessCalendar = EnvironmentImpl.getFromCurrent(BusinessCalendar.class);
    duedate = businessCalendar.add(now, dueDateDescription);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.