finos / messageml-utils

MessageML is a markup language used by the Symphony Agent API for representing messages, including formatting (bold, italic, numbered and unnumbered lists etc.) and entity data representing structured objects.
https://docs.developers.symphony.com
Apache License 2.0
12 stars 28 forks source link

MML-265 Clearing BiContext in between messages #270

Closed symphony-mariacristina closed 3 years ago

symphony-mariacristina commented 3 years ago

Goal of this PR is to:

thibauult commented 3 years ago

Clear the BiContext every time we parse a new message (context.getBiContext() will only contain BiItems of the last message parsed)

I don't get it. I thought we were creating a new MessageMLContext instance every time we parse a new message : https://github.com/SymphonyOSF/symphony-agent/blob/master/agent/src/main/java/com/symphony/agent/server/V4AgentApi.java#L325

symphony-youri commented 3 years ago

Clear the BiContext every time we parse a new message (context.getBiContext() will only contain BiItems of the last message parsed)

I don't get it. I thought we were creating a new MessageMLContext instance every time we parse a new message : https://github.com/SymphonyOSF/symphony-agent/blob/master/agent/src/main/java/com/symphony/agent/server/V4AgentApi.java#L325

Yes we are but there is nothing to prevent you from reusing a MessageMLContext at least this way the bi context is cleared, the same way the result of the previous parse() call is cleated in MessageMLContext