The BOM module operates at the highest level; below the PSE user interface and above the PS module. It is oriented toward the presentation of and interaction with product structure and encompasses the application of configuration rules. The BOM module is used for general operations, such as creating reports and editing structure. It pulls together information from items, item revisions, BOMView revisions and occurrences to present them as entries in a bill of materials.
• Product Structure (PS) Module
The PS module handles product structure operations at a lower level. It is also responsible for the creation and manipulation of the basic structure objects (in other words, BOMViews and occurrences).
This module is most useful for large scale import of structure data into
Teamcenter or batch operation to update specific structure attributes where the overhead of building up the full presentation of BOM-related information is not required.
Bill of Materials (BOM) Module
The BOM module is intended to give a consistent interface to the separate elements that make up a line in a bill of materials. The design assumes that you have a BOM window (which may be a printed report or a screen window) showing a bill of materials made up of BOM lines. Each BOM line shows attributes derived from items, item revision, occurrences and so on; along with some attributes belonging to the BOM line itself. None of the individual objects the line represents (for example,
is_packed) are shown.
The names of the attributes give a clue as to which object they are derived from; you can ignore that and treat them all as BOM line attributes. Although some attributes are standard and listed in the bom_attr.h file, others are defined at runtime (for
Chapter 8 Product Structure Management
The BOM module is described in two parts. The first part is for those who want to produce a report listing a bill of materials. Following this is more detail describing other functions needed for editing the bill and using more complicated facilities.
Producing a Report
When producing a report, there are certain procedures that you must follow.
Create a BOM Window
The first thing you have to do is create a BOM window with a call to the
BOM_create_window function. The window may need some default settings. For
example, default lines are not packed and the configuration rule is the user’s default one (if defined); otherwise it is the latest with any status.
To change the configuration rule, you have to ask for the configuration rule and then use the CFM ITK routines to modify it.
Defining What to Display
Next, call the BOM_set_window_top_line function to say what the window displays a bill of materials on. This routine takes an item, item revision and BOM view as arguments, but most of them can be NULLTAGs.
If item revision is non-null, then that particular revision is used. If it is NULLTAG, then a non-null item must be given and the configuration rule is used to determine the revision.
If the BOM view is non-null, then it is used. Otherwise, the oldest one is used. Until multiple views are used, there is never more than one BOM view in an item.
Finding Children for a BOM Line
Given a BOM line, you can find its children using the BOM_line_ask_child_lines function. To find attributes of a line, you have to call the
BOM_line_ask_attribute_xxx function, where xxx depends on whether
you are asking about a tag, string, integer, logical or double. Before you can call the
ask_attribute function, however, you need to find the attribute ID for the attribute
you want to ask about.
Finding an Attribute ID
If you know what attribute you want, you can use the BOM_line_look_up_attribute function to translate its name to an ID. Otherwise, you have to use the
BOM_line_list_attributes function to find all available ones and then work out
which you want.
Product Structure Management
The read-only flag is true if the attribute cannot be changed. For example, assume that the name attribute is built up from the item ID, revision ID and so on. As such, the name cannot be changed. To change the name attribute, you have to change the item ID directly.
Because an attribute is not read-only does not mean you can set that attribute on any particular line. If the line shows released data, the
set_attribute fails.
The internal/external flag is intended to say whether the attribute was defined internally (and might be expected to be available the next time you run the program) or externally (by virtue of reflecting an occurrence note type; so it may not exist in some other run of the program).
If you are looking for data that is not available as an attribute (for example, a dataset in the item revision of some BOM line), you can use the tag attributes (item revision tag, in this case) to find the underlying object. Next, use ITK queries on the object
A simple program displaying all attributes should ignore tag attributes as being meaningless to display.