Skip to content

Commit

Permalink
feature: add explanation in send message
Browse files Browse the repository at this point in the history
  • Loading branch information
yan-elena committed Jun 4, 2024
1 parent 53b454c commit 10dfffe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/component/event/design/ExecutedAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ function ExecutedAction(props) {
if (props.event.message.type === "SendMessage") {
const message = props.event.message.event.messageInfo
const description = "I sent a " + message.type + " message to " + message.receiver + ": " + message.message
const explanation = "" //todo
const intention = props.event.message.event.intentionInfo.intendedMeansInfo[0].trigger
const explanation = props.log.slice(0, props.log.indexOf(props.event)).findLast(e => e.message.type === "GoalCreated" && e.message.event.goalInfo.goalFunctor.includes(intention))

return (
<Event type={"Executed action"} description={description} info={""} timestamp={props.event.timestamp}
filter={props.filter} log={props.log} level={Level.DESIGN}/>
filter={props.filter} log={props.log} level={Level.DESIGN} explanation={explanation}/>
)
} else {
const deed = props.event.message.event.deedInfo
Expand Down

0 comments on commit 10dfffe

Please sign in to comment.