package org.requirementsascode;

import java.util.function.Consumer;

/**
 * Class used to trigger a system reaction.
 *
 * <p>Use an instance of this class only if you want to adapt the system reaction, in order to call
 * the standard system reaction from your adapted system reaction.
 *
 * @author b_muth
 */
public class SystemReactionTrigger {
  private Object event;
  private Step useCaseStep;

  SystemReactionTrigger() {}

  /**
   * The system reaction of the step accepts the event (both event and step passed in earlier).
   *
   * @see #setupWith(Object, Step)
   */
  @SuppressWarnings("unchecked")
  public void trigger() {
    ((Consumer<Object>) useCaseStep.getSystemReaction()).accept(event);
  }

  void setupWith(Object event, Step useCaseStep) {
    this.event = event;
    this.useCaseStep = useCaseStep;
  }

  /**
   * Returns the event object that will be passed to the system reaction when {@link #trigger()} is
   * called.
   *
   * @return the event object.
   */
  public Object getEvent() {
    return event;
  }

  /**
   * Returns the use case step whose system reaction is performed when {@link #trigger()} is called.
   *
   * @return the use case step.
   */
  public Step getUseCaseStep() {
    return useCaseStep;
  }
}

@@ -26,16 +26,45 @@
 scode;%0A%0A
+import java.io.Serializable;%0A
 import j
@@ -370,17 +370,113 @@
 Trigger 
-%7B
+implements Serializable%7B%0A  private static final long serialVersionUID = -8615677956101523359L;%0A  
 %0A  priva

Make SystemReactionTrigger Serializable