{{tag>Programmers_Reference Methods IChannelType_Interface getMessageValues Index}}
====getMessageValues ()====
public DataObject getMessageValues (IchannelTypeCallback callback)
This method is called when a notification is sent to an intelligent business object. The method is supposed to return the values that are specific to the communication with this particular instance of the object – for example, an e-mail address of this instance. The method can use a callback interface to get the instance of the object and the instance of the SystemSettings object, like so:
IEntity intelligentEntity = callback.getEntity ();
IEntity systemSettings = callback.getSystemSettings ();
The method is supposed to return the data object containing specific values, or null if none are required. As an example, take a look at what the e-mail channel does:
public DataObjectgetMessageValues(IChannelTypeCallbackcallback)
{
IEntityentity=callback.getEntity();
if (entity==null)
return null;
try
{
StringemailAddr=(String)entity.getAttributeValue(CommonConstants.EMAIL_ADDRESS_ATTR);
SDOTypedobType=new SDOType("EmailChannelEmailValues");
dobType.addAttribute(CommonConstants.EMAIL_ADDRESS_ATTR,SDOType.STRING);
DataObjectdob= new SimpleDataObject(dobType);
dob.setAttributeValue(CommonConstants.EMAIL_ADDRESS_ATTR,emailAddr);
return dob;
}
catch (Exceptione)
{
System.err.println("Unable to read e-mail address in object "+entity.getName());
}
return null;
}