9 Using Rulesets for Bills of Materials

This chapter provides information about using rulesets to extend Oracle Communications Unified Inventory Management (UIM) Bills of Materials (BOMs).

See UIM Concepts for more information about BOMs.

About Cost Information for Bills of Materials

BOMs can be generated for engineering work orders, business interactions, and projects. Retrieving the BOM cost information is based on the resource and task specification tags. A database table is provided for storing the cost information. You must either write a SQL script that populates this table or provide your own method of storing and retrieving the cost information to fit your requirements.

Extending BOM Manager Methods

You can customize BOM data by using extension points in the BOMManager API interface, which generates BOMs. This interface includes methods that you can use or override to perform the following customizations:

  • Provide your own cost retrieval functionality. You can extend the getCostFromReference() method with custom logic replacing this functionality. The getCostFromReference() method retrieves the cost for a specified cost reference ID. A string is the single input parameter to this method and it returns the cost value as a string. The input parameter is the cost reference tag provided in Design Studio. You can override this method and provide your own cost retrieval functionality. By default, this method retrieves and returns the COST field from the COSTREFERENCE table. The default SQL query is the following:

    SELECT COST FROM COSTREFERENCE WHERE COSTREFERENCEID = input_value
    

    where input_value is the cost reference ID key for the table row. See "Cost References" for more information.

  • Provide additional information about BOM activities by using the populateAdditionInfoOnActivity() method. This method populates the Activity class attributes with information. The method takes the following input parameters:

    • BillOfMaterialActivity item

    • Activity object

    You can provide functionality that populates the Activity object attributes as needed. By default, this method is empty.

  • Provide additional information about BOM resources by using the populateAdditionalInfoOnResource() method. This method populates the inventory resource class attributes with information. The method takes the following input parameters:

    • BillOfMaterialResource item

    • Inventory object (resource)

    You can provide functionality that populates the resource object attributes as needed. By default, this method is empty.

  • Customize the format of BOMs by using the toXML() method on the BillOfMaterial object that is generated by the getBOM() method. The getBOM() method generates and returns a BillOfMaterial object. The method takes the following input parameters:

    • BOMEntityType (project or business interaction)

    • String for the entity identifier (the project name or business interaction ID)

    • BOMType (activity, quote, resource, or engineering type)

    You can use the toXML() method to format the output: for example, as a report or spreadsheet.

Cost References

BOMs can include cost information. Cost information for a resources or task is generated when the cost reference tag is associated with the entity specification. The tag includes a cost reference ID. By default, UIM uses the cost reference ID to retrieve the cost from a database table named COSTREFERENCE. You can populate this table by using a SQL script. Table 9-1 describes the required columns for the COSTREFERENCE table.

Table 9-1 COSTREFERENCE Table Columns

Column Name Type

COSTREFERENCEID

String

COST

String

You can modify this default behavior. For example, you can call a third-party system or access a custom database table.

A cost reference tag can be associated with a specification in Design Studio. A cost reference ID must begin with the string costreferenceid- as a prefix. The private getCostReference() method finds the tag matching this prefix. This method uses the costreferenceid field as the key to look up the cost value.

Example 9-1 shows a snippet of the getCostReference() private method that shows how the tag is retrieved from the TagSpecificationRel object.

Example 9-1 getCostReference() Method Snippet

private String getCostReference(Specification spec) {
.
.
.
       List<TagSpecificationRel> Tags = spec.getTags();
       for (TagSpecificationRel tag : Tags) {
           Tag itemTag = tag.getTag();
           if (itemTag.getName().startsWith("costreferenceid-")) {
               return itemTag.getOtherInformation();
           }
       }
.
.
.
}