<?php

declare(strict_types=1);

namespace Drupal\flowdrop_runtime\Event;

use Drupal\flowdrop_runtime\DTO\Runtime\NodeExecutionContext;
use Symfony\Contracts\EventDispatcher\Event;

/**
 * Event dispatched before a node is executed.
 *
 * @internal
 */
class NodePreExecuteEvent extends Event {

  /**
   * The event name.
   */
  const NAME = 'flowdrop.node.pre_execute';

  /**
   * Constructs a new NodePreExecuteEvent.
   *
   * @param array $nodeData
   *   The node data array.
   * @param string $executionId
   *   The execution ID.
   * @param string $workflowId
   *   The workflow ID.
   * @param \Drupal\flowdrop_runtime\DTO\Runtime\NodeExecutionContext $context
   *   The execution context.
   */
  public function __construct(
    public readonly array $nodeData,
    public readonly string $executionId,
    public readonly string $workflowId,
    public readonly NodeExecutionContext $context,
  ) {}

}
