Class EventRecorder

java.lang.Object
com.agentforge4j.runtime.event.EventRecorder

public final class EventRecorder extends Object
Thin helper that builds WorkflowEvent instances and appends them to the configured WorkflowEventLog.

Centralising event creation keeps the executors focused on orchestration and guarantees that every event has a correctly-generated id and timestamp.

  • Constructor Details

    • EventRecorder

      public EventRecorder(WorkflowEventLog eventLog, Clock clock)
      Creates a recorder.
      Parameters:
      eventLog - append target for constructed events
      clock - source of event timestamps
  • Method Details

    • record

      public void record(String runId, String stepId, WorkflowEventType eventType, String payload, String actorId)
      Appends a new WorkflowEvent with a generated id and clock timestamp.
      Parameters:
      runId - non-blank run scope id
      stepId - optional step scope; may be null for run-level events
      eventType - non-null event discriminator
      payload - optional human-readable payload; may be null
      actorId - optional logical actor (for example "runtime" or "user"); forwarded as-is to the event log
      Throws:
      IllegalArgumentException - if runId is blank or eventType is null