Java Code Examples for org.camunda.bpm.engine.impl.history.event.HistoricProcessInstanceEventEntity#getEndTime()

The following examples show how to use org.camunda.bpm.engine.impl.history.event.HistoricProcessInstanceEventEntity#getEndTime() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultHistoryRemovalTimeProvider.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
public Date calculateRemovalTime(HistoricProcessInstanceEventEntity historicRootProcessInstance, ProcessDefinition processDefinition) {

    Integer historyTimeToLive = processDefinition.getHistoryTimeToLive();

    if (historyTimeToLive != null) {
      if (isProcessInstanceRunning(historicRootProcessInstance)) {
        Date startTime = historicRootProcessInstance.getStartTime();
        return determineRemovalTime(startTime, historyTimeToLive);

      } else if (isProcessInstanceEnded(historicRootProcessInstance)) {
        Date endTime = historicRootProcessInstance.getEndTime();
        return determineRemovalTime(endTime, historyTimeToLive);

      }
    }

    return null;
  }
 
Example 2
Source File: DefaultHistoryRemovalTimeProvider.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
protected boolean isProcessInstanceRunning(HistoricProcessInstanceEventEntity historicProcessInstance) {
  return historicProcessInstance.getEndTime() == null;
}
 
Example 3
Source File: DefaultHistoryRemovalTimeProvider.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
protected boolean isProcessInstanceEnded(HistoricProcessInstanceEventEntity historicProcessInstance) {
  return historicProcessInstance.getEndTime() != null;
}