docs: public TrxMessageHeader addTransportProperties(TrxMessageHeader trxMessageHeader, String strVersion)
      {
          if (trxMessageHeader.get(MessageTransport.TRANSPORT_ID_PARAM) != null)
          {
              RecordOwner recordOwner = this.findRecordOwner();
              if (m_recMessageTransport == null)
              {
                  m_recMessageTransport = new MessageTransport(recordOwner);
                  if (recordOwner != null)
                      recordOwner.removeRecord(m_recMessageTransport);
                  this.addListener(new FreeOnFreeHandler(m_recMessageTransport));
              }
              if (m_recMessageTransportInfo == null)
              {
                  m_recMessageTransportInfo = new MessageTransportInfo(recordOwner);
                  if (recordOwner != null)
                      recordOwner.removeRecord(m_recMessageTransportInfo);
                  this.addListener(new FreeOnFreeHandler(m_recMessageTransportInfo));
              }
              SubFileFilter subFileFilter = null;
              try {
                  if (m_recMessageTransport.setHandle(trxMessageHeader.get(MessageTransport.TRANSPORT_ID_PARAM), DBConstants.BOOKMARK_HANDLE) != null)
                  {
                      Map<String,Object> propMessageTransport = ((PropertiesField)m_recMessageTransport.getField(MessageTransport.PROPERTIES)).loadProperties();
                      String strInitialMessageStatusID = null;
                      if (!this.getField(MessageProcessInfo.INITIAL_MESSAGE_STATUS_ID).isNull())
                          strInitialMessageStatusID = this.getField(MessageProcessInfo.INITIAL_MESSAGE_STATUS_ID).toString();
                      if (strInitialMessageStatusID != null)
                      {
                          if (propMessageTransport == null)
                              propMessageTransport = new Hashtable<String,Object>();
                          propMessageTransport.put(MessageTransport.INITIAL_MESSAGE_DATA_STATUS, strInitialMessageStatusID);
                      }
                      if (propMessageTransport != null)
                      {
                          Map<String,Object> propHeaderTransport = trxMessageHeader.getMessageTransportMap();
                          if (propHeaderTransport != null)
                              propHeaderTransport.putAll(propMessageTransport);
                          else
                              propHeaderTransport = propMessageTransport;
                          trxMessageHeader.setMessageTransportMap(propHeaderTransport);
                      }
                      m_recMessageTransportInfo.setKeyArea(MessageTransportInfo.MESSAGE_PROCESS_INFO_ID_KEY);
                      int iMessageVersionID = 0;
                      if (trxMessageHeader.getProperties() != null)
                          if (strVersion == null)
                      {
                          if (trxMessageHeader.getProperties().get(MessageVersion.VERSION_ID) != null)
                          {
                              try {
                                  iMessageVersionID = Integer.parseInt(trxMessageHeader.getProperties().get(MessageVersion.VERSION_ID).toString());
                              } catch (NumberFormatException ex) {
                                  // Ignore
                              }
                          }
                          else
                              strVersion = (String)trxMessageHeader.getProperties().get(MessageVersion.VERSION);
                      }
                      MessageVersion recMessageVersion = this.getMessageControl().getMessageVersion();
                      if (iMessageVersionID != 0)
                      {
                          recMessageVersion.getField(MessageVersion.ID).setValue(iMessageVersionID);
                          recMessageVersion.setKeyArea(MessageVersion.ID_KEY);
                          if (!recMessageVersion.seek(DBConstants.EQUALS))
                              iMessageVersionID = 0;  // Never
                      }
                      if (iMessageVersionID == 0)
                      {
                          recMessageVersion = this.getMessageControl().getMessageVersion(strVersion);
                          iMessageVersionID = (int)recMessageVersion.getField(MessageVersion.ID).getValue();
                          if (strVersion == null)
                          {
                              int iMessageVersionIDDefault = 0;
                              int iMessageVersionIDBestGuess = iMessageVersionID;
                              boolean bDefaultExists = false;
                              m_recMessageTransportInfo.addListener(subFileFilter = new SubFileFilter(this.getField(MessageProcessInfo.ID), MessageTransportInfo.MESSAGE_PROCESS_INFO_ID, m_recMessageTransport.getField(MessageTransport.ID), MessageTransportInfo.MESSAGE_TRANSPORT_ID, null, null));
                              while  (m_recMessageTransportInfo.hasNext())
                              {
                                  m_recMessageTransportInfo.next();
                                  if (m_recMessageTransportInfo.getField(MessageTransportInfo.ACTIVE).getState())
                                      iMessageVersionIDBestGuess = (int)m_recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_VERSION_ID).getValue();
                                  else if (m_recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_VERSION_ID).getValue() == 0)
                                      iMessageVersionIDBestGuess = 0;    // If not active with no version, best guess is no version
                                  if (m_recMessageTransportInfo.getField(MessageTransportInfo.DEFAULT_TRANSPORT).getState())  // Default is always the best guess
                                      iMessageVersionIDDefault = (int)m_recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_VERSION_ID).getValue();
                                  if (m_recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_VERSION_ID).getValue() == iMessageVersionID)  // Default is always the best guess
                                      bDefaultExists = true;
                              }
                              subFileFilter.free();
                              subFileFilter = null;
                              if (iMessageVersionIDDefault != 0)
                                  iMessageVersionID = iMessageVersionIDDefault;   // If there is a default, always use it
                              else if (!bDefaultExists)
                                  iMessageVersionID = iMessageVersionIDBestGuess; // else, If the default doesn't exist, use the best guess
                              recMessageVersion.getField(MessageVersion.ID).setValue(iMessageVersionID);
                              recMessageVersion.setKeyArea(MessageVersion.ID_KEY);
                              if (!recMessageVersion.seek(DBConstants.EQUALS))
                                  iMessageVersionID = 0;  // Never
                          }
                      }
                      m_recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_PROCESS_INFO_ID).moveFieldToThis(this.getField(MessageProcessInfo.ID));
                      m_recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_TRANSPORT_ID).moveFieldToThis(m_recMessageTransport.getField(MessageTransport.ID));
                      m_recMessageTransportInfo.getField(MessageTransportInfo.MESSAGE_VERSION_ID).setValue(iMessageVersionID);
                      if (m_recMessageTransportInfo.seek(DBConstants.EQUALS))
                      {
                          trxMessageHeader = recMessageVersion.addMessageProperties(trxMessageHeader, this.getMessageControl());
                          trxMessageHeader = m_recMessageTransportInfo.addMessageProperties(trxMessageHeader);
                      }
                  }
              } catch (DBException ex) {
                  ex.printStackTrace();
              } finally {
                  if (subFileFilter != null)
                      subFileFilter.free();
              }
          }
          return trxMessageHeader;
      }