To create a new outbound message and use the composition service for the message, do the following:
- Create a new controller command or customize an existing task command to send a message with a certain message ID or name.
- Add a row into MSGTYPES table assign a msgtype_id with a new viewname, based on the command.
- Create a new row with the VIEWNAME in VIEWREG table and assign the devicefmt_id, and JSP template name (with the full path).
- Create a profile in the PROFILE table using the WebSphere Commerce
Administration Console, and assign the message type to the correct transport
(e.g. e-mail) and device format (e.g. standard device format). See
Assigning a transport method to a message type for a site or store. A valid device format ID, as specified in the VIEWREG table, must be specified for each transport to be used. This device format ID (ie. DEVICEFMT_ID) must match with the one added into VIEWREG table to in order to be able to pick the right JSP template file for composition. The following are the values you should use in the VIEWREG table:SOAP XML data transmitted via HTTP = -1 HTTP Browser = Reserved for IBM use Standard Device Format = -3 WebSphere MQ Adapter for XML = -4 WebSphere MQ Adapter for WCS (Legacy message) = -5
- Note: Most out-of-box message types
(regardless for which transport they were designed) are designed to use the
standard device format. What choice to pick is strictly dependent on how the
entries for the VIEWREG table
are created. The default values of device format ID may change in future
releases.
- Create a messaging system object using the SendMsgCmd task command. Use the setMsgType() and setStoreId() initialization services.
- Invoke the SendMsgCmd.execute() method.