Codota Logo
DurationReportResult.getPeriodUnit
Code IndexAdd Codota to your IDE (free)

How to use
getPeriodUnit
method
in
org.camunda.bpm.engine.history.DurationReportResult

Best Java code snippets using org.camunda.bpm.engine.history.DurationReportResult.getPeriodUnit (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: camunda/camunda-bpm-platform

protected static String convertDurationReportResult(List<ReportResult> reports) {
 StringBuilder buffer = new StringBuilder();
 buffer.append(DURATION_HEADER);
 for (ReportResult report : reports) {
  DurationReportResult durationReport = (DurationReportResult) report;
  buffer.append(NEW_LINE_SEPARATOR);
  buffer.append(durationReport.getPeriod());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getPeriodUnit().toString());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getMinimum());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getMaximum());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getAverage());
 }
 return buffer.toString();
}
origin: camunda/camunda-bpm-platform

protected static String convertDurationReportResult(List<ReportResult> reports) {
 StringBuilder buffer = new StringBuilder();
 buffer.append(DURATION_HEADER);
 for (ReportResult report : reports) {
  DurationReportResult durationReport = (DurationReportResult) report;
  buffer.append(NEW_LINE_SEPARATOR);
  buffer.append(durationReport.getPeriod());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getPeriodUnit().toString());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getMinimum());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getMaximum());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getAverage());
 }
 return buffer.toString();
}
origin: camunda/camunda-bpm-platform

public static List<DurationReportResult> createMockHistoricProcessInstanceDurationReportByQuarter() {
 DurationReportResult mock = mock(DurationReportResult.class);
 when(mock.getAverage()).thenReturn(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_AVG);
 when(mock.getMinimum()).thenReturn(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MIN);
 when(mock.getMaximum()).thenReturn(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MAX);
 when(mock.getPeriod()).thenReturn(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_PERIOD);
 when(mock.getPeriodUnit()).thenReturn(PeriodUnit.QUARTER);
 List<DurationReportResult> mockList = new ArrayList<DurationReportResult>();
 mockList.add(mock);
 return mockList;
}
origin: camunda/camunda-bpm-platform

public static List<DurationReportResult> createMockHistoricProcessInstanceDurationReportByMonth() {
 DurationReportResult mock = mock(DurationReportResult.class);
 when(mock.getAverage()).thenReturn(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_AVG);
 when(mock.getMinimum()).thenReturn(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MIN);
 when(mock.getMaximum()).thenReturn(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MAX);
 when(mock.getPeriod()).thenReturn(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_PERIOD);
 when(mock.getPeriodUnit()).thenReturn(PeriodUnit.MONTH);
 List<DurationReportResult> mockList = new ArrayList<DurationReportResult>();
 mockList.add(mock);
 return mockList;
}
origin: camunda/camunda-bpm-platform

public static List<DurationReportResult> createMockHistoricTaskInstanceDurationReport(PeriodUnit periodUnit) {
 DurationReportResult mock = mock(DurationReportResult.class);
 when(mock.getAverage()).thenReturn(EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_AVG);
 when(mock.getMinimum()).thenReturn(EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_MIN);
 when(mock.getMaximum()).thenReturn(EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_MAX);
 when(mock.getPeriod()).thenReturn(EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_PERIOD);
 when(mock.getPeriodUnit()).thenReturn(periodUnit);
 List<DurationReportResult> mockList = new ArrayList<DurationReportResult>();
 mockList.add(mock);
 return mockList;
}
origin: camunda/camunda-bpm-platform

public void assertReportResults(List<DurationReportResult> actual) {
 assertEquals("Report size", periodToProcessInstancesMap.size(), actual.size());
 for (DurationReportResult reportResult : actual) {
  assertEquals("Period unit", periodUnit, reportResult.getPeriodUnit());
  int period = reportResult.getPeriod();
  Set<String> processInstancesInPeriod = periodToProcessInstancesMap.get(period);
  assertNotNull("Unexpected report for period " + period, processInstancesInPeriod);
  List<HistoricProcessInstance> historicProcessInstances = historyService
    .createHistoricProcessInstanceQuery()
    .processInstanceIds(processInstancesInPeriod)
    .finished()
    .list();
  long max = 0;
  long min = 0;
  long sum = 0;
  for (int i = 0; i < historicProcessInstances.size(); i++) {
   HistoricProcessInstance historicProcessInstance = historicProcessInstances.get(i);
   Long duration = historicProcessInstance.getDurationInMillis();
   sum = sum + duration;
   max = i > 0 ? Math.max(max, duration) : duration;
   min = i > 0 ? Math.min(min, duration) : duration;
  }
  long avg = sum / historicProcessInstances.size();
  assertEquals("maximum", max, reportResult.getMaximum());
  assertEquals("minimum", min, reportResult.getMinimum());
  assertEquals("average", avg, reportResult.getAverage(), 1);
 }
}
origin: org.camunda.bpm/camunda-engine-rest-jaxrs2

protected static String convertDurationReportResult(List<ReportResult> reports) {
 StringBuffer buffer = new StringBuffer();
 buffer.append(DURATION_HEADER);
 for (ReportResult report : reports) {
  DurationReportResult durationReport = (DurationReportResult) report;
  buffer.append(NEW_LINE_SEPARATOR);
  buffer.append(durationReport.getPeriod());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getPeriodUnit().toString());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getMinimum());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getMaximum());
  buffer.append(DELIMITER);
  buffer.append(durationReport.getAverage());
 }
 return buffer.toString();
}
origin: org.camunda.bpm/camunda-engine

public void assertReportResults(List<DurationReportResult> actual) {
 assertEquals("Report size", periodToProcessInstancesMap.size(), actual.size());
 for (DurationReportResult reportResult : actual) {
  assertEquals("Period unit", periodUnit, reportResult.getPeriodUnit());
  int period = reportResult.getPeriod();
  Set<String> processInstancesInPeriod = periodToProcessInstancesMap.get(period);
  assertNotNull("Unexpected report for period " + period, processInstancesInPeriod);
  List<HistoricProcessInstance> historicProcessInstances = historyService
    .createHistoricProcessInstanceQuery()
    .processInstanceIds(processInstancesInPeriod)
    .finished()
    .list();
  long max = 0;
  long min = 0;
  long sum = 0;
  for (int i = 0; i < historicProcessInstances.size(); i++) {
   HistoricProcessInstance historicProcessInstance = historicProcessInstances.get(i);
   Long duration = historicProcessInstance.getDurationInMillis();
   sum = sum + duration;
   max = i > 0 ? Math.max(max, duration) : duration;
   min = i > 0 ? Math.min(min, duration) : duration;
  }
  long avg = sum / historicProcessInstances.size();
  assertEquals("maximum", max, reportResult.getMaximum());
  assertEquals("minimum", min, reportResult.getMinimum());
  assertEquals("average", avg, reportResult.getAverage(), 1);
 }
}
org.camunda.bpm.engine.historyDurationReportResultgetPeriodUnit

Popular methods of DurationReportResult

  • getAverage
    Returns the average duration of all completed instances, which have been started in the given period
  • getMaximum
    Returns the greatest duration of all completed instances, which have been started in the given perio
  • getMinimum
    Returns the smallest duration of all completed instances, which have been started in the given perio
  • getPeriod

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JCheckBox (javax.swing)
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now