Package org.fireflow.model

Examples of org.fireflow.model.Duration


                isBusinessTime = Boolean.parseBoolean(sIsBusTime);
            } catch (Exception ex) {
                return null;
            }
        }
        Duration duration = new Duration(value, durationElement.attributeValue(UNIT));
        duration.setBusinessTime(isBusinessTime);
        return duration;
    }
View Full Code Here


                isBusinessTime = Boolean.parseBoolean(sIsBusTime);
            } catch (Exception ex) {
                return null;
            }
        }
        Duration duration = new Duration(value, durationElement.getAttribute(UNIT));
        duration.setBusinessTime(isBusinessTime);
        return duration;
    }
View Full Code Here

        try {
            fromDate = dFormat.parse("2008-10-31 16:10");
        } catch (ParseException ex) {
            Logger.getLogger(TestCalendarService.class.getName()).log(Level.SEVERE, null, ex);
        }
        Duration du = new Duration(2,Duration.DAY);
        du.setBusinessTime(true);
        Date newDate = calService.dateAfter(fromDate, du);
        System.out.println("2 biz day after 2008-10-31 16:10 is "+dFormat.format(newDate));
//
        Duration du2 = new Duration(3, Duration.HOUR);
        du2.setBusinessTime(true);
        Date newDate2 = calService.dateAfter(fromDate, du2);
        System.out.println("3 biz hour after 2008-10-31 16:10 is " + dFormat.format(newDate2));
//       
        Duration du3 = new Duration(1,Duration.WEEK);
        du3.setBusinessTime(false);
        Date newDate3 = calService.dateAfter(fromDate, du3);
        System.out.println("1week after 2008-10-31 16:10 is "+dFormat.format(newDate3));
//           
//       
        Duration du4 = new Duration(1,Duration.YEAR);
        du4.setBusinessTime(false);
        Date newDate4 = calService.dateAfter(fromDate, du4);
        System.out.println("1 year after 2008-10-31 10:10 is "+dFormat.format(newDate4));
//                  
        Date t2 = new Date();
        System.out.println("cal time is " + (t2.getTime() - t1.getTime()));
View Full Code Here

    @Test
    public void testDateAfter() {
        System.out.println("dateAfter");
        Long temp = System.currentTimeMillis();
        Date fromDate = new Date(temp);
        Duration duration = new Duration(60,Duration.SECOND);
        DefaultCalendarService instance = new DefaultCalendarService();
        Date result = instance.dateAfter(fromDate, duration);
        assertNotNull(result);
        Date expResult = new Date(temp+60*1000);
        assertEquals (expResult, result);
View Full Code Here

      ((IRuntimeContextAware) taskInstance).setRuntimeContext(rtCtx);
      ((IWorkflowSessionAware) taskInstance)
          .setCurrentWorkflowSession(workflowSession);
      // 计算超时
      Duration duration = task.getDuration();

      if (duration != null && calService != null) {
        ((TaskInstance) taskInstance).setExpiredTime(calService
            .dateAfter(calService.getSysDate(), duration));
      }
View Full Code Here

TOP

Related Classes of org.fireflow.model.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.