Examples of Duration


Examples of org.jbpm.calendar.Duration

  }

  public void createTimer(String duration) {
    TimerService timerService = entityContext.getTimerService();
    BusinessCalendar businessCalendar = new BusinessCalendar();
    Date dueDateTime = businessCalendar.add(new Date(), new Duration(duration));
    timerService.createTimer(dueDateTime, null);
  }
View Full Code Here

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

  public void setDueDateDescription(String dueDateDescription) {

    ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
    dueDateDescription = (String) scriptManager.evaluateExpression(dueDateDescription, null);
   
    Duration duration = new Duration(dueDateDescription);
    Date now = Clock.getCurrentTime();
   
    if ( duration.isBusinessTime()
         || duration.getMonths()>0
         || duration.getYears()>0
       ) {
      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() +
                                60*( duration.getHours() +
                                     24*( duration.getDays() +
                                          7*duration.getWeeks()))));
      dueDate = new Date(now.getTime() + millis);
    }
  }
View Full Code Here

Examples of org.jitterbit.util.time.Duration

     * @return a <code>Duration</code> instance, or <code>null</code> if this operation has not
     *         completed yet.
     */
    public Duration getDuration() {
        if (startTime != null && status.isDone()) {
            return new Duration(startTime, statusTime);
        }
        return null;
    }
View Full Code Here

Examples of org.joda.time.Duration

            from = DateTime.parse(histogram.getHistogramBoundaries().getFrom());
        }
        final DateTime to = DateTime.parse(histogram.getHistogramBoundaries().getTo());
        final MutableDateTime currentTime = new MutableDateTime(from);

        final Duration step = estimateIntervalStep(histogram.getInterval());
        final int dataPoints = (int) ((to.getMillis() - from.getMillis()) / step.getMillis());

        // using the absolute value guarantees, that there will always be enough values for the given resolution
        final int factor = (maxDataPoints != -1 && dataPoints > maxDataPoints) ? dataPoints / maxDataPoints : 1;

        int index = 0;
View Full Code Here

Examples of org.kie.api.definition.type.Duration

        }

    }

    protected void wireDurationAccessor( AbstractClassTypeDeclarationDescr typeDescr, TypeDeclaration type, PackageRegistry pkgRegistry ) {
        Duration duration = typeDescr.getTypedAnnotation(Duration.class);
        if (duration != null) {
            String durationField = null;
            try {
                durationField = duration.value();
            } catch (Exception e) {
                kbuilder.addBuilderResult(new TypeDeclarationError(typeDescr, e.getMessage()));
                return;
            }
            type.setDurationAttribute(durationField);
View Full Code Here

Examples of org.modeshape.common.math.Duration

     */
    public void stop() {
        if (this.isRunning()) {
            long duration = System.nanoTime() - this.lastStarted;
            this.lastStarted = 0l;
            this.stats.add(new Duration(duration));
        }
    }
View Full Code Here

Examples of org.ocpsoft.prettytime.Duration

   @Test
   public void testRounding() throws Exception
   {
      PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 3 + 1000 * 60 * 45));
      Duration duration = t.approximateDuration(new Date(0));

      assertEquals("4 hours ago", t.format(duration));
      assertEquals("3 hours ago", t.formatUnrounded(duration));
   }
View Full Code Here

Examples of org.odftoolkit.odfdom.type.Duration

      // update editing-duration info.
      long editingDuration = calendar.getTimeInMillis() - documentOpeningTime;
      editingDuration = (editingDuration < 1) ? 1 : editingDuration;
      try {
        DatatypeFactory aFactory = DatatypeFactory.newInstance();
        metaData.setEditingDuration(new Duration(aFactory.newDurationDayTime(editingDuration)));
      } catch (DatatypeConfigurationException e) {
        Logger.getLogger(Document.class.getName()).log(Level.SEVERE,
            "editing duration update fail as DatatypeFactory can not be instanced", e);
      }
    }
View Full Code Here

Examples of org.olat.ims.qti.editor.beecom.objects.Duration

      itemControl.setHint(showHints.getSelected() == 0 ? Control.CTRL_YES : Control.CTRL_NO);
      itemControl.setSolution(showSolution.getSelected() == 0 ? Control.CTRL_YES : Control.CTRL_NO);
      q.setHintText(conditionalCommentFilter.filter(hint.getRawValue())); // trust authors, don't to XSS filtering
      q.setSolutionText(conditionalCommentFilter.filter(solution.getRawValue())); // trust authors, don't to XSS filtering
      if (limitTime.getSelectedKey().equals("y")) {
        item.setDuration(new Duration(1000 * timeSec.getIntValue() + 1000 * 60 * timeMin.getIntValue()));
      } else {
        item.setDuration(null);
      }
      if (limitAttempts.getSelectedKey().equals("y")) {
        item.setMaxattempts(attempts.getIntValue());
View Full Code Here

Examples of org.olat.ims.qti.editor.beecom.objects.Duration

    // attributes
    String sISODuration = element.getTextTrim();
    // null values no problems (default: null = false)
    long millis = QTIHelper.parseISODuration(sISODuration);
    if (millis == 0) return null;
    return new Duration(millis);
  }
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.