MEP Expression Language
Reference Multipart Messages
In most cases, EL treats a multipart message as if it is just one message. Note that:
- Variables that refer to the body of the message — for example, request.defaultMessage — return the entire multipart message.
- Variables that refer to an SMS ID — for example, request.message.smsId — return the SMS ID from the first part of the multipart message.
- Variables that refer to the message date — for example, request.message.date) — return the date of the last part of the multipart message.
However, there are some variables that specifically treat each part of the message separately. These variables enable you to access details about the individual parts of a received multipart message as well as the text in each message part.
Finding out whether a message is multipart
If you need to find out if a message is multipart, you can use one of the following expressions which return either true or false:
${session.initialMessage.isMultipart}
${request.message.isMultipart}
If you need to know how many additional parts there are in a multipart message, you will need to do a null check. For example:
${not empty session.initialMessage.part[2].message}
This expression will return true if there is a third part to the multipart message, or false if no third part is found.