Note:
This appendix assumes that you have read Chapter 8, "Extending UIM Through Rulesets" and have an understanding of rulesets, extension points, ruleset extension points, and enabled extension points.This appendix provides information about the Oracle Communications Unified Inventory Management (UIM) base rulesets, which are located in the UIM_Home/cartridges/base/ora_uim_baserulesets.jar file. This appendix provides a description of each base ruleset, and instructions on how to run each base ruleset.
Each base ruleset provides both a DRL file and a GROOVY file.
The Address Range Validation base ruleset validates the content of an input GeographicAddressRange object. If a validation error is encountered, the ruleset logs an error. If a validation error is not encountered, processing continues. You can customize the base ruleset to perform custom validations as required by your business needs, and configure the ruleset to run when an address is associated with an address range in UIM.
To run the base ruleset, perform the following steps. For instructions on how to perform each step, see the Oracle Communications Design Studio Help and the UIM Help.
In Design Studio, import the ora_uim_baseextpts and ora_uim_baserulesets cartridges.
Modify the ADDRESS_RANGE_VALIDATION base ruleset to reflect your business needs regarding validating address ranges.
Save the modified base ruleset.
Deploy the extended ora_uim_baserulesets cartridge, which now contains the modified ADDRESS_RANGE_VALIDATION ruleset.
Create an Inventory project.
The Inventory Project editor appears.
Click the Dependency tab.
Add the ora_uim_baseextpts and ora_uim_baserulesets cartridges as dependencies.
Save the Inventory cartridge.
Within the cartridge, create a global ruleset extension point.
The Ruleset Extension Point-Global editor appears.
Configure the global ruleset extension point as indicated in Table C-1:
Table C-1 Global Ruleset Extension Point Configuration
Ruleset | Point | Placement |
---|---|---|
ADDRESS_RANGE_VALIDATION |
AddressRangeManager_validateAddressForRange |
Instead (There are no core validations. The validateAddresForRange() method exists for the purpose of running custom validations. So, whether you configure the base ruleset to run before, after, or instead, the outcome is the same; the custom validations are the only validations that run.) |
Save the global ruleset extension point.
Build the cartridge and deploy it into UIM.
In UIM, associate an address to an address range.
When you associate an address to an address range, the AddressRangeManager.validateAddressForRange() method is called. This results in the base ruleset running instead the method, thereby running your custom validations.
Because logical devices were enhanced to include the ability to define rate codes. The Convert LD SR1 to SR2 base ruleset updates existing logical devices that were created in UIM prior to release 7.2.2 to have rate codes.
For example, prior to UIM Release 7.2.2, XYZ Logical Device Specification is created and does not define rate codes; all logical devices created in UIM based on XYZ Logical Device Specification do not have rate codes. In UIM 7.2.2, XYZ Logical Device Specification is updated to define rate codes; from UIM 7.2.2 and later, all logical devices created in UIM based on XYZ Logical Device Specification have rate codes. This base ruleset provides the ability to update the existing pre-7.2.2 logical devices to have rate codes that reflect the rate codes XYZ Logical Device Specification now defined.
To run the base ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
Create a text file, input.txt, and save it in a temporary directory, tempDir.
Format the input.txt file as follows:
LogicalDeviceSpecificationName1 LogicalDeviceSpecificationName2 LogicalDeviceSpecificationName3
where LogicalDeviceSpecification is the name of a Logical Device Specification that defines rate codes. The input file can contain multiple Logical Device Specification names, formatted one per line.
Save the input.txt file.
In UIM, in the Tasks panel Administration group, click the Execute Rule link.
The Execute Rule page appears.
From the Ruleset list, select CONVERT_LD_SR1_TO_SR2.
Click Browse.
The Choose File to Upload window appears.
Navigate to tempDir.
Select the input.txt file.
Click Open.
The Choose File to Upload window closes.
In the Execute Rule page, in the upper-right corner, click Process.
The base ruleset runs and, based on the input file content, updates any logical device entities that were created from the specified input Logical Device Specifications. The logical device entities are updated with the rate codes defined for the applicable Logical Device Specification.
The Create Address Characteristic Map base ruleset creates a Map object and populates it with characteristic names and corresponding values. The characteristic names and values are mapped from a GeographicAddress object that is input to the ruleset, and the characteristics in the GeographicAddress are derived from the Place specification from which the input GeographicAddress entity was created.
For example, the MyPlace Place specification defines characteristics of address, city, state, and zipCode, as well as a default value for each. In UIM, when a place is created from the MyPlace Place specification, the characteristics are populated with the default values defined in the Place specification. The place is saved as a GeographicPlace object. If the Create Address Characteristic Map base ruleset is called passing in this place, the result is a Map object containing the characteristics of address, city, state, and zipCode, and the corresponding value for each.
The Create Address Characteristic Map base ruleset is a supporting ruleset that is called by the Find Address Range and Validate Address For Range base rulesets. The Create Address Characteristic Map ruleset is not intended to be configured to run through a ruleset extension point. See "Find Address Range" and "Validate Address for Range" for more information, and where modifying the Create Address Characteristic Map base ruleset is a step in the instructions for running these base rulesets.
The Find Address Range base ruleset finds an AddressRange that is valid for the input GeographicAddress, and returns the found AddressRange through the ruleset context. You can customize the base ruleset to find the AddressRange based on customized criteria from the input GeographicAddress, and configure the ruleset to run when you search for an address range for a specific address.
The Find Address Range base ruleset calls the Create Address Characteristic Map base ruleset. See "Create Address Characteristic Map" for more information about this supporting base ruleset.
To run the base ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
In Design Studio, import the ora_uim_baseextpts and ora_uim_baserulesets cartridges.
Modify the FIND_ADDRESS_RANGE base ruleset to reflect your business needs regarding finding an address range.
Modify the CREATE_ADDRESS_CHARACTERISTIC_MAP base ruleset, which the FIND_ADDRESS_RANGE ruleset calls.
See "Create Address Characteristic Map" for more information.
Save the modified base ruleset.
Deploy the extended ora_uim_baserulesets cartridge, which now contains the modified FIND_ADDRESS_RANGE ruleset.
Create an Inventory project.
The Inventory Project editor appears.
Click the Dependency tab.
Add the ora_uim_baseextpts and ora_uim_baserulesets cartridges as dependencies.
Save the Inventory cartridge.
Within the cartridge, create a global ruleset extension point.
The Ruleset Extension Point-Global editor appears.
Configure the global ruleset extension point as indicated in Table C-2:
Save the global ruleset extension point.
Build the cartridge and deploy it into UIM.
In UIM, search for an address range for a specific address.
When you search for an address range for a specific address, the AddressRangeManager.findAddressRange() method is called. This results in the base ruleset running instead the method, where your customized search criteria is then used to find the address range.
The Import Inventory base ruleset does the following, using an input text file that provides a telephone number ID, a logical device account ID, and an equipment ID:
Creates an instance of a telephone number if it does not exist
Creates an instance of a logical device account if it does not exist
Creates an instance of equipment if it does not exist
Validates and creates a custom involvement between the telephone number and logical device account
Validates and creates a custom involvement between the logical device account and equipment
To run the base ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
In Design Studio, create the following specifications, which will be used by the ruleset to create telephone numbers, logical device accounts, and equipment:
Telephone Number Specification
Logical Device Account Specification
Equipment Specification
Save the specifications.
Deploy the cartridge containing the specifications you just created.
Import the ora_uim_baserulesets cartridge into Design Studio.
Modify the IMPORT_INVENTORY ruleset to reflect the specification names you just created.
Save the modified base ruleset.
Deploy the extended ora_uim_baserulesets cartridge, which now contains the modified Import Inventory ruleset.
Create an input text file, input.txt, and save it in a temporary directory, tempDir.
Format the content of the comma delimited input.txt file as follows:
TN,LDA,EQUIP TelephoneNumberId,LogicalDeviceAccountId,EquipmentId
where TN, LDA, and EQUIP are the attribute names defined in the ruleset, and where TelephoneNumberId, LogicalDeviceAccountId, and EquipmentId are the corresponding values of the attributes. The file format requires a minimum of one set of attribute values, but multiple sets of attribute values can also be specified.
Save the input.txt file.
In UIM, in the Tasks panel Administration group, click the Execute Rule link.
The Execute Rule page appears.
From the Ruleset list, select IMPORT_INVENTORY.
Click Browse.
The Choose File to Upload window appears.
Navigate to tempDir.
Select the input.txt file.
Click Open.
The Choose File to Upload window closes.
In the Execute Rule page, in the upper-right corner, click Process.
The base ruleset runs and, based on the input file content, telephone numbers, logical devices, and equipment are created if the supplied IDs are not found. The ruleset also creates custom involvements between any supplied telephone numbers and logical devices, and creates custom involvements between ant supplied logical device accounts and equipment.
The Place Format Identifier ruleset defines the display format of the Formatted Identifier field for places that are associated with a specific Place specification. The field is comprised of the characteristics defined for the Place specification with which the place is associated. This ruleset runs in UIM whenever the Formatted Identifier field displays for a place. Figure C-1 shows the Place Summary page for an address where the ruleset concatenates the State, City, Zip Code, Country, Address Line 1, and Address Line 2 characteristics to set the Formatted Identifier field.
To modify the ruleset, open it in Design Studio and modify the boldface code in Example C-1 if using Drools, or in Example C-2 if using Groovy. The default code randomly appends the characteristics defined for the specification. By modifying the code, you can specify the characteristics to include in the display, and you can specify the order in which the characteristics appear in the display.
Example C-1 Place Format Identifier Rule (Drools)
rule "Locations" salience 0 when place : GeographicPlace() eval(place instanceof GeographicLocation) then // execute for location StringBuilder formattedIdentifier = new StringBuilder(); List pc = new ArrayList(place.getCharacteristics()); if (pc != null) { for(int i=0;i<pc.size();i++) { String value = ((PlaceCharacteristic)pc.get(i)).getValue(); if (value != null) formattedIdentifier.append(value).append(" "); } } place.setFormattedIdentifier(formattedIdentifier.toString().trim()); end rule "Addresses" salience 0 when place : GeographicPlace() eval(place instanceof GeographicAddress) then // execute for address StringBuilder formattedIdentifier = new StringBuilder(); List pc = new ArrayList(place.getCharacteristics()); if (pc != null) { for(int i=0;i<pc.size();i++) { String value = ((PlaceCharacteristic)pc.get(i)).getValue(); if (value != null) formattedIdentifier.append(value).append(" "); } } place.setFormattedIdentifier(formattedIdentifier.toString().trim()); end
Example C-2 Place Format Identifier Rule (Groovy)
if (place instanceof GeographicLocation) { // execute for location StringBuilder formattedIdentifier = new StringBuilder(); List pc = new ArrayList(place.getCharacteristics()); if (pc != null) { for(int i=0;i<pc.size();i++) { String value = ((PlaceCharacteristic)pc.get(i)).getValue(); if (value != null) formattedIdentifier.append(value).append(" "); } } place.setFormattedIdentifier(formattedIdentifier.toString().trim()); } if (place instanceof GeographicAddress) { // execute for address StringBuilder formattedIdentifier = new StringBuilder(); List pc = new ArrayList(place.getCharacteristics()); if (pc != null) { for(int i=0;i<pc.size();i++) { String value = ((PlaceCharacteristic)pc.get(i)).getValue(); if (value != null) formattedIdentifier.append(value).append(" "); } } place.setFormattedIdentifier(formattedIdentifier.toString().trim()); }
To run the base ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
In Design Studio, import the ora_uim_baseextpts and ora_uim_baserulesets cartridges.
Modify the PLACE_FORMAT_IDENTIFER ruleset as described above to reflect the needs of your UIM environment.
Save the modified base ruleset.
Deploy the extended ora_uim_baserulesets cartridge, which now contains the modified PLACE_FORMAT_IDENTIFIER ruleset.
Create an Inventory project.
The Inventory Project editor appears.
Click the Dependency tab.
Add the ora_uim_baseextpts and ora_uim_baserulesets cartridges as dependencies.
Save the Inventory cartridge.
Within the cartridge, create a ruleset extension point.
The Ruleset Extension Point editor appears.
Configure the ruleset extension point as indicated in Table C-3:
Save the ruleset extension point.
Within the cartridge, create another ruleset extension point.
The Ruleset Extension Point editor appears.
Configure the ruleset extension point as indicated in Table C-4:
Save the ruleset extension point.
Because you are working with specification-based extension points, you must also configure any applicable Place Specifications for the ruleset extension points by doing the following for each applicable Place specification:
Note:
You do not need to create enabled extension points to configure the Place Specifications; the ora_uim_baseextpts cartridge provides the following base enabled extension points, which enable the PlaceManager_createGeographicPlace and PlaceManager_updateGeographicPlace specification-based extension points for the Place Specification:PlaceSpecification_PlaceManager_createGeographicPlace
PlaceSpecification_PlaceManager_updateGeographicPlace
Open the Place Specification editor.
Click the Rules tab.
Click Select.
The Add Entities window appears.
Select the two ruleset extension points that you just created.
Click OK.
The Add Entities window closes, and the Place Specification is now configured for the two ruleset extension points.
Save the Place Specification.
Build the cartridge and deploy it into UIM.
In UIM, create or update a place.
When a place is created or updated, the PlaceManager.createGeographicPlace() method or PlaceManager.updateGeogrphicPlace() method is called. This results in the base ruleset running after, which uses the customized formatting to display the Place Summary Formatted Identifier field.
The Reservation Check Redeemer ruleset enables reservation redemption validations in UIM. By default, reservation redemption validations are disabled in UIM.
In UIM, you can reserve resources to prevent them from being used by other entities or processes. If the reservation is not redeemed by the expiry date, the resource is released back into inventory. You redeem a reserved resource when you assign the resource to a configuration item. By default, UIM does not validate the redemption to ensure that it matches the reservation. So, you may wish to use this ruleset to enable reservation redemption validations.
See UIM Concepts for more information about reservations.
To run the ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
In Design Studio, import the ora_uim_baseextpts and ora_uim_baserulesets cartridges.
Create an Inventory project.
The Inventory Project editor appears.
Click the Dependency tab.
Add the ora_uim_baseextpts and ora_uim_baserulesets cartridges as dependencies.
Save the Inventory cartridge.
Within the cartridge, create a global ruleset extension point.
The Ruleset Extension Point-Global editor appears.
Configure the global ruleset extension point as indicated in Table C-5:
Save the global ruleset extension point.
Build the cartridge and deploy it into UIM.
In UIM, assign a reserved resource to a configuration item.
When you assign a reserved resource to a configuration item, the ReservationManager.checkRedeemer() method is called. This method simply returns false, which results in reservation redemption validations being disabled. Conversely, the base ruleset simply returns true. So, when you configure the base ruleset to run instead of the ReservationManager.checkRedeemer() method, reservation redemption validations are enabled. When enabled, and you assign a reserved resource to a configuration item, you are required to enter valid reservation information to redeem the reservation.
Note:
If you enable reservation validations through the base ruleset and then later decide you want to disable reservation validations, modify the ruleset to return false and redeploy the cartridge.The Reservation Expiration base ruleset customizes the reservation expiration process by setting a custom value for the expiry interval when expiring reservations.
When a reservation is created, you can set an expiry date. The expiry date indicates when resource a resource is no longer reserved and the resource returns to the Unassigned state. If no expiry date is set when the reservation is created, the expiry date is calculated and set based on a default interval specified in the UIM_Home/config/consumer.properties file. The default interval indicates the period of time that must elapse before a resource is no longer reserved and returns to the Unassigned state.
The reservation expiration process runs at timed intervals, as specified in the UIM_Home/config/timers.properties file. When the reservation expiration process runs, reservations are checked to see if the expiry date has been reached. If the expiry date has been reached, the reservation is deleted and the resource is returned to the Unassigned state.
The Reservation Expiration ruleset is used to customize the telephone number aging process, which is configured to run at timed intervals specified in the UIM_Home/config/timers.properties file. Reservation expiration is the process of checking reservations to see if the expiry date has been reached. The Reservation Expiration ruleset provides a way to customize the stateExpiry interval for telephone numbers in the Disconnected state. At the specified timed intervals, the ruleset queries for telephone numbers in the Disconnected or Transitional state. If a telephone number is the Disconnected state, the ruleset transitions the state to Transitional, and if a telephone number is the Transitional state, the ruleset transitions the state to Unassigned.
To run the base ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
In Design Studio, import the ora_uim_baseextpts and ora_uim_baserulesets cartridges.
Modify the RESERVATION_EXPIRATION ruleset to reflect the needs of your UIM environment regarding reservation expiration for short term or long term reservations, or both.
Save the modified base ruleset.
Deploy the extended ora_uim_baserulesets cartridge, which now contains the modified RESERVATION_EXPIRATION ruleset.
Create an Inventory project.
The Inventory Project editor appears.
Click the Dependency tab.
Add the ora_uim_baseextpts and ora_uim_baserulesets cartridges as dependencies.
Save the Inventory cartridge.
Within the cartridge, create a global ruleset extension point.
The Ruleset Extension Point-Global editor appears.
Configure the global ruleset extension point as indicated in Table C-6:
Save the global ruleset extension point.
Build the cartridge and deploy it into UIM.
Modify following property values in the UIM_Home/config/timers.properties file as needed for your UIM environment configuration:
cleanReservation.firstTime
cleanReservation.period
See UIM System Administrator's Guide for more information about the timers.properites file.
Save the modified timers.properties file.
ReservationManager.expireReservation() is automatically called at the timer intervals you specified in the timers.properties file. When ReservationManager_expireReservation() is called, the ruleset runs instead of the method, as specified by the global ruleset extension point. The ruleset runs your custom code and sets the custom expiry interval for short term or long term reservations, or both.
The System Export and System Import rulesets are used to manage UIM data. For example, you may wish to create a new UIM test environment and load the test environment with data from another UIM environment, or you may wish to export UIM data to send the data upstream in the order fulfillment process.
The System Export ruleset exports database entities into XML-formatted output files, places the XML files in a ZIP file, and returns the ZIP file. Input to the System Export ruleset is a text file that specifies the export configuration. The input text file name is arbitrary, but it is commonly named config.txt. The config.txt file is also returned in the ZIP file, along with the XML files.
The export configuration specified in the config.txt file defines two sections:
Queries must be in the form of:
ClassName#QueryString
where ClassName is the data object representation of the database table you are querying, and QueryString is a valid query statement. For example:
oracle.communications.inventory.api.entity.TelephoneNumberSpecification#o.name LIKE 'Sample' oracle.communications.inventory.api.entity.TelephoneNumberSpecification#o.lastModifiedUser='inventory'
When defining the queries section in the config.txt file:
You must pre-pend all attribute names with o because the table name is hard-coded to have an alias of o in the extensibility framework.
You can specify multiple queries within a single config.txt file.
Parameters must be in the form of:
commitSize=NumericValue duplicateAction=ActionEnumValue relationshipsToInclude=IncludeEnumValue
Where NumericValue, ActionEnumValue, and IncludeEnumValue are described as values for the commitSize, duplicateAction, and relationshipsToInclude parameters as follows:
commitSize: numeric value greater than 1 and up to a reasonable export size. The default value is 1000.
duplicateAction: action to take when duplicate data is encountered in the target data store. Options are:
Update: (default) any duplicate record is updated with the newly imported data values.
Ignore: do not process, skip the duplicate record.
Error: when a duplicate record exists in the target data store, report it as such and end the transaction without taking any action.
relationshipsToInclude: describes how to process objects that are related to the selected entity. Options are:
Meta: (default) only include relationships that are metadata type relationships, such as specification relationships.
Data: only include relationships that are business data in nature, such as characteristics.
All: include all relationships including metadata and normal business data associations.
None: do not include any relationships and only process the integral type attributes of the selected entity.
For example:
commitSize=1000 duplicateAction=Error relationshipsToInclude=Meta
When defining the parameters section in the config.txt file:
You must place the parameters section directly after the queries section.
You may specify all, some, or none of the parameters. Any parameters not specified assume the default value.
Caution:
The System Export ruleset exports data from the UIM database. Metadata Services (MDS) stores additional data used by the UIM UI in the presentation of specifications and characteristics. The export ruleset does not export this additional data from the MDS.If you are using System Export to export data from environment A, along with System Import to import data into environment B, you can do the following to work around the issue:
Run the System Export ruleset in environment A.
Run the System Import ruleset in environment B.
Deploy the cartridge or cartridges that define the specifications and characteristics that were previously deployed into environment A (resulting in the additional specification and characteristic data being stored in the MDS) into environment B.
If you are using the System Export ruleset without System Import, for example to send data upstream, this is not an issue.
The System Import ruleset imports previously exported XML-formatted data into the system and returns a count of the records imported. Input to the System Import ruleset is the ZIP file returned by the System Export ruleset; the ZIP file contains the XML files.
Note:
To perform the System Import, you must deploy all the same cartridges, that are deployed the System Export environment, to the System Import environment as well.Caution:
Prior to importing data, you must check the data in the XML files for entity IDs that are duplicates of any entity IDs already in the system into which you are importing. If you find duplicate entity IDs, modify the entity IDs in the XML file prior to importing the data.The way UIM handles duplicate IDs during import depends on the value of the DuplicateAction parameter specified in the config.txt file. (The config.txt file is available to the System Import ruleset because the input is the ZIP file returned from the System Export ruleset; and the ZIP file contains the XML files and the config.txt file.)
To run the base rulesets, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
Create a text file, config.txt, and save it in a temporary directory, tempDir.
Format the config.txt file as described above in the "Exporting Data" section.
Save the config.txt file.
In the UIM environment from where you plan to export data, in the Tasks panel Administration group, click the Execute Rule link.
The Execute Rule page appears.
From the Ruleset list, select SYSTEM_EXPORT.
Click Browse.
The Choose File to Upload window appears.
Navigate to tempDir.
Select the config.txt file.
Click Open.
The Choose File to Upload window closes.
In the Execute Rule page, in the upper-right corner, click Process.
The base ruleset runs and, based on the queries and parameters specified in the config.txt file, exports the data to a ZIP file.
When the process completes, a message displays on the UIM Execute Rule page, informing you of the number of records processed, and the location and name of the created ZIP file. For example:
Processed 85 Records Successfully.
Exported Inventory to the location:
/share/uimcluster/domains/clusterUim722b385/UIM/tmp/xmldata/uimuser1/export/xmlexport.zip
Click Download File to save xmlexport.zip to a temporary directory.
The File Download window appears.
Click Save.
The Save As window appears.
Navigate to a temporary directory and click Save.
If necessary, copy xmlexport.zip to a location that can be accessed from the UIM environment where you plan to import the data. (If the UIM environments from which you are exporting and importing are running on the same machine, you do not need to perform this step.)
In the UIM environment where you plan to import the data that you just exported, in the Tasks panel Administration group, click the Execute Rule link.
The Execute Rule page appears.
From the Ruleset list, select SYSTEM_IMPORT.
Click Browse.
The Choose File to Upload window appears.
Navigate to the temporary directory that contains the xmlexport.zip file.
Select the xmlexport.zip file.
Click Open.
The Choose File to Upload window closes.
In the Execute Rule page, in the upper-right corner, click Process.
The base ruleset runs and, based on the xmlexport.zip file content, imports the data.
The Telephone Number Formatting base ruleset defines the telephone number length and display format of telephone numbers in UIM. The ruleset defines a default edit mask that is applied to all telephone numbers, unless otherwise specified. The ruleset can also define additional edit masks that apply to specified Telephone Number specifications. The ruleset runs in UIM when working with telephone numbers and applies a default edit mask of 10 digits (##########).
To modify the base ruleset in Design Studio, scroll to the FUNCTIONS section of the code. You can modify the default edit mask, the specification name and corresponding edit mask, or both. You can also replicate the code and define multiple edit masks that are specific to a particular specification. In Example C-3, the boldface code is the code you need to modify.
Example C-3 Telephone Number Formatting Rule (Drools)
//-------------------------------------------------------------------- // FUNCTIONS //-------------------------------------------------------------------- function String getEditMask(TelephoneNumberSpecification tnSpec) { // The character # is reserved and represents a required digit. // The default mask is eight required digits. String editMask = "##########"; if ( tnSpec == null ) return editMask; // Define the edit mask based on the spec name if(tnSpec.getName().equals("TNspec NPA-NXX")) editMask = "###-###-####"; return editMask; } //------------------------------------------------------------------- // RULES //------------------------------------------------------------------- rule "Get TN Edit Mask" salience 0 when telephoneNumberSpecification : TelephoneNumberSpecification() context : ExtensionPointRuleContext() then String editMask = getEditMask(telephoneNumberSpecification); context.setReturnValue(editMask); end
Example C-4 Telephone Number Formatting Rule (Groovy)
//------------------------------------------------------------------- // FUNCTIONS //------------------------------------------------------------------- def String getEditMask(TelephoneNumberSpecification tnSpec) { // The character # is reserved and represents a required digit. // The default mask is eight required digits. String editMask = "##########"; if ( tnSpec == null ) return editMask; // Define the edit mask based on the spec name if(tnSpec.getName().equals("TNspec NPA-NXX")) editMask = "###-###-####"; return editMask; } //------------------------------------------------------------------- // RULE //------------------------------------------------------------------- log.debug ("", "Get TN Edit Mask"); String editMask = getEditMask(telephoneNumberSpecification); context.setReturnValue(editMask);
Example C-5 (Drools) and Example C-6 (Groovy) show the modified portion of the Telephone Formatting rule in boldface. (The only difference between the two examples is that Drools defines a function and Groovy defines a def.)
In these examples, the modified rule redefines the default edit mask length format from 10 digits to 11 digits. The examples also redefine the telephone number display format for telephone numbers created from the NANPA telephone number specification to display as +# (xxx) xxx-xxxx. For example, +1 (972) 555-8495.
Example C-5 Telephone Number Formatting Rule (Drools)
function String getEditMask(TelephoneNumberSpecification tnSpec) { // The character # is reserved and represents a required digit. // The default mask is eleven required digits. String editMask = "###########"; if ( tnSpec == null ) return editMask; // Define the edit mask based on the spec name if(tnSpec.getName().equals("NANPA")) editMask = "+# (###) ###-####"; return editMask; }
Example C-6 Telephone Number Formatting Rule (Groovy)
def String getEditMask(TelephoneNumberSpecification tnSpec) { // The character # is reserved and represents a required digit. // The default mask is eleven required digits. String editMask = "###########"; if ( tnSpec == null ) return editMask; // Define the edit mask based on the spec name if(tnSpec.getName().equals("NANPA")) editMask = "+# (###) ###-####"; return editMask; }
From this point forward, all telephone numbers created from the NANPA telephone number specification and the TELEPHONE_NUMBER_FORMATTING ruleset are based on the new default length and display format. Any telephone numbers created from the NANPA telephone number specification prior to this ruleset being deployed do not reflect this new default length and display format, nor will they; the telephone number formatting is not applied retroactively.
You can also modify the telephone number default edit mask in the number.properties file. See UIM System Administrator's Guide for more information.
To run the base ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
In Design Studio, import the ora_uim_baseextpts and ora_uim_baserulesets cartridges.
Modify the TELEPHONE_NUMBER_FORMATTING ruleset as described above to reflect the needs of your UIM environment.
Save the modified base ruleset.
Deploy the extended ora_uim_baserulesets cartridge, which now contains the modified TELEPHONE_NUMBER_FORMATTING ruleset.
Create an Inventory project.
The Inventory Project editor appears.
Click the Dependency tab.
Add the ora_uim_baseextpts and ora_uim_baserulesets cartridges as dependencies.
Save the Inventory cartridge.
Within the cartridge, create a ruleset extension point.
The Ruleset Extension Point editor appears.
Configure the ruleset extension point as indicated in Table C-7:
Save the ruleset extension point.
Because you are working with a specification-based extension point, you must also configure any applicable Telephone Specifications for the ruleset extension point by doing the following for each applicable Telephone Number specification:
Note:
You do not need to create an enabled extension point to configure the Telephone Number Specifications; the ora_uim_baseextpts cartridge provides the following base enabled extension point, which enables the SpecManager_getEditMask specification-based extension point for the Telephone Number Specification:TelephoneNumberSpecification_SpecManager_getEditMask
Open the Telephone Number Specification editor.
Click the Rules tab.
Click Select.
The Add Entities window appears.
Select the ruleset extension point that you just created.
Click OK.
The Add Entities window closes, and the Telephone Number Specification is now configured for the ruleset extension point.
Save the Telephone Number Specification.
Build the cartridge and deploy it into UIM.
In UIM, create or update a telephone number.
When you create or update a telephone number, the SpecManager_getEditMask() method is called. This results in the ruleset running instead of the method, which applies the default edit mask or specified edit mask to the telephone number and displays the number accordingly.
Note:
Telephone number formatting is not applied retroactively. If you change the formatting for a telephone number specification, the change is not applied to existing telephone numbers created from the specification prior to the edit mask change. However, the change is applied to any new telephone numbers you create from the specification.The Telephone Number Grading base ruleset is no longer used. However, the ruleset provides a good example of how to set a characteristic or field, such as country code, when a telephone number is created.
The Telephone Number Grading base ruleset is no longer used, but provides a good ruleset example to follow when creating custom rulesets.
Note:
The Trail Pipe Topology Edge base ruleset is valid for use with Connectivity - Pipe entities; it is not valid for use with Connectivity - Channelized entities.The Trail Pipe Topology Edge base ruleset provides a way for a trail pipe to become a topology edge, which makes the trail pipe be included in the topology and available for path analysis.
In pipe connectivity, all trail pipes are topology edged. However, in channelized connectivity, trail pipes that ride channelized pipes are not topology edges and not available for path analysis. So, you may wish to use this ruleset in channelized connectivity to make trail pipes that ride channelized pipes topology edges so they are included in the topology and available for path analysis.
To run the ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
In Design Studio, import the ora_uim_baseextpts and ora_uim_baserulesets cartridges.
Create an Inventory project.
The Inventory Project editor appears.
Click the Dependency tab.
Add the ora_uim_baseextpts and ora_uim_baserulesets cartridges as dependencies.
Save the Inventory cartridge.
Within the cartridge, create a ruleset extension point.
The Ruleset Extension Point editor appears.
Configure the ruleset extension point as indicated in Table C-8:
Save the ruleset extension point.
Because you are working with a specification-based extension point, you must also configure any applicable Pipe specifications for the ruleset extension point by doing the following for each applicable Pipe specification:
Note:
You do not need to create an enabled extension point to configure the Pipe Specifications; the ora_uim_baseextpts cartridge provides the following base enabled extension point, which enables the TopologyMapper_createEnabledByPipesTopologyEdge specification-based extension point for the Pipe Specification:PipeSpecification_TopologyMapper_createEnabledByPipesTopologyEdge
Open the Pipe Specification editor.
Click the Rules tab.
Click Select.
The Add Entities window appears.
Select the ruleset extension point that you just created.
Click OK.
The Add Entities window closes, and the Pipe Specification is now configured for the ruleset extension point.
Save the Pipe Specification.
Build the cartridge and deploy it into UIM.
In UIM, within a topology model, enable a trail pipe through one or more pipes and save the pipes.
Saving a pipe calls the processPipe() method, which eventually calls the TopologyMapper_createEnabledByPipesTopologyEdge method.
When the TopologyMapper.createEnabledByPipesTopologyEdge() method is called, the ruleset is called instead.
The Validate Address For Range base ruleset takes in a GeographicAddressRange and a GeographicAddress and determines whether the given address range is valid for the given address. If valid, the ruleset returns the valid geographic address range through the ruleset context. If not valid, the ruleset returns null. You can customize the base ruleset to perform custom validations as required by your business needs, and configure the ruleset to run when an address is associated with an address range in UIM.
The Validate Address for Range base ruleset calls the Create Address Characteristic Map base ruleset. See "Create Address Characteristic Map" for more information.
To run the base ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
In Design Studio, import the ora_uim_baseextpts and ora_uim_baserulesets cartridges.
Modify the VALIDATE_ADDRESS_FOR_RANGE base ruleset to reflect your business needs regarding validating address ranges.
Modify the CREATE_ADDRESS_CHARACTERISTIC_MAP base ruleset, which the VALIDATE_ADDRESS_FOR_RANGE ruleset calls.
See "Create Address Characteristic Map" for more information.
Save the modified base ruleset.
Deploy the extended ora_uim_baserulesets cartridge, which now contains the modified VALIDATE_ADDRESS_FOR_RANGE ruleset.
Create an Inventory project.
The Inventory Project editor appears.
Click the Dependency tab.
Add the ora_uim_baseextpts and ora_uim_baserulesets cartridges as dependencies.
Save the Inventory cartridge.
Within the cartridge, create a global ruleset extension point.
The Ruleset Extension Point-Global editor appears.
Configure the global ruleset extension point as indicated in Table C-9:
Table C-9 Global Ruleset Extension Point Configuration
Ruleset | Point | Placement |
---|---|---|
VALIDATE_ADDRESS_FOR_RANGE |
AddressRangeManager_validateAddressForRange |
Instead (There are no core validations. The validateAddresForRange() method exists for the purpose of running custom validations. So, whether you configure the base ruleset to run before, after, or instead, the outcome is the same; the custom validations are the only validations that run.) |
Save the global ruleset extension point.
Build the cartridge and deploy it into UIM.
In UIM, associate an address to an address range.
When you associate an address to an address range, the AddressRangeManager.validateAddressForRange() method is called. This results in the base ruleset running instead the method, thereby running your custom validations.
The Validate Relate Places base ruleset validates the existence of a parent-child relationship between two input GeographicAddress objects by determining if the specifications from which the graphic addresses were created have a parent-child relationship.
To run the base ruleset, perform the following steps. For instructions on how to perform each step, see the Design Studio Help and the UIM Help.
In Design Studio, import the ora_uim_baseextpts and ora_uim_baserulesets cartridges.
Create an Inventory project.
The Inventory Project editor appears.
Click the Dependency tab.
Add the ora_uim_baseextpts and ora_uim_baserulesets cartridges as dependencies.
Save the Inventory cartridge.
Within the cartridge, create a ruleset extension point.
The Ruleset Extension Point editor appears.
Configure the ruleset extension point as indicated in Table C-10:
Save the ruleset extension point.
Because you are working with a specification-based extension point, you must also configure any applicable Place specifications for the ruleset extension point by doing the following for each applicable Place specification:
Note:
You do not need to create an enabled extension point to configure the Place Specifications; the ora_uim_baseextpts cartridge provides the following base enabled extension point, which enables the PlaceManager_relatePlaces specification-based extension point for the Place Specification:PlaceSpecification_PlaceManager_relatePlaces
Open the Place Specification editor.
Click the Rules tab.
Click Select.
The Add Entities window appears.
Select the ruleset extension point that you just created.
Click OK.
The Add Entities window closes, and the Place Specification is now configured for the ruleset extension point.
Save the Place Specification.
Build the cartridge and deploy it into UIM.
In UIM, relate two places.
When you relate two places, the PlaceManager.relatePlaces() method is called. This results in the ruleset running before the method, which validates the relationship between the geographic places before establishing the relationship between them.