public TrxMessageHeader addMessageProperties(TrxMessageHeader trxMessageHeader, MessageDetailTarget recMessageDetailTarget, MessageProcessInfo recMessageProcessInfo, MessageTransport recMessageTransport)
    {
        try {
            if (trxMessageHeader == null)
                trxMessageHeader = new TrxMessageHeader(null, null);
            ContactType recContactType = (ContactType)((ReferenceField)this.getField(MessageDetail.CONTACT_TYPE_ID)).getReferenceRecord(null);
            recContactType = (ContactType)recContactType.getContactType((Record)recMessageDetailTarget);
            if (recContactType == null)
                return trxMessageHeader;    // Just being careful
        
            this.setKeyArea(MessageDetail.CONTACT_TYPE_ID_KEY);
            this.getField(MessageDetail.CONTACT_TYPE_ID).moveFieldToThis((BaseField)recContactType.getCounterField());
            this.getField(MessageDetail.PERSON_ID).moveFieldToThis((BaseField)((Record)recMessageDetailTarget).getCounterField());
            this.getField(MessageDetail.MESSAGE_PROCESS_INFO_ID).moveFieldToThis((BaseField)recMessageProcessInfo.getCounterField());
            this.getField(MessageDetail.MESSAGE_TRANSPORT_ID).moveFieldToThis((BaseField)recMessageTransport.getCounterField());
            if (this.seek(null))
            {
                Map<String,Object> propHeader = ((PropertiesField)this.getField(MessageDetail.PROPERTIES)).loadProperties();
                if (propHeader == null)
                    propHeader = new HashMap<String,Object>(); // Never return null.
                Map<String,Object> map = trxMessageHeader.getMessageHeaderMap();
                if (map != null)
                    map.putAll(propHeader);
                else
                    map = propHeader;
                trxMessageHeader.setMessageHeaderMap(map);
                if ((recMessageTransport != null)
                    && ((recMessageTransport.getEditMode() == DBConstants.EDIT_CURRENT) || (recMessageTransport.getEditMode() == DBConstants.EDIT_IN_PROGRESS)))
                {
                    trxMessageHeader = recMessageTransport.addMessageProperties(trxMessageHeader);
                }
            }
        } catch (DBException ex)    {
            ex.printStackTrace();
        }
        // No need to free the two files as they are linked to the fields in this record
        
        return trxMessageHeader;
    }
public TrxMessageHeader addMessageProperties ( TrxMessageHeader trxMessageHeader , MessageDetailTarget recMessageDetailTarget , MessageProcessInfo recMessageProcessInfo , MessageTransport recMessageTransport ) { try { if ( trxMessageHeader == null ) trxMessageHeader = new TrxMessageHeader ( null , null ) ; ContactType recContactType = ( ContactType ) ( ( ReferenceField ) this . getField ( MessageDetail . CONTACT_TYPE_ID ) ) . getReferenceRecord ( null ) ; recContactType = ( ContactType ) recContactType . getContactType ( ( Record ) recMessageDetailTarget ) ; if ( recContactType == null ) return trxMessageHeader ; this . setKeyArea ( MessageDetail . CONTACT_TYPE_ID_KEY ) ; this . getField ( MessageDetail . CONTACT_TYPE_ID ) . moveFieldToThis ( ( BaseField ) recContactType . getCounterField ( ) ) ; this . getField ( MessageDetail . PERSON_ID ) . moveFieldToThis ( ( BaseField ) ( ( Record ) recMessageDetailTarget ) . getCounterField ( ) ) ; this . getField ( MessageDetail . MESSAGE_PROCESS_INFO_ID ) . moveFieldToThis ( ( BaseField ) recMessageProcessInfo . getCounterField ( ) ) ; this . getField ( MessageDetail . MESSAGE_TRANSPORT_ID ) . moveFieldToThis ( ( BaseField ) recMessageTransport . getCounterField ( ) ) ; if ( this . seek ( null ) ) { Map < String , Object > propHeader = ( ( PropertiesField ) this . getField ( MessageDetail . PROPERTIES ) ) . loadProperties ( ) ; if ( propHeader == null ) propHeader = new HashMap < String , Object > ( ) ; Map < String , Object > map = trxMessageHeader . getMessageHeaderMap ( ) ; if ( map != null ) map . putAll ( propHeader ) ; else map = propHeader ; trxMessageHeader . setMessageHeaderMap ( map ) ; if ( ( recMessageTransport != null ) && ( ( recMessageTransport . getEditMode ( ) == DBConstants . EDIT_CURRENT ) || ( recMessageTransport . getEditMode ( ) == DBConstants . EDIT_IN_PROGRESS ) ) ) { trxMessageHeader = recMessageTransport . addMessageProperties ( trxMessageHeader ) ; } } } catch ( DBException ex ) { ex . printStackTrace ( ) ; } return trxMessageHeader ; }
Get the message properties for this vendor.
@param strMessageName The message name.
@return A map with the message properties.