This chapter provides a use case for the Notification API that describes how to create a new read notification substitution list and how to create an Oracle Enterprise Repository notification.
This chapter includes the following sections:
The Notification subsystem provides a web services-based mechanism that is used to create Oracle Enterprise Repository notifications.
This section describes the use case using the Notification API. It includes the following topic:
To create a read notification substitution list and create an Oracle Enterprise Repository notification.
Example 24-1 Use Case: Create a Read Notification Substitution List and Create a Notification
String[] lSubstitutions = null; String[] lRecipients = null; String lTemplateType = "asset_registered"; NameValue[] lNameValues = null; lRecipients = new String[] {"[email protected]"}; try { ////////////////////////// // read the existing substitutions based on the given template lSubstitutions = mFlashlineRegistry.notificationSubstitutionsRead(mAuthToken, lTemplateType); ////////////////////////// // create an array of namevalue pairs; a namevalue pair for each required substitution lNameValues = new NameValue[lSubstitutions.length]; // populate the namevalues for(int i=0; i<lSubstitutions.length; i++) { lNameValues[i] = new NameValue(); lNameValues[i].setName(lSubstitutions[i]); lNameValues[i].setValue("valueof-"+lSubstitutions[i]); } //////////////////////////////////////////// // create the notification mFlashlineRegistry.notificationCreate(mAuthToken, lTemplateType, lRecipients, lNameValues); } catch(Exception e) { fail(e.getMessage()); }