Dexels / navajo

Navajo Service-oriented Applications
GNU Affero General Public License v3.0
9 stars 5 forks source link

Messages with type="definition" get added to array #614

Open rfrankhuizen opened 2 years ago

rfrankhuizen commented 2 years ago

There are two ways in which a message with type="definition" can be added to an array:

  1. The message gets added an array_element and then it's type is changed to definition via setType of BaseMessageImpl. In this case, the message gets correctly removed from the list of submessages.
  2. The message gets directly added as a definition via the add method of BaseMessageImpl. In this case, the message is incorrectly left in the list of submessages. This gives problems when iterating over the array because the definition message is returned as one of the iterands.

After discussion with Marte and Gerco the proposed solution is to no longer add messages of type="definition" to the list of submessages. Instead, the definition message can be stored in the field definitionMessage. This makes sure the definition message does not show up when iterating over an array.