Class ProcessEvent

java.lang.Object
neqsim.process.util.event.ProcessEvent
All Implemented Interfaces:
Serializable

public class ProcessEvent extends Object implements Serializable
Represents an event in the process simulation.

Events can represent state changes, alarms, threshold crossings, or any significant occurrence that external systems may want to react to.

Version:
1.0
Author:
ESOL
See Also:
  • Field Details

  • Constructor Details

    • ProcessEvent

      public ProcessEvent(String eventId, ProcessEvent.EventType type, String source, String description, ProcessEvent.Severity severity)
      Creates a process event.
      Parameters:
      eventId - unique event identifier
      type - event type
      source - source equipment/component name
      description - human-readable description
      severity - event severity
  • Method Details

    • info

      public static ProcessEvent info(String source, String description)
      Creates an info event.
      Parameters:
      source - source name
      description - description
      Returns:
      info event
    • warning

      public static ProcessEvent warning(String source, String description)
      Creates a warning event.
      Parameters:
      source - source name
      description - description
      Returns:
      warning event
    • alarm

      public static ProcessEvent alarm(String source, String description)
      Creates an alarm event.
      Parameters:
      source - source name
      description - description
      Returns:
      alarm event
    • thresholdCrossed

      public static ProcessEvent thresholdCrossed(String source, String variable, double value, double threshold, boolean above)
      Creates a threshold crossed event.
      Parameters:
      source - source name
      variable - variable name
      value - current value
      threshold - threshold value
      above - true if crossed above threshold
      Returns:
      threshold event
    • modelDeviation

      public static ProcessEvent modelDeviation(String source, String variable, double measured, double predicted)
      Creates a model deviation event.
      Parameters:
      source - source name
      variable - variable name
      measured - measured value
      predicted - predicted value
      Returns:
      deviation event
    • generateId

      private static String generateId()
    • setProperty

      public ProcessEvent setProperty(String key, Object value)
      Sets a custom property on the event.
      Parameters:
      key - property key
      value - property value
      Returns:
      this event for chaining
    • getProperty

      public Object getProperty(String key)
      Gets a property value.
      Parameters:
      key - property key
      Returns:
      value or null
    • getProperty

      public <T> T getProperty(String key, Class<T> type)
      Gets a typed property value.
      Type Parameters:
      T - value type
      Parameters:
      key - property key
      type - value class
      Returns:
      typed value or null
    • getEventId

      public String getEventId()
      Gets the event ID.
      Returns:
      event ID
    • getType

      public ProcessEvent.EventType getType()
      Gets the event type.
      Returns:
      event type
    • getSource

      public String getSource()
      Gets the source name.
      Returns:
      source
    • getTimestamp

      public Instant getTimestamp()
      Gets the event timestamp.
      Returns:
      timestamp
    • getDescription

      public String getDescription()
      Gets the description.
      Returns:
      description
    • getSeverity

      public ProcessEvent.Severity getSeverity()
      Gets the severity.
      Returns:
      severity level
    • getProperties

      public Map<String,Object> getProperties()
      Gets all properties.
      Returns:
      properties map
    • toString

      public String toString()
      Overrides:
      toString in class Object