Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| pr_methods:getmessagevalue [2023/04/04 06:59] – removed - external edit (Unknown date) 127.0.0.1 | pr_methods:getmessagevalue [2023/05/03 04:32] (current) – sean | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | {{tag> | ||
| + | ====getMessageValues ()==== | ||
| + | <code java> | ||
| + | |||
| + | 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: | ||
| + | |||
| + | <code java> | ||
| + | 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: | ||
| + | |||
| + | <code java> | ||
| + | { | ||
| + | IEntityentity=callback.getEntity(); | ||
| + | if (entity==null) | ||
| + | return null; | ||
| + | try | ||
| + | { | ||
| + | StringemailAddr=(String)entity.getAttributeValue(CommonConstants.EMAIL_ADDRESS_ATTR); | ||
| + | SDOTypedobType=new SDOType(" | ||
| + | dobType.addAttribute(CommonConstants.EMAIL_ADDRESS_ATTR, | ||
| + | DataObjectdob= new SimpleDataObject(dobType); | ||
| + | dob.setAttributeValue(CommonConstants.EMAIL_ADDRESS_ATTR, | ||
| + | return dob; | ||
| + | } | ||
| + | catch (Exceptione) | ||
| + | { | ||
| + | System.err.println(" | ||
| + | } | ||
| + | return null; | ||
| + | }</ | ||