Interface ScheduledProcessStartEvent

All Superinterfaces:
Event, TimeScheduleEvent
All Known Implementing Classes:
ScheduledProcessStartEventImpl

public interface ScheduledProcessStartEvent extends TimeScheduleEvent
The event which a scheduled process start raises at one of its due times. Besides the start, it carries the instance which the last successful trigger of the start has started, and the handler executing the start sets the outcome of the trigger on it: the instance it has started, the time of its last failed attempt or the skip of the due time. The source of the event reads the outcome once the handling has ended; a trigger without an outcome counts as failed at that time.
  • Method Details

    • getScheduledProcessStart

      ScheduledProcessStart getScheduledProcessStart()
      Gets the scheduled process start which has raised this event.
      Returns:
      The scheduled process start which has raised this event. This will never be null.
    • getLastInstance

      UUID getLastInstance()
      Gets the ID of the instance which the last successful trigger of the start has started. A start with a fixed rate which allows no overlapping instances skips its due time while this instance runs.
      Returns:
      The ID of the instance which the last successful trigger of the start has started or null if no trigger has started one.
    • setStarted

      void setStarted(UUID instanceID)
      Sets the outcome of the trigger of this event: it has started the instance of the designated ID. This replaces an outcome set before.
      Parameters:
      instanceID - The ID of the started instance. This must not be null.
    • setFailed

      void setFailed(Instant lastAttempt)
      Sets the outcome of the trigger of this event: every attempt to start an instance has failed, the last one at the designated time. This replaces an outcome set before.
      Parameters:
      lastAttempt - The time of the last failed attempt. This must not be null.
    • setSkipped

      void setSkipped()
      Sets the outcome of the trigger of this event: it has skipped its due time without attempting to start an instance. This replaces an outcome set before.
    • getStartedInstance

      UUID getStartedInstance()
      Gets the ID of the instance which the trigger of this event has started.
      Returns:
      The ID of the instance which the trigger of this event has started or null if its outcome is another one or it has none.
    • getLastFailedAttempt

      Instant getLastFailedAttempt()
      Gets the time of the last failed attempt of the trigger of this event.
      Returns:
      The time of the last failed attempt of the trigger of this event or null if its outcome is another one or it has none.
    • isSkipped

      boolean isSkipped()
      Gets whether the trigger of this event has skipped its due time.
      Returns:
      Whether the trigger of this event has skipped its due time.