diff --git a/src/java/event/actionEvent/DeedEvent.java b/src/java/event/actionEvent/DeedEvent.java index 184f7a3..02c1c92 100644 --- a/src/java/event/actionEvent/DeedEvent.java +++ b/src/java/event/actionEvent/DeedEvent.java @@ -23,7 +23,17 @@ abstract class DeedEvent implements Event { */ public DeedEvent(PlanBody deed, Intention intention) { this.deedInfo = new DeedInfo(deed); - this.intentionInfo = intention != null ? Optional.of(new IntentionInfo(intention)) : Optional.empty(); + if (intention != null) { + IntentionInfo intentionInfo = new IntentionInfo(intention); + if (intentionInfo.peekFirstIntendedMeans().isPresent() && + intentionInfo.peekFirstIntendedMeans().get().getPlan().getBody().contains(deedInfo.getTerm())) { + this.intentionInfo = Optional.of(intentionInfo); + } else { + this.intentionInfo = Optional.empty(); + } + } else { + this.intentionInfo = Optional.empty(); + } } public DeedInfo getDeedInfo() { diff --git a/src/java/log/LoggerArch.java b/src/java/log/LoggerArch.java index 56f190f..f59874c 100644 --- a/src/java/log/LoggerArch.java +++ b/src/java/log/LoggerArch.java @@ -23,6 +23,7 @@ public class LoggerArch extends AgArch { private final EventLogger eventLogger; + private Intention currentIntention; /** * Creates a new instance of {@link LoggerArch} and initialized the logger.