#BOM_sos_unset_entry
#BOM_option_ask_allowed_ints
#BOM_option_ask_allowed_reals
#BOM_option_ask_allowed_strings
Authoring ITK
The following ITKs deal with the creation and editing of Modular Variants.
It essentially provides a way to getting and setting MVL.
MVL has 2 distinct areas - the option declaration statements and the language expressions.
These are dealt with via separate functions in the ITK.
#BOM_line_ask_mvl_condition
#BOM_line_set_mvl_condition
#BOM_line_ask_mvl
#BOM_line_set_mvl
#BOM_item_module_list_options
#BOM_module_ask_option_text
#BOM_line_delete_option
#BOM_line_define_option
Additional ITK
#BOM_option_where_declared2
#BOM_option_where_used2
@{
*/
/**
Ask the BOM line for it's current SOS - or selected option set.
The SOS objects that are created are owned by a particular BOMLine.
When the bomline becomes invalid this will invalidate all the SOS objects it owns.
An SOS can be deleted earlier by calling #BOM_sos_free.
*/
extern BOM_API int BOM_line_ask_sos(
tag_t bom_line, /**< (I) */
tag_t* sos /**< (O) */
);
/**
Effectively applies an "empty" SOS to the bomline,
so that on the next evaluation all options will be unset.
*/
extern BOM_API int BOM_line_clear_sos(
tag_t bom_line, /**< (I) */
logical doUpdates /**< (I) */
);
/**
This applies the SOS to its associated BOMLine.
The structure will be evaluated and any changes will be reflected in this SOS.
This also makes this SOS the current one for the bom line.
(i.e. calling #BOM_line_ask_sos will return the same SOS object).
The do updates means that the window will be updated with changes (and the UI).
Otherwise an evaluation occurs, but the results are not kept.
*/
extern BOM_API int BOM_sos_apply(
tag_t sos, /**< (I) */
logical doUpdates /**< (I) */
);
/**
This applies the SOS to its associated BOMLine.
The structure will be evaluated and any changes will be reflected in this SOS.
This also makes this SOS the current one for the bom line.
(i.e. calling #BOM_line_ask_sos will return the same SOS object)
*/
extern BOM_API int BOM_sos_apply_list(
int count, /**< (I) */
tag_t* sos, /**< (I) count */
logical doUpdates /**< (I) */
);
/**
Frees the memory associated with the current SOS.
The tag will be made invalid.
*/
extern BOM_API int BOM_sos_free(
tag_t sos /**< (I) */
);
/**
Displays any Options and Variants Engine(OVE) messages that occur as a consequence of the MVL expressions "error",
"warn" or "inform" are executed.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM errors
*/
extern BOM_API int BOM_window_ask_ove_messages(
tag_t bom_window, /**< (I) The BOM Window */
int* n_errors, /**< (O) Number of errors */
int** severities, /**< (OF) n_errors The error severities */
char*** messages, /**< (OF) n_errors The error messages.
The array is packed, which means that the memory is deallocated calling #MEM_free on the container only. */
tag_t** lines /**< (OF) n_errors BOMLines having OVE errors */
);
/**
Performs Options and Variants Engine(OVE) validation on a bom line,
and optionally on all structure below the line as well.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM errors
*/
extern BOM_API int BOM_line_ove_validate(
tag_t line, /**< (I) Tag of BOM Line */
logical recurse, /**< (I) If true then recursively all structure under @p line would be validated */
int* count, /**< (O) Count of errors */
int** error_types, /**< (OF) count Types of Error */
tag_t** lines, /**< (OF) count Tags of BOM Lines having OVE errors */
int** options /**< (OF) count OVE options */
);
/**
Parses the input Options and Variants Engine(OVE) path and generates an array of Path Elements.
@returns
- #ITK_ok on success.
- Possibly other OVE errors.
*/
extern BOM_API int BOM_decompose_ove_path(
const char* path, /**< (I) Options and Variants Engine(OVE) path */
int* count, /**< (O) Count of Options and Values specified in @p path */
char*** pathElements /**< (OF) Strings of Options and Values specified in @p path as per the @p count */
);
/**
Asks the current options that are in the SOS. The return is 4 lists.
The item and option name define a unique option, and the type is an enum describing each option' type
- string/real/integer/logical. The how_set list describes how the option is set (unset/default/user set/etc.)
*/
extern BOM_API int BOM_sos_ask_entries(
tag_t sos, /**< (I) */
int* count, /**< (O) */
int** options, /**< (OF) count */
char*** paths /**< (OF) count */
);
/**
This gets the value that the option is set to in the SOS.
*/
extern BOM_API int BOM_sos_ask_entry_int(
tag_t sos, /**< (I) */
int option, /**< (I) */
const char* path, /**< (I) */
int* value, /**< (O) */
int* how_set /**< (O) An element of the #BOM_option_how_set_t enumeration defined in bom_tokens.h */
);
/**
This gets the value that the option is set to in the SOS.
*/
extern BOM_API int BOM_sos_ask_entry_double(
tag_t sos, /**< (I) */
int option, /**< (I) */
const char* path, /**< (I) */
double* value, /**< (O) */
int* how_set /**< (O) An element of the #BOM_option_how_set_t enumeration defined in bom_tokens.h */
);
/**
This gets the value that the option is set to in the SOS.
*/
extern BOM_API int BOM_sos_ask_entry_logical(
tag_t sos, /**< (I) */
int option, /**< (I) */
const char* path, /**< (I) */
logical* value, /**< (O) */
int* how_set /**< (O) An element of the #BOM_option_how_set_t enumeration defined in bom_tokens.h */
);
/**
This gets the value that the option is set to in the SOS.
*/
extern BOM_API int BOM_sos_ask_entry_display(
tag_t sos, /**< (I) */
int option, /**< (I) */
const char* path, /**< (I) */
char** value, /**< (OF) */
int* how_set /**< (O) An element of the #BOM_option_how_set_t enumeration defined in bom_tokens.h */
);
/**
This sets the value that the option is set to in the SOS.
*/
extern BOM_API int BOM_sos_set_entry_int(
tag_t sos, /**< (I) */
int option, /**< (I) */
const char* path, /**< (I) */
int value, /**< (I) */
int how_set /**< (I) An element of the #BOM_option_how_set_t enumeration defined in bom_tokens.h */
);
/**
This sets the value that the option is set to in the SOS.
*/
extern BOM_API int BOM_sos_set_entry_double(
tag_t sos, /**< (I) */
int option, /**< (I) */
const char* path, /**< (I) */
double value, /**< (I) */
int how_set /**< (I) An element of the #BOM_option_how_set_t enumeration defined in bom_tokens.h */
);
/**
This sets the value that the option is set to in the SOS.
*/
extern BOM_API int BOM_sos_set_entry_logical(
tag_t sos, /**< (I) */
int option, /**< (I) */
const char* path, /**< (I) */
logical value, /**< (I) */
int how_set /**< (I) An element of the #BOM_option_how_set_t enumeration defined in bom_tokens.h */
);
/**
This sets the value that the option is set to in the SOS.
*/
extern BOM_API int BOM_sos_set_entry_string(
tag_t sos, /**< (I) */
int option, /**< (I) */
const char* path, /**< (I) */
const char* value, /**< (I) */
int how_set /**< (I) An element of the #BOM_option_how_set_t enumeration defined in bom_tokens.h */
);
/**
This unsets the value that the option is set to in the SOS.
*/
extern BOM_API int BOM_sos_unset_entry(
tag_t sos, /**< (I) */
int option, /**< (I) */
const char* path /**< (I) */
);
/**
Retrieves the option path from input Options and Variants Engine(OVE) option.
@returns
- #ITK_ok on success.
- Possibly other OVE errors.
*/
extern BOM_API int BOM_ask_option_path(
int option, /**< (I) Options and Variants Engine(OVE) option */
char** path /**< (OF) Options and Variants Engine(OVE) path */
);
/**
This asks what string values are allowed on
*/
extern BOM_API int BOM_option_ask_allowed_strings(
int option, /**< (I) */
int* count, /**< (O) */
char*** values, /**< (OF) count */
char** default_value /**< (OF) */
);
/**
This asks what integer values are allowed on an option.
As an option may consist of multiple discontinuous ranges each value is given as a min and max and a range_type.
Range type can be as follows:
Range Type | Min contains | Max contains | Means |
Fixed | The value | N/A | A single fixed value |
Min | Min value | N/A | Allow values are \>min |
Max | N/A | Max value | Allow values are \ |
Range | Min value | Max value | min \< value \< max |
Open | N/A | N/A | Any valid integer |
*/
extern BOM_API int BOM_option_ask_allowed_ints(
int option, /**< (I) */
int* count, /**< (O) */
int** mins, /**< (OF) count */
int** maxs, /**< (OF) count */
int** range_types, /**< (OF) count */
int* default_value /**< (O) */
);
/**
This asks what real values are allowed on an option.
As an option may consist of multiple discontinuous ranges each value is given as a min and max and a range_type.
*/
extern BOM_API int BOM_option_ask_allowed_reals(
int option, /**< (I) */
int* count, /**< (O) */
double** mins, /**< (OF) count */
double** maxs, /**< (OF) count */
int** range_types, /**< (OF) count */
double* default_value /**< (O) */
);
extern BOM_API int BOM_option_ask_logical_default(
int option, /**< (I) */
logical* default_value /**< (O) */
);
/**
Retrieves the condition string.
*/
extern BOM_API int BOM_line_ask_mvl_condition(
tag_t line, /**< (I) */
char** condition /**< (OF) */
);
/**
Sets the MVL condition.
*/
extern BOM_API int BOM_line_set_mvl_condition(
tag_t line, /**< (I) */
const char* condition /**< (I) */
);
/**
Gets the MVL from the item (revision) that is configured by this line
*/
extern BOM_API int BOM_line_ask_mvl(
tag_t line, /**< (I) */
char** mvl /**< (OF) */
);
/**
Sets the MVL on the item (revision) that is configured by this line.
Note that this will attempt to lock the item revision for modify.
#BOM_save_window must be called to commit this change and unlock the item rev.
#BOM_refresh_window will lose all changes (on all bom lines in the current window)
and unlock the item rev.
*/
extern BOM_API int BOM_line_set_mvl(
tag_t line, /**< (I) */
const char* mvl /**< (I) */
);
/**
Gets the MVL declaration of the option
*/
extern BOM_API int BOM_module_ask_option_text(
int option, /**< (I) */
char** text /**< (OF) */
);
/**
Creates or replaces the modular option defined by option text.
It also checks if an option with the same name already exists before adding the new option.
@returns
- #ITK_ok on success
- #BOM_option_already_exists if the option already exists
- #BOM_invalid_tag for invalid line tag
- #BOM_line_type_is_not_supported if the input @p line is GDE Line
- Possibly other OVE errors
*/
extern BOM_API int BOM_line_define_option(
tag_t line, /**< (I) The BOM Line */
const char* text /**< (I) Modular option text */
);
/**
Removes the option from the module.
*/
extern BOM_API int BOM_line_delete_option(
tag_t line, /**< (I) */
int option /**< (I) */
);
/**
Modifies an existing option
*/
extern BOM_API int BOM_line_modify_option
( tag_t line, /**< (I) */
int option, /**< (I) */
const char *text /**< (I) */
);
/** @} */
/**
@name SOS Storage and Retrieval
@{
*/
/**
Reads input StoredOptionSet into the given BOMVariantConfig.
@returns
- #ITK_ok on success
- #BOM_no_bomsos_target for no StoredOptionSet
- #BOM_invalid_tag for invalid input config
- #BOM_no_variantrule_target for invalid input config having NULL Variant rule
*/
extern BOM_API int BOM_sos_db_read(
tag_t db_sos, /**< (I) Stored Option Set */
tag_t config /**< (I) BOM Variant Configuration */
);
/**
Creates a selection of options and their values as a new StoredOptionSet
using input StoredOptionSet name and BOMVariantConfig.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid input config
- Possibly other OVE errors
*/
extern BOM_API int BOM_sos_db_create(
const char* db_sos_name, /**< (I) StoredOptionSet name */
tag_t config, /**< (I) BOMVariantConfig */
tag_t* db_sos /**< (O) StoredOptionSet */
);
/**
Writes a selection of options and their values. Creates or updates
the StoredOptionValues for the current configuration.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid input config
- Possibly other OVE errors
*/
extern BOM_API int BOM_sos_db_set(
tag_t db_sos, /**< (I) StoredOptionSet */
tag_t config /**< (I) BOMVariantConfig */
);
/**
Writes explicit selection of options and their values as a new StoredOptionSet.
Note an option that does not match the StorageRule will not be written out
even if it is explicitly listed.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid input config
- Possibly other OVE errors
*/
extern BOM_API int BOM_sos_db_create_partial(
const char* db_sos_name, /**< (I) StoredOptionSet name */
tag_t config, /**< (I) BOMVariantConfig */
int count, /**< (I) Count of Items having modularOptions */
tag_t* items, /**< (I) count */
char** options, /**< (I) count */
logical* is_modular, /**< (I) count */
tag_t* db_sos /**< (O) StoredOptionSet */
);
/**
Writes explicit selection of options and their values.
The @p is_modular array defines if each specified option is modular or legacy (true => modular).
If only one source (BOM StoredOptionSet or BOM Variant rule) is specified then @p is_modular can be passed as null.
If both sources are defined but @p is_modular is null, then it will try both.
@note An option that does not match the StorageRule will not be written out even if it is explicitly listed.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid input config
- Possibly other OVE errors
*/
extern BOM_API int BOM_sos_db_set_partial(
tag_t db_sos, /**< (I) StoredOptionSet */
tag_t config, /**< (I) BOMVariantConfig */
int count, /**< (I) Count of Items having modularOptions */
tag_t* items, /**< (I) count */
char** options, /**< (I) count */
logical* is_modular /**< (I) count */
);
/**
Retrieves details of all options in StoredOptionSet, along with values in string form.
@returns
- #ITK_ok on success
- #BOM_internal_error with user defined error message for any invalid operation
- Possibly other OVE errors
*/
extern BOM_API int BOM_sos_db_contents(
tag_t db_sos, /**< (I) StoredOptionSet */
int* count, /**< (O) Count of Items having modularOptions */
tag_t** items, /**< (OF) count Tags of Items having modularOptions */
char*** options, /**< (OF) count Modular Options */
int** option_types, /**< (OF) count Option Types */
int** value_types, /**< (OF) count Option ValueTypes */
int** how_set, /**< (OF) count An element of the #BOM_option_how_set_t enumeration defined in bom_tokens.h */
char*** values /**< (OF) count Option Values. The array is packed, which means that the memory is deallocated by calling #MEM_free on the container only */
);
/**
Finds StoredOptionSets that contain all input options.
@returns
- #ITK_ok on success
- #BOM_internal_error with user defined error message for any invalid operation
- Possibly other OVE errors
*/
extern BOM_API int BOM_sos_db_option_query(
int n, /**< (I) Count of Items having modularOptions */
tag_t* items, /**< (I) n Tags of Items having modularOptions */
char** options, /**< (I) n Modular Options */
int* n_matches, /**< (O) Count of StoredOptionSets matched all input options */
tag_t** matches /**< (OF) n_matches Tags of StoredOptionSets */
);
/**
Finds StoredOptionSets that have all input options with operator based value matching.
@returns
- #ITK_ok on success
- #BOM_internal_error with user defined error message for any invalid operation
- Possibly other OVE errors
*/
extern BOM_API int BOM_sos_db_query(
int n, /**< (I) Count of Items having modularOptions */
tag_t* items, /**< (I) n Tags of Items having modularOptions */
char** options, /**< (I) n Modular Options */
int* ops, /**< (I) n Operators */
int* value_types, /**< (I) n Option ValueTypes */
char** low_values, /**< (I) n Low Expression Values. If no values then just query for StoredOptionSets containing input options */
char** high_values, /**< (I) n High Expression Values */
int* n_matches, /**< (O) Count of matched StoredOptionSets */
tag_t** matches /**< (OF) n_matches Tags of StoredOptionSets */
);
/** @} */
/**
@name BOM Variant configuration functions
@{
*/
/**
Creates BOMVariantConfig based on input BOM variant rule and StoredOptionSets.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOM Variant rule or BOM StoredOptionSets
*/
extern BOM_API int BOM_create_variant_config(
tag_t bom_vrule, /**< (I) BOM Variant rule */
int count, /**< (I) Count of BOM StoredOptionSets */
tag_t* bom_sos_list, /**< (I) count Tags of BOM StoredOptionSets */
tag_t* bom_variant_config /**< (O) BOMVariantConfig */
);
/**
Creates BOMVariantConfig based on input BOM window and BOM Variant Configuration.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the specified @p bom_window is invalid
*/
extern BOM_API int BOM_create_window_variant_config(
tag_t bom_window, /**< (I) The BOM Window */
int mode, /**< (I) The default mode is #BOM_VARIANT_CONFIG_REF: 0. Expected values are:
- #BOM_VARIANT_CONFIG_COPY: 1
- #BOM_VARIANT_CONFIG_MANAGED: 2
- #BOM_VARIANT_CONFIG_DEEP: 4
*/
tag_t* bom_variant_config /**< (O) BOMVariantConfig */
);
/**
Creates BOMVariantConfig based on input BOM Line and BOM Variant Configuration.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOM Line
*/
extern BOM_API int BOM_create_bomline_variant_config(
tag_t bom_line, /**< (I) Tag of BOM Line */
int mode, /**< (I) The default mode is #BOM_VARIANT_CONFIG_REF: 0. Expected values are:
- #BOM_VARIANT_CONFIG_COPY: 1
- #BOM_VARIANT_CONFIG_MANAGED: 2
- #BOM_VARIANT_CONFIG_DEEP: 4
*/
tag_t* bom_variant_config /**< (O) BOMVariantConfig */
);
/**
Deletes input BOMVariantConfig.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOMVariantConfig
*/
extern BOM_API int BOM_delete_variant_config(
tag_t bom_variant_config /**< (I) BOMVariantConfig */
);
/**
Applies BOM StoredOptionSets and then BOM variant rule from input BOMVariantConfig and attaches the same rule with current window.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOMVariantConfig
*/
extern BOM_API int BOM_variant_config_apply(
tag_t bom_variant_config /**< (I) BOMVariantConfig */
);
/**
Clears BOM StoredOptionSets and BOM variant rule from input BOMVariantConfig.
Unsets all option values, and unloads the current SVR. BOMWindow gets refreshed by the clear.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOMVariantConfig
*/
extern BOM_API int BOM_variant_config_clear(
tag_t bom_variant_config /**< (I) BOMVariantConfig */
);
/**
Applies BOM StoredOptionSets and then BOM variant rule from input BOMVariantConfig and restores the BOMWindow's previous config.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOMVariantConfig
*/
extern BOM_API int BOM_variant_config_evaluate(
tag_t bom_variant_config /**< (I) BOMVariantConfig */
);
/**
Copies input BOMVariantConfig.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOMVariantConfig
*/
extern BOM_API int BOM_variant_config_copy(
tag_t source_config, /**< (I) BOMVariantConfig */
logical deepCopy, /**< (I) If true, BOM Variant Configuration mode would be #BOM_VARIANT_CONFIG_COPY + #BOM_VARIANT_CONFIG_DEEP otherwise #BOM_VARIANT_CONFIG_COPY
*/
tag_t* new_config /**< (O) BOMVariantConfig */
);
/**
Sets the input BOM Variant rule.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOMVariantConfig
*/
extern BOM_API int BOM_set_variant_config_bomvrule(
tag_t bom_variant_config, /**< (I) BOMVariantConfig */
tag_t bom_vrule, /**< (I) Can be #NULLTAG to delete the current BOM Variant rule */
int mode /**< (I) Dedicated operation mode. Valid values are:
- #BOM_VARIANT_CONFIG_REF
- #BOM_VARIANT_CONFIG_COPY
- #BOM_VARIANT_CONFIG_MANAGED
- #BOM_VARIANT_CONFIG_DEEP
*/
);
/**
Sets the input BOM StoredOptionSet. When input bom_sos is NULL then existing
BOM StoredOptionSet would be removed which means existing modes would be Shuffled up one place.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOMVariantConfig or BOM Line or BOM StoredOptionSet
*/
extern BOM_API int BOM_set_variant_config_bomsos(
tag_t bom_variant_config, /**< (I) BOMVariantConfig */
tag_t bom_line, /**< (I) Tag of BOM Line */
tag_t bom_sos, /**< (I) StoredOptionSet */
int mode /**< (I) Dedicated operation mode. Valid values are:
- #BOM_VARIANT_CONFIG_REF
- #BOM_VARIANT_CONFIG_COPY
- #BOM_VARIANT_CONFIG_MANAGED
- #BOM_VARIANT_CONFIG_DEEP
*/
);
/**
Retrieves BOM Variant rule and BOM StoredOptionSets for input BOMVariantConfig.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOMVariantConfig
*/
extern BOM_API int BOM_ask_variant_config(
tag_t bom_variant_config, /**< (I) BOMVariantConfig */
tag_t* bom_vrule, /**< (O) BOM Variant rule */
int* count, /**< (O) count of BOM StoredOptionSet */
tag_t** bomsoslist /**< (OF) count */
);
/**
Retrieves BOM Window and Root BOM Line for input BOMVariantConfig.
@returns
- #ITK_ok on success
- #BOM_invalid_tag for invalid BOMVariantConfig
*/
extern BOM_API int BOM_ask_variant_config_context(
tag_t bom_variant_config, /**< (I) BOMVariantConfig */
tag_t* bom_window, /**< (O) BOM Window */
tag_t* root_bom_line /**< (O) Root BOM Line */
);
/** @} */
/**
Creates a variant item (VI) to store the BOM line's configuration.
A VI is an item created as an instantiation of a generic component.
It contains a saved selected option set (SOS) for the module that the BOM line represents.
This SOS cannot be changed throughout the lifetime of the item.
Restrictions:
The BOM line must be fully configured: each option must have a value.
*/
extern BOM_API int BOM_line_create_vi(
tag_t line, /**< (I) The BOM line for which a VI will be created */
logical is_linked_to_generic_component, /**< (I) True if the VI structure is to be validated against
the structure that it instantiates.
If false, the VI structure can be altered so that it is
different from that of its generic component's structure. */
const char* item_id, /**< (I) Item identification number. No two Items can have
the same identification string. A null is allowed.
If null, the system will automatically generate an Item ID. */
const char* item_name, /**< (I) Item name. A common name or short description of the Item. */
const char* type_name, /**< (I) A null is allowed for this argument.
It can be used to specify a defined Item type. */
const char* rev_id, /**< (I) Identification string (revision ID)
of the Item Revision being created. A null is allowed.
If null, the system will automatically generate a revision ID */
tag_t* new_item, /**< (O) Tag for identifying the Item in the current program */
tag_t* new_rev /**< (O) Tag for identifying the Item Revision in the current program */
);
/**
Takes the values of the stored option set contained within a variant item and
uses these to populate the values of a BOM line's selected option set.
*/
extern BOM_API int BOM_line_configure_in_vi(
tag_t line, /**< (I) The BOM line to be configured using the variant item stored option set */
tag_t variant_item /**< (I) The variant item to be configured into the BOM line (item tag) */
);
/**
For a given BOM window, this method provides an array of currently loaded BOM lines that represent generic components.
*/
extern BOM_API int BOM_window_ask_generic_components(
tag_t window, /**< (I) The BOM window being queried */
int* generic_component_count, /**< (O) The number of BOM lines that are generic (not variant items) */
tag_t** generic_component_lines /**< (OF) generic_component_count The BOM lines whose item revisions are modules */
);
/**
Determines if it is possible to identify variant item reuse of the
given BOM line using the parent search criteria.
Reuse identification of variant items of a BOM line is only possible if
all the options in the BOM line have been presented to the parent.
*/
extern BOM_API int BOM_line_ask_can_search_for_vi_from_parent(
tag_t line, /**< (I) The BOM line being queried */
logical* reuseIdIsPossible /**< (O) True if reuse identification is possible, otherwise false */
);
/**
This method is used aid identification of component reuse within a module structure.
It identifies search criteria needed to find VIs within the given BOM line from
criteria defined for a VI search within the parent.
Reuse identification of VIs of the BOM line is only possible if
all the options in the BOM line have been presented to the parent.
*/
extern BOM_API int BOM_line_map_vi_requirements_from_parent(
tag_t line, /**< (I) The BOM line (variant module) within which
reuse identification is to be carried out */
int n, /**< (I) Search criteria used to find VIs in the parent BOM line (see #ITEM_vi_find) */
tag_t* items, /**< (I) n Search criteria used to find VIs in the parent BOM line (see #ITEM_vi_find) */
char** options, /**< (I) n Search criteria used to find VIs in the parent BOM line (see #ITEM_vi_find) */
int* ops, /**< (I) n Search criteria used to find VIs in the parent BOM line (see #ITEM_vi_find) */
int* valueTypes, /**< (I) n Search criteria used to find VIs in the parent BOM line (see #ITEM_vi_find) */
char** lowValues, /**< (I) n Search criteria used to find VIs in the parent BOM line (see #ITEM_vi_find) */
char** highValues, /**< (I) n Search criteria used to find VIs in the parent BOM line (see #ITEM_vi_find) */
int* n_out, /**< (O) Search criteria that can be used to identify VIs in the
BOM line passed in as argument line.
If reuse identification is not possible, then an error code is returned. */
tag_t** items_out, /**< (OF) n_out Search criteria that can be used to identify VIs in the
BOM line passed in as argument line.
If reuse identification is not possible, then an error code is returned. */
char*** options_out, /**< (OF) n_out Search criteria that can be used to identify VIs in the
BOM line passed in as argument line.
If reuse identification is not possible, then an error code is returned. */
int** ops_out, /**< (OF) n_out Search criteria that can be used to identify VIs in the
BOM line passed in as argument line.
If reuse identification is not possible, then an error code is returned. */
int** valueTypes_out, /**< (OF) n_out Search criteria that can be used to identify VIs in the
BOM line passed in as argument line.
If reuse identification is not possible, then an error code is returned. */
char*** lowValues_out, /**< (OF) n_out Search criteria that can be used to identify VIs in the
BOM line passed in as argument line.
If reuse identification is not possible, then an error code is returned. */
char*** highValues_out /**< (OF) n_out Search criteria that can be used to identify VIs in the
BOM line passed in as argument line.
If reuse identification is not possible, then an error code is returned. */
);
/**
This function returns true if the specified BOM Line has had its stop flag set.
The stop flag is used to control the scope of structure traversal in a BOM compare.
*/
extern BOM_API int BOM_line_is_stopped(
tag_t line, /**< (I) The BOM line being queried */
logical* is_stopped /**< (O) True if the specified BOM line has its stop flag set */
);
/**
This function sets the stop flag on the specified BOM Line.
The stop flag is used to control the scope of structure traversal in a BOM compare.
*/
extern BOM_API int BOM_line_set_stop(
tag_t line /**< (I) The BOM line being stopped */
);
/**
This function clears the stop flag on the specified BOM Line.
The stop flag is used to control the scope of structure traversal in a BOM compare.
*/
extern BOM_API int BOM_line_clear_stop(
tag_t line /**< (I) The BOM line being cleared */
);
/**
Clears the stop flag on the specified BOM Line and all BOM Lines below it in the product structure.
The stop flag is used to control the scope of structure traversal in a BOM compare.
*/
extern BOM_API int BOM_line_clear_all_stops(
tag_t line /**< (I) The root BOM line being cleared */
);
/**
Assigns a child line to a BOM line,
and keeps the association between the source line and the new created child line.
*/
extern BOM_API int BOM_line_assign_child_line(
tag_t line, /**< (I) */
tag_t sourceLine, /**< (I) */
char* occType, /**< (I) */
tag_t* newChildLine /**< (O) */
);
/**
Asks if the BOM window is displaying unconfigured BOM lines.
*/
extern BOM_API int BOM_window_shows_unconfigured(
tag_t window, /**< (I) Tag of the window */
logical* shows_unconfigured /**< (O) True if unconfigured BOM lines are shown */
);
/**
Flags the BOMWindow to display BOMLines that are not configured for Occurrence Effectivity.
@note The window supplied must have a root line:
You cannot call this immediately after #BOM_create_window.
*/
extern BOM_API int BOM_window_show_unconfigured(
tag_t window /**< (I) Tag of the window */
);
/**
Flags the BOMWindow to hide BOMLines that are not configured for Occurrence Effectivity.
@note The window supplied must have a root line:
You cannot call this immediately after #BOM_create_window.
*/
extern BOM_API int BOM_window_hide_unconfigured(
tag_t window /**< (I) Tag of the window */
);
/**
Make the BOM window to filter creating unconfigured bomlines due to classic variants
*/
extern BOM_API int BOM_window_filter_unconfigured_classic_variants(
tag_t window /**< (I) Tag of the window */
);
/**
Asks if the BOM window is displaying unconfigured BOM lines.
*/
extern BOM_API int BOM_window_filters_unconfigured_classic_variants(
tag_t window, /**< (I) Tag of the window */
logical* filter_unconfigured /**< (O) True if filters unconfigured BOM lines due to classic variants */
);
/**
Set closure rule for the BOM window.
*/
extern BOM_API int BOM_window_set_closure_rule(
tag_t window, /**< (I) Tag of the window */
tag_t closure_rule, /**< (I) Tag of Closure Rule */
int n_variables, /**< (I) number of variables in closure rule */
char** variable_names, /**< (I) variable names */
char** variable_values /**< (I) variable values */
);
/**
Asks if the BOM window is displaying Guided Component Search Connection Point BOM lines.
*/
extern BOM_API int BOM_window_shows_gcs_cps(
tag_t window, /**< (I) Tag of the window */
logical* shows_gcs_cp /**< (O) True if GCS CP BOM lines are shown */
);
/**
Sets the BOM window to display Guided Component Search Connection Point BOM lines.
@note The window supplied must have a root line:
You cannot call this immediately after #BOM_create_window.
*/
extern BOM_API int BOM_window_show_gcs_cps(
tag_t window /**< (I) Tag of the window */
);
/**
Sets the BOM window to hide Guided Component Search Connection Point BOM lines.
@note The window supplied must have a root line:
You cannot call this immediately after #BOM_create_window.
*/
extern BOM_API int BOM_window_hide_gcs_cps(
tag_t window /**< (I) Tag of the window */
);
/**
Asks the value of the show_suppressed_occurrences flag property
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM errors
*/
extern BOM_API int BOM_window_shows_suppressed(
tag_t window, /**< (I) Tag of BOMWindow */
logical *shows_suppressed /**< (O) show_suppressed_occurrences flag */
);
/**
Shows the suppressed occurrences when the show_suppressed_occurrences flag property is true
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM errors
*/
extern BOM_API int BOM_window_show_suppressed(
tag_t window /**< (I) Tag of BOMWindow */
);
/**
Hides the suppressed occurrences when the show_suppressed_occurrences flag property is false
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM errors
*/
extern BOM_API int BOM_window_hide_suppressed(
tag_t window /**< (I) Tag of BOMWindow */
);
/**
@name BOM Compare Functions
Common Return Values
#BOM_no_current_compare - The BOMCompare has not yet been supplied to #BOM_compare_execute
(or #BOM_compare, for the standard internal compare),
or an error occurred during the last such call that invalidated the comparison.
#BOM_no_such_bom_compare_mode - No mode by that name yet registered.
@{
*/
/**
Creates a new BOM Compare object.
This new compare object can then be used in preference to the internal pre-defined object
used by the #BOM_compare call and the User Interface.
This allows multiple BOM Compares to be performed simultaneously.
*/
extern BOM_API int BOM_compare_create(
tag_t* bomcompare /**< (O) New empty BOM Compare object that can be passed into #BOM_compare_execute */
);
/**
Deletes a BOM Compare object.
*/
extern BOM_API int BOM_compare_delete
( tag_t bomcompare /**< (I) BOM Compare object to be deleted */
);
/**
Retrieves an array of valid compare mode names.
Compare modes can set a visibility flag to control whether a
specific mode will show up in the user interface or not.
*/
extern BOM_API int BOM_compare_ask_modes (
logical visible_only, /**< (I) This is for future expansion, and should be set false */
int* n_modes, /**< (O) Number of mode names returned */
char*** mode_names /**< (OF) n_modes Array of mode names */
);
/** @if DOX_IGNORE
(TB) 23-Aug-2001 This directive introduces the header containing the typedefs required for
BOM_compare_visit_engine's auto-generated journalling code. The directive marks a
non-void black-box pointer, in this case, a function pointer. Customers needn't worry about
such lower-case flags.
##include bom/bom_tokens.h
@endif */
/**
Performs a recursive depth-first traversal of the root compare engine and its children,
calling the enter_engine callback for each engine before any of its children,
and calling the leave_engine callback immediately after the final child of that engine.
Apart from the topmost (depth=0) engine, compare engines have an associated compare set that
you may interrogate to retrieve the root lines' key values.
Only compare sets with differing sides, or engines that are the ancestors of such sets, are visited.
For all the call-back functions, returning #ITK_ok indicates success.
Any other value will abort the traversal and cause the function to fail with the same error code.
Any error returned by your callbacks should be returned back to you by this call.
*/
extern BOM_API int BOM_compare_visit_engine (
tag_t bomcompare, /**< (I) BOM Compare object to be queried.
Set this to #NULLTAG to query the standard internal BOMCompare. */
BOM_compare_engine_visitor_t* enter_engine, /**< (Ip) Engine entry callback */
BOM_compare_engine_visitor_t* leave_engine, /**< (Ip) Engine departure callback */
BOM_compare_set_visitor_t* visit_set, /**< (Ip) Set visiting callback */
void* user_data /**< (I) A pointer for the user's use: passed to all callbacks. */
);
/**
Retrieves the name of the mode of the given BOM Compare.
*/
extern BOM_API int BOM_compare_ask_mode (
tag_t bomcompare, /**< (I) BOM Compare object, or #NULLTAG for the standard internal BOMCompare. */
char** mode_name /**< (OF) Name of the BOM Compare's mode */
);
/**
Retrieves the output mode of the given BOM Compare.
*/
extern BOM_API int BOM_compare_ask_output_mode (
tag_t bomcompare, /**< (I) BOM Compare object, or #NULLTAG for the standard internal BOMCompare. */
int* output_mode /**< (O) BOM Compare's output mode */
);
/**
Retrieves the root BOMLines of the given BOM Compare.
*/
extern BOM_API int BOM_compare_ask_root_bomlines (
tag_t bomcompare, /**< (I) BOM Compare object, or #NULLTAG for the standard internal BOMCompare */
tag_t* bomline1, /**< (O) Root BOMLine of the first BOM being compared */
tag_t* bomline2 /**< (O) Root BOMLine of the second BOM being compared */
);
/**
Retrieves the root BOMLines of the given BOM Compare engine.
*/
extern BOM_API int BOM_compare_ask_engine_root_bomlines (
tag_t bomcompareengine, /**< (I) BOM Compare Engine object */
tag_t* bomline1, /**< (O) Root BOMLine of the first BOM being compared */
tag_t* bomline2 /**< (O) Root BOMLine of the second BOM being compared */
);
/**
Creates a new BOM Compare mode.
- Use auto-pack for any multi-level compare based on
the same comparison as packing (by default, item ID and sequence number).
- Use virtual-unpack for comparisons with primary elements that
aren't closely related to the packing condition.
- For multi-level compares based on a comparison that is not
closely related to the packing condition, you're on your own:
recommendation is to fully unpack the structure before you compare it.
Six standard modes are pre-defined to support the modes offered by the old BOM_compare() function.
Primary keys: item id; Aggregate keys: revision and quantity.
#BOM_std_compare_single_level_name
#BOM_std_compare_lowest_level_name
#BOM_std_compare_var_level_name
Primary keys: item id and sequence number; Aggregate keys: revision and quantity.
#BOM_std_compare_single_level_seq_name
#BOM_std_compare_lowest_level_seq_name
#BOM_std_compare_var_level_seq_name
All six have special support for the old style of text report output and bomline properties,
which can be enabled by setting the preferences BOM_compare_legacy_report and
BOM_compare_legacy_properties respectively. User-defined modes cannot have this legacy support.
Return Values:
#BOM_duplicate_bom_compare_mode - A mode by that name already exists.
*/
extern BOM_API int BOM_compare_define_mode (
const char* mode_name, /**< (I) Name of the new compare mode */
int traversal_mode, /**< (I) Will this compare mode be single level (#BOM_compare_singlelevel),
lowest (leaf) level (#BOM_compare_lowestlevel),
or multi-level (#BOM_compare_multilevel)? */
tag_t compare_desc, /**< (I) Compare engine descriptor to be used */
logical visible, /**< (I) This is for future expansion. Set it to false. */
logical autopack, /**< (I) Set this to true if this mode should perform auto-packing */
logical virtualunpack /**< (I) Set this to true if this mode should perform virtual-unpacking */
);
/**
Retrieves details of the named BOM Compare mode.
*/
extern BOM_API int BOM_compare_ask_mode_info (
const char* mode_name, /**< (I) Name of the new compare mode */
int* traversal_mode, /**< (O) Single level, lowest level, or multi level. */
tag_t* compare_desc, /**< (O) Compare engine descriptor */
logical* visible, /**< (O) For future expansion. Ignore this value. */
logical* autopack, /**< (O) Autopacking flag */
logical* virtualunpack /**< (O) Autounpacking flag */
);
/**
Sets the visibility mode for the specified BOM compare mode.
@note This ITK is reserved for future use.
*/
extern BOM_API int BOM_compare_set_visibility (
const char* mode_name, /**< (I) Name of the compare mode to be used (see #BOM_compare_define_mode) */
logical visible /**< (I) The visibility flag is currently unused, set it to false */
);
/**
Retrieves the state of unchanged compare sets in report for specified BOM Compare mode.
@returns
- #ITK_ok on success
- #BOM_no_such_bom_compare_mode if compare mode is invalid
*/
extern BOM_API int BOM_compare_reports_unchanged(
const char* mode_name, /**< (I) Name of the compare mode to be used (see #BOM_compare_define_mode) */
logical* reports_unchanged /**< (O) True indicates unchanged compare sets wil be reported */
);
/**
Sets the state of unchanged compare sets in report for specified BOM Compare mode.
@returns
- #ITK_ok on success
- #BOM_no_such_bom_compare_mode if compare mode is invalid
*/
extern BOM_API int BOM_compare_set_rpt_unchanged(
const char* mode_name, /**< (I) Name of the compare mode to be used (see #BOM_compare_define_mode) */
logical report_unchanged /**< (I) Set to true if you want to report unchanged compare sets */
);
/**
Compares the specified BOM lines. Supports all three compare modes.
Compare output can be directed to the BOM line compare columns,
which can be accessed via the BOM line attribute functions.
Report output can also be obtained.
Alternatively, the BOM compare user exit functions can be used.
All of these output mechanisms can be used simultaneously,
The scope of the compare can be controlled via the BOM line stop flag ITK functions.
These allow a flag to be set on a BOM line which will prevent
the BOM compare from comparing anything below that BOM line.
Restrictions:
Compare does not allow nested BOM lines to be compared.
*/
extern BOM_API int BOM_compare(
tag_t line1, /**< (I) Tag of the first BOM line to be compared */
tag_t line2, /**< (I) Tag of the second BOM line to be compared */
int mode, /**< (I) Compare mode to be used. Can be one of the following:
#BOM_compare_singlelevel
#BOM_compare_lowestlevel
#BOM_compare_multilevel */
int output /**< (I) Output mechanism to be used.
Constructed by adding the following values as required:
#BOM_compare_output_bomline
#BOM_compare_output_userexit
#BOM_compare_output_report */
);
/**
Compares the two BOMs defined by the given BOMLines.
*/
extern BOM_API int BOM_compare_execute(
tag_t bomcompare, /**< (I) BOM Compare object to be used to perform the comparison.
Set this to #NULLTAG to use the standard internal BOMCompare. */
tag_t bomline1, /**< (I) Root BOMLine of the first BOM to be compared */
tag_t bomline2, /**< (I) Root BOMLine of the second BOM to be compared */
const char* mode_name, /**< (I) Name of the compare mode to be used (see #BOM_compare_define_mode) */
int output_to /**< (I) Where to send the compare results (see #BOM_compare for details) */
);
/**
Clears the compare columns from all BOM lines relating to the last compare.
*/
extern BOM_API int BOM_compare_clear(
tag_t compare_context /**< (I) Tag of the compare object (when using BOM_compare_create/execute), or #NULLTAG
(or a relevant bomline tag) to access the global compare object (when using BOM_compare). */
);
/**
Suppresses the specified compare output for the given context.
This is only useful when used in the BOM compare user exit functions.
For example, it can be used to allow a user exit generated report to
replace the standard internal report window.
It seems unlikely you will want to use this other than with the default context.
Restrictions:
It cannot be used to suppress all output.
*/
extern BOM_API int BOM_compare_suppress(
tag_t compare_context, /**< (I) Tag of the compare object (when using BOM_compare_create/execute), or #NULLTAG
(or a relevant bomline tag) to access the global compare object (when using BOM_compare). */
int output /**< (I) Output modes to be suppressed.
Constructed by adding the following values as required:
#BOM_compare_output_bomline
#BOM_compare_output_userexit
#BOM_compare_output_report */
);
/**
Retrieves two lists which contain the BOM lines relating to a particular compare item.
@note The compare item required as an input parameter to this function
is not the same as a Teamcenter Engineering Item.
The tag of the compare item is passed to the BOM compare user exit functions.
It can also be obtained via #BOM_compare_report.
*/
extern BOM_API int BOM_compare_list_bomlines(
tag_t cmp_item, /**< (I) Tag of a compare item */
int* count1, /**< (O) Number of BOM lines in first list */
tag_t** bomline_list1, /**< (OF) count1 Array of BOM line tags from the first compared BOM */
int* count2, /**< (O) Number of BOM lines in second list */
tag_t** bomline_list2 /**< (OF) count2 Array of BOM line tags from the second compared BOM */
);
/**
Retrieves a bit encoded representation of the changes which occurred in
a particular compare item between the two compared BOMs.
Macros are provided to extract the individual flags from the diff_flags.
Use these macros to interrogate the flags:
@code
#include
BOM_cmp_no_diff(diff_flags)
BOM_cmp_added(diff_flags)
BOM_cmp_changed(diff_flags)
BOM_cmp_chg_qty(diff_flags)
BOM_cmp_chg_rev(diff_flags)
@endcode
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM errors
@note The compare item required as an input parameter to this function
is not the same as a Teamcenter Engineering Item.
The tag of the compare item is passed to the BOM compare user exit functions.
It can also be obtained via #BOM_compare_report.
*/
extern BOM_API int BOM_compare_ask_difference(
tag_t cmp_item, /**< (I) Tag of a compare item */
int* diff_flags /**< (O) Bit encoded differences between the two BOMs relating to the compare item */
);
/**
Retrieves the quantities of the specified compare item in each of the compared BOMs.
@note The compare item required as an input parameter to this function
is not the same as a Teamcenter Engineering Item.
The tag of the compare item is passed to the BOM compare user exit functions.
It can also be obtained via #BOM_compare_report.
*/
extern BOM_API int BOM_compare_ask_qty(
tag_t cmp_item, /**< (I) Tag of a compare item. */
double* qty1, /**< (O) Quantity of the item in the first BOM selected for compare. */
double* qty2 /**< (O) Quantity of the item in the first BOM selected for compare.
@note In the quantity output parameters,
a value less than zero indicates a special case.
The exact nature of this special case can be obtained using these macros:
#BOM_cmp_asreq (qty)
If true, then quantity is As Required.
#BOM_cmp_undef (qty)
If true, then quantity is undefined. */
);
/**
Retrieves the revisions of the specified compare item in each of the compared BOMs.
@note The compare item required as an input parameter to this function
is not the same as a Teamcenter Engineering Item.
The tag of the compare item is passed to the BOM compare user exit functions.
It can also be obtained via #BOM_compare_report.
@note In the revision output parameters, ??? means no revision is configured
*/
extern BOM_API int BOM_compare_ask_rev(
tag_t cmp_item, /**< (I) Tag of a compare item */
char** rev1, /**< (OF) Revision of the item in the first BOM selected for compare */
char** rev2 /**< (OF) Revision of the item in the first BOM selected for compare */
);
/**
Retrieves the sequence number of the specified compare item in the compared BOMs.
@note In single-level mode and multi-level mode, the sequence number will be the same in both BOMs.
In lowest-level mode, items with many different sequence numbers can be bundled together,
and the return value from this function could be any one of them.
@note The compare item required as an input parameter to this function
is not the name as a Teamcenter Engineering Item.
The tag of the compare item is passed to the BOM compare user exit functions.
It can also be obtained via #BOM_compare_report.
*/
extern BOM_API int BOM_compare_ask_seqno(
tag_t cmp_item, /**< (I) Tag of a compare item */
char** seqno /**< (OF) Sequence number of the item in the both BOMs. (except in lowest-level mode). */
);
/**
Retrieves a list which contains the BOM lines which have a difference related to them.
It also retrieves a bit encoded representation list of difference flags for those BOM Lines.
Macros are provided to extract the individual flags from the diff_flags.
Use these macros to interrogate the flags:
@code
#include
BOM_cmp_no_diff(diff_flags[i])
BOM_cmp_added(diff_flags[i])
BOM_cmp_changed(diff_flags[i])
BOM_cmp_chg_qty(diff_flags[i])
BOM_cmp_chg_rev(diff_flags[i])
@endcode
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM errors
*/
extern BOM_API int BOM_compare_list_diffs(
tag_t line, /**< (I) Tag of one of the BOM lines which the compare was performed on */
int* diff_count, /**< (O) Number of BOM lines in the list */
tag_t** diff_lines, /**< (OF) diff_count Array of BOM line tags */
int** diff_flags /**< (OF) diff_count Array of flags indicating the disposition of the bomlines compared with the other side */
);
/**
For the nominated compare context (or the default context if the compare context is #NULLTAG),
for the side of the compare on which the nominated bomline is the root,
returns two arrays of length diff_count. One lists the different bomlines,
the other holds flags indicating whether each line is added or different.
For the standard (legacy) modes, additional flags indicate a change in revision and/or quantity also.
Use these macros to interrogate the flags:
@code
#include
BOM_cmp_no_diff(diff_flags[i])
BOM_cmp_added(diff_flags[i])
BOM_cmp_changed(diff_flags[i])
BOM_cmp_chg_qty(diff_flags[i])
BOM_cmp_chg_rev(diff_flags[i])
@endcode
*/
extern BOM_API int BOM_compare_list_diffs_context(
tag_t line, /**< (I) The root line of one side of the compare performed in the compare context */
tag_t context, /**< (I) A compare context (obtained from #BOM_compare_create)
or #NULLTAG for the default context */
int* diff_count, /**< (O) The number of lines in the following two arrays */
tag_t** diff_lines, /**< (OF) diff_count Array of tags of the bomlines */
int** diff_flags /**< (OF) diff_count Array of flags indicating the disposition of
the bomlines compared with the other side */
);
/**
Retrieves a formatted text report of BOM differences.
It also returns an list of the compare items which relate to each report line.
These compare items can then be queried to obtain the original BOM Lines relating to that report line.
@note The compare item returned by this function in the report_items list is not
the same as a Teamcenter Engineering item.
A compare item can only be used in certain BOM compare functions.
*/
extern BOM_API int BOM_compare_report(
tag_t compare_context, /**< (I) Tag of the compare object (when using BOM_compare_create/execute), or #NULLTAG
(or a relevant bomline tag) to access the global compare object (when using BOM_compare). */
int* report_length, /**< (O) Number of lines in the report */
char*** report_lines, /**< (OF) report_length Array of report lines. The first array entry
(report_lines[0]) contains the column headers. */
tag_t** report_items /**< (OF) report_length Array of compare item tags.
Entries which relate to report lines, but are not compare items
(e.g., the column headers) will have their tag set to #NULLTAG. */
);
/**
Retrieves details of the column layout in the compare report generated via #BOM_compare_report.
It returns the number of columns, the width of each column,
the number of spaces between the columns, and the overall width of the report.
*/
extern BOM_API int BOM_compare_report_size(
tag_t compare_context, /**< (I) Tag of the compare object (when using BOM_compare_create/execute), or #NULLTAG
(or a relevant bomline tag) to access the global compare object (when using BOM_compare). */
int* report_width, /**< (O) Width of the report */
int* column_spacer, /**< (O) Number of spaces between each column */
int* column_count, /**< (O) Number of columns */
int** column_width /**< (OF) column_count Array of column widths */
);
/** @} */
/**
@name BOM Snapshot Folder creation functions
@{
*/
extern BOM_API int BOM_create_snapshot(
tag_t bom_window, /**< (I) */
const char* name, /**< (I) */
const char* desc, /**< (I) */
tag_t* snapshot_folder /**< (O) */
);
/** @} */
/**
@name BOM Baseline Functions
@{
*/
/**
This ITK creates a Baseline Revision for the structure represented by the input configured BOM Window.
The BOMWindow would be traversed recursively to create baselines for each of the child components,
and creates baselines for each of the Work in Process Item Revisions.
If the child component were released then, that would be reused.
Precise PSBOMView Revision would be created for new structure, if the preference Baseline_precise_bvr is set as "1" or "2".
It would create a snapshot folder that is attached to the baseline_rev, based on the preference.
The ITK would generate a Baseline Revision ID using
#USER_new_revision_id_from_alt_rule("PDR", , , , ,) for all the subcomponents.
The description entered would be set as the description of the Baseline Revision.
Once the creation of the Baseline Revision is completed,
the Baseline Revision would undergo the release process as given by the rel_proc_name and
having name and desc as jobName and jobDescription respectively.
@note The infodba user is an admininstrative superuser account and should not be used for baseline operation.
*/
extern BOM_API int BOM_create_baseline(
tag_t bom_window, /**< (I) Item Revision that needs to be Baselined */
const char* name, /**< (I) The Revision Id of the Baseline Item Revision */
const char* desc, /**< (I) Description that needs to be set on the Baseline Item Revision */
const char* rel_proc_name, /**< (I) Name of the Release Procedure through which the Baseline Revision should under go */
const char* jobName, /**< (I) Name of the Job */
const char* jobDescription, /**< (I) Description of the Job */
tag_t* baseline_rev /**< (O) Item Revision Tag of the Baseline Revision created */
);
/**
This ITK creates a Baseline Revision for the structure represented by the input configured BOM Window.
The BOMWindow would be traversed recursively to create baselines for each of the child components,
and creates baselines for each of the Work in Process Item Revisions.
If the child component were released then, that would be reused.
It would create a snapshot folder with baseline_label_name.
The ITK would generate a Baseline Revision ID using
#USER_new_revision_id_from_alt_rule("PDR", , , , ,) for all the subcomponents.
The description entered would be set as the description of the Baseline Revision.
Once the creation of the Baseline Revision is completed,
the Baseline Revision would undergo the release process as given by the rel_proc_name and
having name and desc as jobName and jobDescription respectively.
*/
extern BOM_API int BOM_create_baseline_with_baseline_label(
tag_t bom_window, /**< (I) Item Revision that needs to be Baselined */
const char* name, /**< (I) The Revision Id of the Baseline Item Revision */
const char* desc, /**< (I) Description that needs to be set on the Baseline Item Revision */
const char* rel_proc_name, /**< (I) Name of the Release Procedure through which the Baseline Revision should under go */
const char* jobName, /**< (I) Name of the Job */
const char* baseline_label_name, /**< (I) Name of the Snapshot Folder */
const char* jobDescription, /**< (I) Description of the Job */
tag_t* baseline_rev /**< (O) Item Revision Tag of the Baseline Revision created */
);
/**
This ITK creates a does a dryrun of baseline creation for the input BOMWindow.
It does not create the baseline but runs through all the pre-conditions, user error checks
and places the results in the filename pointed by the logFileName. FullLogFileName provides
the full path to the LogFileName.
If there is any error from the pre-conditions or the user checks, the error_registed would be set to TRUE.
*/
extern BOM_API int BOM_dryrun_baseline(
tag_t bom_window, /**< (I) Tag of the BOMWindow for which we are creating the baseline */
const char* rel_proc_name, /**< (I) Name of the Release Procedure through which the Baseline Revision should under go */
char** logFileName, /**< (OF) Name of the LogFile Generated */
char** fullLogFileName, /**< (OF) FullPath of the output logfile, including the logfilename */
logical* error_registered /**< (O) Flag that indicates atleast one of the bomline had errors in the validation */
);
/** @} */
extern BOM_API int BOM_create_window_from_snapshot(
tag_t snapshot_folder, /**< (I) */
tag_t* bom_window /**< (O) */
);
/** @if DOX_IGNORE
(TB) 18-Feb-2002 This directive introduces the header containing the typedefs required for
BOM_writer's auto-generated journalling code. The directive marks a non-void black-box
pointer, in this case a struct pointer. Customers needn't worry about such lower-case
flags.
##include bom/bomwriter.h
@endif */
/**
Allocates memory for the input-structure parameters required by BOM_writer_write_bomwindow(),
and initializes each structure with suitable default values
(including a hidden value that distinguishes the various different structures).
The user changes any necessary values in each structure before using it.
*/
extern BOM_API int BOM_writer_new_output_file (
BOM_writer_output** p /**< (OFp) A BOM_writer_delete()able data-structure,
to be passed to BOM_writer_write_bomwindow() */
);
/**
Allocates memory for the input-structure parameters required by BOM_writer_write_bomwindow(),
and initializes each structure with suitable default values
(including a hidden value that distinguishes the various different structures).
The user changes any necessary values in each structure before using it.
*/
extern BOM_API int BOM_writer_new_output_smstring (
BOM_writer_output** p /**< (OFp) A BOM_writer_delete()able data-structure,
to be passed to BOM_writer_write_bomwindow() */
);
/**
Allocates memory for the input-structure parameters required by BOM_writer_write_bomwindow(),
and initializes each structure with suitable default values
(including a hidden value that distinguishes the various different structures).
The user changes any necessary values in each structure before using it.
*/
extern BOM_API int BOM_writer_new_format_empty (
BOM_writer_format** p /**< (OFp) A BOM_writer_delete()able data-structure,
to be passed to BOM_writer_write_bomwindow() */
);
/**
Allocates memory for the input-structure parameters required by BOM_writer_write_bomwindow(),
and initializes each structure with suitable default values
(including a hidden value that distinguishes the various different structures).
The user changes any necessary values in each structure before using it.
*/
extern BOM_API int BOM_writer_new_format_ajt (
BOM_writer_format** p /**< (OFp) A BOM_writer_delete()able data-structure,
to be passed to BOM_writer_write_bomwindow() */
);
/**
Allocates memory for the input-structure parameters required by BOM_writer_write_bomwindow(),
and initializes each structure with suitable default values
(including a hidden value that distinguishes the various different structures).
The user changes any necessary values in each structure before using it.
*/
extern BOM_API int BOM_writer_new_format_plmxml (
BOM_writer_format** p /**< (OFp) A BOM_writer_delete()able data-structure,
to be passed to BOM_writer_write_bomwindow() */
);
/**
Allocates memory for the input-structure parameters required by BOM_writer_write_bomwindow(),
and initializes each structure with suitable default values
(including a hidden value that distinguishes the various different structures).
The user changes any necessary values in each structure before using it.
*/
extern BOM_API int BOM_writer_new_format_flatten (
BOM_writer_format** p /**< (OFp) A BOM_writer_delete()able data-structure,
to be passed to BOM_writer_write_bomwindow() */
);
/**
Allocates memory for the input-structure parameters required by BOM_writer_write_bomwindow(),
and initializes each structure with suitable default values
(including a hidden value that distinguishes the various different structures).
The user changes any necessary values in each structure before using it.
*/
extern BOM_API int BOM_writer_new_traversal (
BOM_writer_traversal** p /**< (OFp) A BOM_writer_delete()able data-structure,
to be passed to BOM_writer_write_bomwindow() */
);
/**
This function performs a depth-first traversal of the bom_window according to
the values set in the parameter structures supplied, and emits the result as requested.
You can nominate an output format (e.g. AJT, PLMXML) and an output mechanism
(e.g. file handle) to decide how the BOM lines are presented.
Most output formats have additional options.
By default, all lines in the BOM window will appear in the output,
but you can instead select one or more lines,
and specify whether you want just the selected lines and their ancestors to appear,
or to have the selected lines - descendants appear as well.
Recommendation: bom_window should not have any packing. See bomwriter.h.
Return Values
- #BOM_writer_parameter_is_null
- BOM_writer parameter '\' is null - The named parameter was passed with with a null value.
- #BOM_writer_parameter_is_wrong_type
- BOM_writer parameter '\' is wrong type - the named parameter was not an output, format,
or traversal as it should have been, or was otherwise invalid.
- #BOM_writer_matrix_missing_or_null
- BOM_writer (legacy) matrix is missing or null - A legacy (pre-UG/NX) transform on a bomline was missing,
and there was no conversion factor for new-style transforms. Consider -identity=true to circumvent this.
- #BOM_writer_plmxml_save_error
- PLMXML Toolkit save errors: \ - an error was encountered while
saving the PLMXML document through the Parasolid PLMXML toolkit.
The message has been copied into the error report.
- #BOM_writer_format_requires_output
- BOM_writer format was given NULL output mechanism
- #BOM_writer_builder_class_not_found
- BOM_writer builder class '\' was not found - The caller requested a PLMXML format build class that is not registered.
*/
extern BOM_API int BOM_writer_write_bomwindow (
tag_t bom_window, /**< (I) The window is written as-is: you should set revision rule,
packing status, and hide unconfigured variants, etc */
BOM_writer_output* output_p, /**< (Ip) The structure selecting and describing where the file-data should go */
BOM_writer_format* format_p, /**< (Ip) The structure selecting and describing which file format to use */
BOM_writer_traversal* traversal_p /**< (Ip) The structure giving traversal options */
);
/**
Retrieves the registered PLMXML Builder class names and descriptions.
#BOM_writer_format_plmxml->builder_name should be set to one of these.
*/
extern BOM_API int BOM_writer_get_plmxml_builders (
int* count, /**< (O) */
char*** names, /**< (OF) count */
char*** descriptions /**< (OF) count */
);
/**
Deletes "block" and any associated structures.
*/
extern BOM_API int BOM_writer_delete (
void* block /**< (I) */
);
/**
Flags window to show unconfigured BOM lines by Incremental changes.
*/
extern BOM_API int BOM_window_show_incremental_changes(
tag_t bom_window /**< (I) */
);
/**
Flags window to hide unconfigured BOM lines by Incremental changes.
*/
extern BOM_API int BOM_window_hide_incremental_changes(
tag_t bom_window /**< (I) */
);
/**
Sets the config context to this window: it will set RevisionRule and Saved VRule to the window
*/
extern BOM_API int BOM_set_window_config_context(
tag_t window, /**< (I) */
tag_t config_context /**< (I) */
);
/**
Gets a bomline from an apprPathNode
*/
extern BOM_API int BOM_window_get_bomline_from_apprPathNode(
tag_t window, /**< (I) Tag to bomwindow */
tag_t pathNode, /**< (I) Tag to pathNode */
tag_t intermediateParentLine, /**< (I) Tag to intermediate line for future - can be null */
tag_t* pathNodeBomLine /**< (O) Pointer to a tag to bomline - null if not found */
);
/**
Adds an Incremental Change Element to a BOM line
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- #BOM_not_in_ic_context if BOM is not in IC context
- #BOM_op_invalid_on_root if BOM line is root line
- Possibly other BOM errors
*/
extern BOM_API int BOM_line_create_add_ice(
tag_t line, /**< (I) Tag of BOM line */
tag_t* new_ice /**< (O) Tag of the Incremental Change Element created */
);
/**
Removes an Incremental Change Element from a BOM line
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- #BOM_not_in_ic_context if BOM is not in IC context
- #BOM_op_invalid_on_root if BOM line is root line
- Possibly other BOM errors
*/
extern BOM_API int BOM_line_create_remove_ice(
tag_t line, /**< (I) Tag of BOM line */
tag_t* new_ice /**< (O) Tag of the Incremental Change Element removed */
);
/**
Removes a list of incremental changes from a bom line
*/
extern BOM_API int BOM_line_remove_incremental_changes(
tag_t line, /**< (I) */
int n, /**< (I) */
tag_t * ices /**< (I) n */
);
/**
Retrieves all the related substitutes for the Occurrence Thread and Child Item from the BOMLine
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Failed to get the occurrence error
- Possibly other BOM errors
*/
extern BOM_API int BOM_line_list_related_substitutes(
tag_t bom_line, /**< (I) Tag of BOMLine */
int *n_items, /**< (O) Number of related substitutes */
tag_t **related_occs, /**< (OF) Array of related occurrences */
tag_t **related_items /**< (OF) Array of related substitutes */
);
/**
Removes the relation between given substitute items, which are passed in as
Occurrence threads and Child Items of this line.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tags are invalid
- #PS_cant_modify_bvr if the parent BVR is not modifiable
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_line_remove_related_substitutes(
int n_lines, /**< (I) Number of related substitutes */
tag_t *lines /**< (I) n_lines Tag of related substitutes */
);
/**
Creates the relation between given substitute items, which are passed in as
Occurrence threads and Child Items of this line.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tags are invalid
- #PS_cant_modify_bvr if the parent BVR is not modifiable
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_line_relate_substitutes(
int n_lines, /**< (I) Number of related substitutes */
tag_t *bom_lines, /**< (I) n_lines Tag of related substitutes */
tag_t *substitute_set /**< (O) Array of related substitutes */
);
/**
Adds optional item to any occurrence and its child items of this line.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tags are invalid
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_line_add_optional_item(
tag_t bom_line, /**< (I) The line to add optional item */
tag_t item, /**< (I) The optional item */
tag_t rev, /**< (I) The optional item rev */
tag_t bomview /**< (I) The BV to add */
);
/**
Removes optional item from any occurrence and its child items of this line.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tags are invalid
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_line_remove_optional_item(
tag_t bom_line, /**< (I) The line to remove optional item */
tag_t item, /**< (I) The optional item */
tag_t rev, /**< (I) The optional item rev */
tag_t bomview /**< (I) The BV to remove */
);
/**
Lists previously defined optional items for the occurrence of this line.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tags are invalid
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_line_ask_optional_items(
tag_t bom_line, /**< (I) The line to list optional items */
int *count, /**< (O) Number of optional items */
tag_t **opt_items, /**< (OF) count Array of optional items */
tag_t **opt_views /**< (OF) count Array of optional views, always NULL */
);
/**
@name BOM Post-Configuration functions
@{
*/
/**
Applies forced configurations on the BOMLine. For override_status as #BOM_LINE_FORCE_CONFIGURE_IN,
set force_parents_too to true to force configurations on parent as well.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_line_force_config(
tag_t bomline, /**< (I) BOMLine to force configure in or out */
logical force_parents_too, /**< (I) Set to true to force in parents too. Has no effect when
forcing out, as this never effects parents. */
int override_status /**< (I) BOM_LINE_FORCE_CONFIGURE_IN or BOM_LINE_FORCE_CONFIGURE_OUT */
);
/**
Clears forced configurations from the BOM Window.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_window_clear_all_forced_configs(
tag_t bomwindow /**< (I) BOMWindow in which to clear forced configurations */
);
/**
Creates a new BOM Forced Configuration Transaction.
@returns #ITK_ok always
*/
extern BOM_API int BOM_start_forced_config(
tag_t *transaction /**< (O) BOMConfigurationTransaction created */
);
/**
Deletes the BOM Forced Configuration Transaction.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
*/
extern BOM_API int BOM_end_forced_config(
tag_t transaction /**< (I) BOMConfigurationTransaction to be deleted */
);
/** @} */
/**
@name OccurrenceTypeFilters Occurrence Type Filters functions
@{
*/
/**
Displays bomlines based on the filter specified using Select Occurrence Type Filters command.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
*/
extern BOM_API int BOM_window_show_occ_type_filter(
tag_t window_tag /**< (I) Tag of the window */
);
/**
Displays all bomlines ignoring the filter specified using Select Occurrence Type Filters command.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
*/
extern BOM_API int BOM_window_hide_occ_type_filter(
tag_t window_tag /**< (I) Tag of the window */
);
/**
Sets the input Occurrence Type Filters on the window.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_window_set_occ_type_filter(
tag_t window_tag, /**< (I) Tag of the window */
int count, /**< (I) Number of Occurrence Type Filters to be set on window */
char **typeList /**< (I) count The Occurrence Type Filters to be set on window */
);
/**
Retrieves the Occurrence Type Filters set on the window.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_window_get_occ_type_filter(
tag_t window_tag, /**< (I) Tag of the window */
int *count, /**< (O) Number of Occurrence Type Filters set on window */
char ***typeList /**< (OF) count The Occurrence Type Filters set on window */
);
/** @} */
/**
Checks number of generic components in the structure.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if the input tag is invalid
- Possibly other BOM/PS errors
*/
extern BOM_API int BOM_line_create_vi_structures(
tag_t line, /**< (I) Tag of BOM Line */
logical is_linked_to_generic_component, /**< (I) True if the VI structure is to be validated against
the structure that it instantiates.
If false, the VI structure can be altered so that it is
different from that of its generic component's structure. */
tag_t* new_item, /**< (O) Tag for identifying the Item in the current program */
tag_t* new_rev /**< (O) Tag for identifying the Item Revision in the current program */
);
/**
Retrieves whether an object is modifiable in IC context or not
@note The AM rule 'In IC context' gets applied during operations which are tracked by IC.
This method assumes that an operation being tracked by IC is being performed and returns
the value accordingly.
*/
extern BOM_API int BOM_ok_to_modify_obj_in_ic(
tag_t window_tag, /**< (I) BOMWindow where IC context is set */
tag_t object_tag, /**< (I) object tag whose access is to be checked */
logical* modifiable /**< (O) output - true means object is modifiable */
);
/**
BOMWorld api to trigger update of all BOMWindows
based on a changed ItemRev. This is needed after
ITK call to create / copy itemrev was made and
BOMWindow(s) happen to be open.
*/
extern BOM_API int BOM_world_newIrfWhereConfigured(
tag_t rev /**< (I) */
);
/**
Name: BOM_line_find_candidates_with_fix_option
This method will search structures for possible candidates
to be used for repairing broken links.
Input:
n_broken_links - number of broken links to process
broken_links - broken links to process
n_scope - number of structures to search in
scope - structures to search in
n_properties - number of properties for search criteria
properties - properties for search criteria
n_operators - number of operators for search criteria
operators - operators for search criteria
revision_rule - revision rule for configuring scope structures
quick_search - logical that tells if a quick or thorough search
should be conducted
auto_fix - logical that indicates if broken links with only
one candidate found should be fixed automatically
Output:
n_candidates - number of candidates found for each broken link
candidates - all candidates found for all broken links
Return:
ITK_ok or some error number
*/
extern BOM_API int BOM_line_find_candidates_with_fix_option
(
int n_broken_links, /**< (I) */
tag_t * broken_links, /**< (I) n_broken_links */
int n_scope, /**< (I) */
tag_t * scope, /**< (I) n_scope */
int n_properties, /**< (I) */
char ** properties, /**< (I) n_properties */
int n_operators, /**< (I) */
char ** operators, /**< (I) n_operators */
tag_t revision_rule, /**< (I) */
logical quick_search, /**< (I) */
logical auto_fix, /**< (I) */
int ** n_candidates, /**< (OF) */
tag_t ** candidates /**< (OF) candidates will equal the sum of n_candidates */
);
/**
This method will create a new roll up report.
@return #ITK_ok = successful, not #ITK_ok = failed
*/
extern BOM_API int BOM_line_create_rollup_report
(
tag_t bomline, /**< (I) bomline tag to be used as the root line for the report */
tag_t rollup_template, /**< (I) rollup template tag used to identify the content of the report */
tag_t folder, /**< (I) */
const char* name, /**< (I) */
const char* description, /**< (I) */
tag_t* report_dataset /**< (O) the dataset tag that will be versioned with revised report */
);
/**
@name BOM Publish Functions
@{
*/
/**
Create PublishLink between absolute occurrences of source and targets.
@note If a PublishLink for the source occurrence exists, an error will be thrown
@note If any of the targets are already connected via PublishLink to a different source occurrence,
an error will be thrown
*/
extern BOM_API int BOM_create_publish_link(
const char* name, /**< (I) Name of PublishLink to be created */
const char* type, /**< (I) Type of PublishLink to be created */
tag_t source_line, /**< (I) source tag BOM line */
int target_count, /**< (I) no of of target tags */
const tag_t *target_lines, /**< (I) target_count */
tag_t* publishLink /**< (O) Tag of PublishLink created */
);
/**
Add targets to given source's PublishLink.
@note If a PublishLink for a source doesnt exist, error is thrown
@note If a target already has a PublishLink with another source, error is thrown
*/
extern BOM_API int BOM_publishlink_add_targets(
tag_t source_line, /**< (I) source tag of BOM line */
int target_count, /**< (I) no of of target tags */
const tag_t *target_lines, /**< (I) target_count */
tag_t *publishLink /**< (O) Tag of PublishLink updated */
);
/**
Deletes targets from given source's PublishLink.
@note If the target being removed is the last one for PublishLink, then link is also deleted
*/
extern BOM_API int BOM_publishlink_delete_targets (
tag_t source_line, /**< (I) source tag of BOM line */
int target_count, /**< (I) no of of target tags */
const tag_t *target_lines, /**< (I) target_count */
tag_t *publishLink /**< (O) Tag of PublishLink updated */
);
/**
Find targets of a given source's PublishLink in given bom window.
*/
extern BOM_API int BOM_publishlink_find_targets_in_window(
tag_t source_line, /**< (I) source tag of BOM line */
tag_t target_bom_window, /**< (I) target bom window */
int *targets_count, /**< (O) no of of target tags */
tag_t **target_lines /**< (OF) targets_count */
);
/**
Publish will copy data from source BOMLine to the target BOMLines based on the data flags
@note data_flags - each bit in this denotes what data to be published
Currently transform, shape, both transform and shape can be published.
the flags values are: Transform (0x1), Shape (0x2).
@note If absolute occurrence of any targetLines is found being referred as target in an existing PublishLink
with a different source, an error is thrown.
@note If a PublishLink exists for source line, the link is uppdated with absolute occurrences of targetLines
@note If a PublishLink exists for source line, publishLinkName and publishLinkTypeName are optional
@note If a PublishLink doesnt exist between absolute occurrence of source and targets it will be created.
*/
extern BOM_API int BOM_publish_data(
tag_t source_line, /**< (I) source tag of BOM line */
int target_count, /**< (I) no of of target tags */
const tag_t *target_lines, /**< (I) target_count */
const int data_flags, /**< (I) data flags to denote publish data type */
const char *publishLinkName, /**< (I) publish link name */
const char *publishLinkTypeName, /**< (I) publish link type */
tag_t *publishLink /**< (O) Tag of PublishLink */
);
/**
Delets Publish Link and its targets and source for given source bom line
@note If absolute occurrence of any targetLines is found being referred as target in an existing PublishLink
with a different source, an error is thrown.
@note If a PublishLink exists for source line, the link is uppdated with absolute occurrences of targetLines
@note If a PublishLink doesnt exist between absolute occurrence of source and targets it will be created.
*/
extern BOM_API int BOM_delete_publishlink_for_source(
tag_t source_line /**< (I) source tag of BOM line */
);
/**
@deprecated #BOM_publishlink_find_source_in_window deprecated in Teamcenter 11.2.3. Use #BOM_publishlink_find_sources_in_window instead.
Find source BOM line for a given target's PublishLink in given bom window.
*/
TC_DEPRECATED("11.2.3","BOM_publishlink_find_source_in_window","BOM_publishlink_find_sources_in_window")
extern BOM_API int BOM_publishlink_find_source_in_window(
tag_t target_line, /**< (I) Tag of target BOM line */
tag_t source_bom_window, /**< (I) Tag of source BOM Window */
tag_t *source_line /**< (O) Tags of source BOM line */
);
/**
Finds multiple source BOM Lines for a given target PublishLink in a BOM Window.
@returns
- #ITK_ok on success
- #PS_publishlink_not_exist_for_target if no Publish Link exists for the target.
- #BOM_invalid_tag if source_bom_window is not a valid BOM Window.
- Possibly other errors
*/
extern BOM_API int BOM_publishlink_find_sources_in_window(
const tag_t target, /**< (I) The target BOM Line */
const tag_t source_bom_window, /**< (I) The source BOM Window */
int *n_sources, /**< (O) Number of found source BOM Lines */
tag_t **sources /**< (OF) n_sources The found BOM Lines */
);
/**
Deletes target from given source's PublishLink.
@note If the target being removed is the last one for PublishLink, then link is also deleted
*/
extern BOM_API int BOM_publishlink_delete_target(
tag_t target_line, /**< (I) Tag of target BOM line */
tag_t *publishLink /**< (O) Tag of PublishLink created */
);
/**
From the input line, assumed to be a target of a PublishLink, BOMView of source of
PublishLink is returned
*/
extern BOM_API int BOM_publishlink_ask_source_context_bv(
tag_t target_line, /**< (I) Tag of target BOMLine */
tag_t *source_bom_view /**< (O) Tag of source BOMView */
);
/**
Retrieves PublishLink where the input line is source
*/
extern BOM_API int BOM_ask_publishlink_for_source(
tag_t source_line, /**< (I) Tag of source BOMLine */
tag_t *publish_link /**< (O) Tag of PublishLink */
);
/**
Retrieves PublishLink where the input line is a target
*/
extern BOM_API int BOM_ask_publishlink_for_target(
tag_t target_line, /**< (I) Tag of target BOMLine */
tag_t *publish_link /**< (O) Tag of PublishLink */
);
/** @} */
/**
For the input line and its descendents completeness check is performed.
The checks is valid for lines with underlying item of type Part. Other lines
are skipped. For a line with underlying item's type as Part, the need for positioned
design is verifed.
The ITK returns the three array of lines:
skipped - lines which were skipped and completess check not performed
complete - lines satisfying the completeness criteria
incomplete - lines not satisfying the completeness criteria
*/
extern BOM_API int BOM_verify_part_structure(
tag_t line, /**< (I) */
int* cntCompleteLines, /**< (O) */
tag_t** completeLinesTags, /**< (OF) cntCompleteLines */
int* cntIncompleteLines, /**< (O) */
tag_t** incompleteLinesTags, /**< (OF) cntIncompleteLines */
int* cntSkippedLines, /**< (O) */
tag_t** skippedLinesTags /**< (OF) cntSkippedLines */
);
/**
Exports the UG assembly structure to Native NX after configuring using
the given saved variant rule and revision rule
This function exports packed (hidden) lines as well.
*/
extern BOM_API int BOM_export_configured_nx_assembly(
tag_t bomLine, /**< (I) bomline to export */
const char* namingFormat, /**< (I) naming format */
int noOfValidExcludes, /**< (I) number of excluded items */
const tag_t* excludedTags, /**< (I) noOfValidExcludes An array of excluded item tag list */
char** zipFileTicket, /**< (OF) Returns zipfile fms ticket */
char** logFileTicket /**< (OF) Returns logfile fms ticket */
);
/**
Retrieves child bomline for given bomline that is the occurrence with the given clone stable uid
*/
extern BOM_API int BOM_line_get_child_bomlines_from_clone_stable_uid(
tag_t bom_line, /**< (I) Parent BOM line whose children are wanted */
int countin, /**< (I) Number of ids passed in */
char** clone_stable_uids, /**< (I) Clone stable id */
int* count, /**< (O) Number of child lines returned */
tag_t** children /**< (OF) count Returned lines */
);
/**
Finds a preferred JT refset associated with a dataset on the given bom line. The JT_File_Priority_Refsets
preference and optionally the JT_File_OverrideChildren_Refsets preference are used to determine which
JT refset is preferred
*/
extern BOM_API int BOM_line_find_preferred_JT_refset(
tag_t bom_line, /**< (I) Tag of BOM line to add substitute to */
tag_t item_revision, /**< (I) Tag of the Item Revision to add as substitute */
logical ignore_overrides, /**< (I) True if return should exclude assemblies that override children */
tag_t* jtfile, /**< (O) Tag of the selected JT file */
char** refset_name, /**< (OF) Refset name of the selected JT file */
logical* jt_override /**< (O) True if returned JT file is an override assembly */
);
/**
Removes the absocc override of a property on a bomline that was defined by a specific bomline context.
*/
extern BOM_API int BOM_line_remove_absocc_property
(
tag_t bomLine, /**< (I) Tag of bomline that has property with absocc override. */
char* propertyName, /**< (I) Char array of the property name that has absocc override. */
tag_t contextBomLine /**< (I) Tag of bomline that is the context for absocc override of property, can be NULLTAG which will delete current configured property override. */
);
/**
Removes absocc GRM override of a bomline by using its Appearance Path Node and GRM relation type.
*/
extern BOM_API int BOM_line_remove_absocc_relation
(
tag_t lineTag, /**< (I) Tag of bomline. */
tag_t sourceApn, /**< (I) Tag of apn, can be NULLTAG which will try all possible apns that use GRM. */
tag_t relation /**< (I) Tag of GRM. */
);
/**
Asks relations associated to bomline
*/
extern BOM_API int BOM_line_ask_absocc_relation
(
tag_t lineTag, /**< (I) Tag of bomline. */
tag_t sourceApn, /**< (I) Tag of apn, can be NULLTAG which will try all possible apns that use relation. */
char *relName, /**< (I) Name of the relation. */
logical configuredOnly, /**< (I) Interested in configured relation only. */
int *relCount, /**< (O) Relation count. */
tag_t **relations /**< (OF) relCount Array of tags of bomline relations of given type. */
);
/**
Replaces the secoondary object of a specified Absocc GRM override relation on a bomline.
*/
extern BOM_API int BOM_line_replace_absocc_relation
(
tag_t lineTag, /**< (I) Tag of bomline. */
tag_t sourceApn, /**< (I) Tag of apn, can be NULLTAG which will try all possible apns that use relation. */
tag_t relation, /**< (I) Tag of GRM. */
tag_t newSecondary, /**< (I) Tag of new secondary object. */
tag_t *newRelation /**< (O) Tag of modified relation. */
);
/**
Adds a secondary object to a bomline using absocc GRM override with a specific relation type.
Note: Before adding, the bom window needs to be in absOccEdit mode and a valid
context has to be set too.
*/
extern BOM_API int BOM_line_add_absocc_relation
(
tag_t lineTag, /**< (I) Tag of bomline. */
tag_t relType, /**< (I) Tag of GRM. */
tag_t secObject, /**< (I) Tag of new secondary object. */
tag_t *newRelation /**< (O) Tag of new relation. */
);
/**
Asks bom window for selected context bomline.
*/
extern BOM_API int BOM_window_ask_absocc_context
(
tag_t window, /**< (I) Tag of bom window. */
tag_t *rootLine /**< (O) Tag of bomline that is the selected context line, NULLTAG means no line selected. */
);
/**
Sets context bomline for absolute occurrence edit mode.
*/
extern BOM_API int BOM_window_set_absocc_context
(
tag_t window, /**< (I) Tag of bom window. */
tag_t rootLine /**< (I) Tag of higher level bom line. */
);
/**
Asks bom window status of absolute occurrence edit mode.
*/
extern BOM_API int BOM_window_ask_absocc_edit_mode
(
tag_t window, /**< (I) Tag of bom window. */
logical *absOccEditMode /**< (O) Status of absocc edit mode, on or off */
);
/**
Sets bom window absolute occurrence edit mode on or off.
NOTE: Context is assumed and will be set to the topLine of the bom window.
To change the context line use the BOM_window_set_absocc_context API.
*/
extern BOM_API int BOM_window_set_absocc_edit_mode
(
tag_t window, /**< (I) Tag of bom window. */
logical absOccEditMode /**< (I) Status to set absocc edit mode, on or off */
);
/**
Retrieves the unit occurrence effectivity of a bomline.
If intersectWithConfigurationEff is true, the unit occurrence effectivity is intersected with the
effectivity on the BOMWindow and the intersected effectivity will be returned.
The ouput flag occEffExists indicates if unit occurrence effectivity is defined or not.
The following will be the output configuration for special cases of infinite and zero effectivity :
Infinite Effectivity Case ( i.e No Effectivity defined ):
*alwaysEffective = true;
*netEffyInfoCount = 0;
Zero Effectivity Case ( Same as Line Not Configured ):
*alwaysEffective = false;
*netEffyInfoCount = 0;
*/
extern BOM_API int BOM_line_ask_unit_occurrence_effectivity(
tag_t bomline, /**< (I) Tag of BOM line whose Unit Occurrence Effectivity is being asked for */
logical intersectWithConfigurationEff, /**< (I) if true the Occurrence Effectivity will be intersected with Effectivity on BOM Window Configuration */
logical* occEffExists, /**< (O) True indicates the occurrence has effectivity defined on it */
logical* isAlwaysEffective, /**< (O) true if the occurrence is effective for any End Item/Unit. */
int* effyInfoCount, /**< (O) Occurrence Effectivity Count */
WSOM_effectivity_info_t*** effectivityInfo /**< (OF) Occurrence Effectivity of the Given BOMLine */
);
/**
Creates a new Effectivity object and applies it to an occurrence.
Restrictions:
- Only one range type is permitted per effectivity.
Hence, it is possible to have date ranges or unit ranges, but not both.
Set date ranges first if they are provided, otherwise set unit ranges. They cannot be both NULL.
- Unit ranges must be qualified against an end item.
Set end item revision if it is specified, otherwise set end item.
End item and end item revision cannot be both NULL.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if @p bom_line is invalid
- #CXPOM_wrong_class if @p end_item or @p end_item_rev is invalid
- #WSOM_units_and_no_end_item if Effectivity creation is requested with @p unit_range but no @p end_item or @p end_item_rev is provided
- #WSOM_closed_status_open_range if a closed-ended range is specified but no end date value is provided
- #WSOM_open_status_closed_range if an open-ended or stock-out range is specified but the range array is closed with an end value
- #WSOM_end_smaller_than_start if the end value is less than the start value
- Possibly some other WSOM or BOM errors
*/
extern BOM_API int BOM_create_occurrence_effectivity(
tag_t bom_line, /**< (I) The BOMLine to which Effectivity is attached */
const char* eff_id, /**< (I) The Effectivity ID. It can be NULL */
tag_t end_item, /**< (I) The Effectivity end item.
If Effectivity creation is requested with the unit range, it cannot be #NULLTAG. */
tag_t end_item_rev, /**< (I) The Effectivity end item revision.
It can be #NULLTAG */
const char* unit_range, /**< (I) The Effectivity unit range represented as text using the '-' separator (e.g. "100-199").
Multiple ranges can be specified using a comma separator (e.g. "100-199, 500-599"). */
int n_dates, /**< (I) The size of the array of Effectivity date */
const date_t* date_range, /**< (I) n_dates The array of Effectivity date range.
For example, consider a discontinuous range consisting of
continuous ranges r1, r2, ..., rn where rx has the start and
end values rx.start and rx.end.
The array of start_end_vals for this discontinuous range will
be constructed as { r1.start, r1.end, r2.start, r2.end, ...,
rn.start, rn.end }. The last value, rn.end should be omitted if
the discontinuous range is open-ended. */
WSOM_open_ended_status_t open_ended_status, /**< (I) The open-ended status. */
logical is_protected, /**< (I) Set this to true to add the new range to any existing ranges.
Set this to false to overwrite existing ranges. */
tag_t* effectivity_cmp /**< (O) The created Effectivity object. */
);
/**
Associates an existing Effectivity object to an occurrence.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if @p bom_line is invalid
- #WSOM_invalid_eff if @p effectivity is invalid
- Possibly some other BOM or PS errors
*/
extern BOM_API int BOM_apply_occurrence_effectivity(
tag_t bom_line, /**< (I) The BOMLine to which Effectivity is attached */
tag_t effectivity /**< (I) The existing Effectivity object that will be added to the BOM Line */
);
/**
Updates an existing effectivity object for the BOMLine.
Restrictions:
- Only one range type is permitted per effectivity.
Hence, it is possible to have date ranges or unit ranges, but not both.
Set date ranges first if they are provided, otherwise set unit ranges. They cannot be both NULL.
- Unit ranges must be qualified against an end item.
Set end item revision if it is specified, otherwise set end item.
End item and end item revision cannot be both NULL.
@returns
- #ITK_ok on success
- #BOM_invalid_tag if @p bom_line is invalid
- #WSOM_invalid_eff @p eff_emp is invalid
- #CXPOM_wrong_class if @p end_item or @p end_item_rev is invalid
- #WSOM_units_and_no_end_item if Effectivity creation is requested with @p unit_range but no @p end_item or @p end_item_rev is provided
- #WSOM_closed_status_open_range if a closed-ended range is specified but no end date value is provided
- #WSOM_open_status_closed_range if an open-ended or stock-out range is specified but the range array is closed with an end value
- #WSOM_end_smaller_than_start if the end unit/date value is less than the start unit/date value
- Possibly some other WSOM or BOM errors
*/
extern BOM_API int BOM_edit_occurrence_effectivity(
tag_t bom_line, /**< (I) The BOMLine for which effectivity is updated */
tag_t eff_emp, /**< (I) The existing effectivity object to be updated */
const char* eff_id, /**< (I) The Effectivity ID. It can be NULL */
tag_t end_item, /**< (I) The Effectivity end item.
If Effectivity creation is requested with the unit range, it cannot be #NULLTAG. */
tag_t end_item_rev, /**< (I) The Effectivity end item revision.
It can be #NULLTAG */
const char* unit_range, /**< (I) The Effectivity unit range represented as text using the '-' separator (e.g. "100-199").
Multiple ranges can be specified using a comma separator (e.g. "100-199, 500-599"). */
int n_dates, /**< (I) The size of the array of Effectivity date */
const date_t* date_range, /**< (I) n_dates The array of Effectivity date range.
For example, consider a discontinuous range consisting of
continuous ranges r1, r2, ..., rn where rx has the start and
end values rx.start and rx.end.
The array of start_end_vals for this discontinuous range will
be constructed as { r1.start, r1.end, r2.start, r2.end, ...,
rn.start, rn.end }. The last value, rn.end should be omitted if
the discontinuous range is open-ended. */
WSOM_open_ended_status_t open_ended_status, /**< (I) The open-ended status. */
logical is_protected /**< (I) Set this to true to add the new range to any existing ranges.
Set this to false to overwrite existing ranges. */
);
/**
Retrieves the array of bomsets for given bomlines.
A bomset is a chunk of bomlines. Dividing a BOM structure into fixed size bomsets can
help in processing them such as expansion. BomSet creation can be based on given criteria such as
available system memory, maximum size or maximum size as percentage of total structure size.
A bomset, by default, contains number of bomlines those can be expanded within available system
memory at the point of creation.
*/
extern BOM_API int BOM_create_bomsetlines_for_input_lines(
BOM_bomset_create_criteria_t bomset_create_criteria, /**< (I) Structure having BOMSet creation criteria */
tag_t* input_lines, /**< (I) Tag array of structure top lines for which bomsets to be created */
int input_lines_count, /**< (I) Integer size of Tag array of input lines */
int* bomset_count, /**< (OF) Number of bomsets created */
BOM_bomset_input_info_t** bomset_input_info /**< (OF) bomset_count Structure array of bomsets */
);
/**
This API expands a bomset.
Retrieves a structure having expanded bomlines array for input bomset and its size.
A bomset is a chunk of bomlines. Dividing a BOM structure into fixed size bomsets can
help in processing them such as expansion.
A bomset, by default, contains number of bomlines those can be expanded within available system
memory at the point of creation.
*/
extern BOM_API int BOM_expand_bomset_lines(
BOM_bomset_input_info_t bomset_input_info, /**< (I) Structure of a bomset */
BOM_bomset_output_info_t* bomset_output_info /**< (OF) Structure array of expanded bomlines for input bomset */
);
/**
Retrieves the list of option names on the item corresponding to the bom line.
@returns int teamcenter error code, ITK_ok on success.
*/
extern BOM_API int BOM_item_module_list_options (
tag_t window, /**< (I) Tag of BOM Window */
tag_t item, /**< (I) Tag of Item from which options should be search */
int *count, /**< (O) Count of option found */
int **options /**< (OF) count Option Handles found */
);
/**
Retrieves the Option id for the given item and Option name
@returns int teamcenter error code, ITK_ok on success.
*/
extern BOM_API int BOM_item_ask_option_handle(
tag_t window, /**< (I) Tag of BOM Window */
const tag_t item, /**< (I) Tag of Item from which options should be search */
const char* name, /**< (I) Option name to find */
int* option /**< (O) Option Handle */
);
/**
Retrieves the details for an Option defined on item.
@returns int teamcenter error code, ITK_ok on success.
*/
extern BOM_API int BOM_option_describe2(
int option, /**< (I) Option handle */
tag_t* item, /**< (O) Tag of Item where option is defined */
char** option_name, /**< (OF) Option Name */
char** desc, /**< (OF) Option Description */
int* visibility, /**< (O) Option scope (Public, Private) */
int* option_type, /**< (O) Option Type */
int* value_type, /**< (O) Option Value type (String, Logical, Integer, Real) */
int* based_on, /**< (O) Option Handle if option is presented or external */
logical* has_default /**< (O) If Option has default value defined */
);
/**
For the given Item returns the item revision on which Option is declared
@returns int teamcenter error code, ITK_ok on success.
*/
extern BOM_API int BOM_option_where_declared2(
const tag_t item, /**< (I) Tag of Item */
const char* option, /**< (I) Option Name to find */
int* count, /**< (O) Count of matches */
tag_t** item_revs /**< (OF) count Tags of found Item Revisions */
);
/**
For the given Item returns the item revision on which Option is Used
@returns int teamcenter error code, ITK_ok on success.
*/
extern BOM_API int BOM_option_where_used2(
const tag_t item, /**< (I) Tag of Item */
const char* option, /**< (I) Option Name to find */
int* count, /**< (O) Count of matches */
tag_t** objs /**< (OF) count Tags of found objects */
);
/**
Performs occurrence validation on bom lines and optionally on all occurrences below the lines as well.
Note: When doing recursive validation, children will be loaded if not yet.
*/
extern BOM_API int BOM_line_occ_validate(
int count, /**< (I) The number of lines to be validated */
tag_t* lines, /**< (I) count The input lines to perform occurrence validation */
logical recurse, /**< (I) Do the validation recursively */
int* err_count, /**< (O) The number of errors */
int** ifails, /**< (OF) err_count The errors */
tag_t** err_lines /**< (OF) err_count The lines that failed the validation */
);
/**
Retrieves the clone stable occurrence id chain for the given bom line.
@returns
- #ITK_ok on success.
- Possibly other errors
*/
extern BOM_API int BOM_line_get_clone_stable_id_chain(
tag_t bomline, /**< (I) Tag of the BOM line */
const char * root_str, /**< (I) The string to be appended at the front and can be one of the following:
- bl_clone_stable_occurrence_id:\ or
- bl_clone_stable_occurrence_id:\ or
- bl_clone_stable_occurrence_id:\ or
- bl_clone_stable_occurrence_id:\ or
- bl_clone_stable_occurrence_id if an external means of setting up the window is in place while evaluation (getting bomline from chain)
*/
char ** cli_chain /**< (OF) Chain of Clone Stable IDs */
);
/**
Retrieves the BOM line from clone stable occurrence id chain.
@returns
- #ITK_ok on success.
- #BOM_invalid_tag if any clone stable Id in the chain does not resolve to a BOM line.
- Possibly other errors
*/
extern BOM_API int BOM_window_get_line_from_clone_stable_id_chain(
tag_t window, /**< (I) Tag of BOM Window */
const char * cs_chain, /**< (I) The Clone Stable Id chain in the format csid1/csid2/... */
tag_t * line /**< (O) The Tag of line found */
);
/**
Suppresses or unsuppresses lines by using the flags.
@note
- This is a set based action to suppress lines. It provides dedicated handling in compare with calling generic set property functions.
- Unsaved deferred save data will be saved. It is desired to save the BOM window before calling this ITK.
- If any line failed to suppress/unsuppress, it will record the error and continue processing.
- The function returns the value for the first encountered error, if any. It returns #ITK_ok otherwise.
@returns
- #ITK_ok on complete success
- #BOM_cant_edit_root_line_occ if the line has no occurrence.
- #BOM_suppression_constrained if the line is constrained and could not be suppressed or unsuppressed
- Possibly other errors
*/
extern BOM_API int BOM_line_suppress_lines(
int count, /**< (I) Number of input lines. */
const tag_t* lines, /**< (I) count The input lines to suppress/unsuppress */
const logical* suppression_flags, /**< (I) count The suppress/unsuppress flag for each of the lines */
int* err_count, /**< (O) The number of errors */
int** ifails, /**< (OF) err_count The errors */
tag_t** err_lines /**< (OF) err_count The lines that failed the suppression/unsuppression */
);
/**
Retrieves the saved Variant Rules (SVRs) or Stored Option Set (SOS) attached to an Item Revision with the specified Relation type or by Variant Rule name.
Depending on the value of the preference "PSEVariantsMode" and "PSM_Enable_product_configurator", different objects are retrieved:
For preference "PSEVariantsMode":
- "legacy": only SVRs.
- "modular": only SOSs.
- "hybrid": both SVR and SOS.
For preference "PSM_Enable_product_configurator":
- "true": Product Configurator Authored Variant Rules.
- "false": the objects as defined by the preference "PSEVariantsMode".
@returns
- #ITK_ok on success.
- #BOM_invalid_input if @p item_revision is NULLTAG and @p relation_type is not a NULLTAG.
- #GRM_invalid_relation_type if @p relation_type is an invalid tag.
- #BOM_no_configured_ir if @p item_revision is an invalid tag.
- Possibly other errors
*/
extern BOM_API int BOM_find_variant_rule_and_or_sos(
tag_t item_revision, /**< (I) Item Revison tag (optional). If #NULLTAG, the search of SVR/SOS will be made using the Rule name only */
const char* rule_name, /**< (I) Saved Variant Rule name (optional). If null or empty, the SVRs/SOSs are searched using the Item Revision only */
tag_t relation_type, /**< (I) The Relation type to search for (optional). If #NULLTAG, all relation types are taken into consideration */
logical consider_PSEVariantsMode_pref, /**< (I) Consider the preference "PSEVariantsMode" condition flag */
int * n_objects_found, /**< (O) Number of objects found */
tag_t ** objects /**< (OF) n_objects_found Array of found SVRs/SOSs */
);
/**
Sets the given variant rules to be the current rules for the given BOM window and applies the configuration on BOM window.
It will override any existing configuration.
If no variant rule is passed, the default configuration will be applied on the window.
@returns
- #ITK_ok on success.
- #BOM_invalid_tag if @p window is invalid.
- #BOM_variant_invalid_bom_vrule if any member of @p svr is #NULLTAG or not a valid Saved Variant Rule.
- #SMC0PSMCFGSUPPORT_invalid_variant_rule_error if the preference "PSM_Enable_product_configurator" is set to "true" and any Variant rule in @p svr is not a Product-Configurator-authored Variant Rule.
- #BOM_cannot_apply_product_configurator_authored_vrule if the preference "PSM_Enable_product_configurator" is set to "false" and any Variant Rule in @p svr is not a Legacy Saved Variant Rule.
*/
extern BOM_API int BOM_window_apply_variant_configuration(
tag_t window, /**< (I) The BOM Window */
int n_svr, /**< (I) The number of Saved Variant Rules to apply to the BOM Window. */
const tag_t* svr /**< (I) n_svr The Saved Variant Rules to apply to the BOM Window. */
);
/**
Creates and saves the new interchangeable groups, Occurrence level substitute groups or Item Revision level (global) substitute alternate groups based on the input object type.
Interchangeable Groups are groups of stockable parts that needs to be all replaced together as repairs are made. They can be defined at two levels:
- Occurrence Level: List of occurrences that must be replaced together with a list of items within the same BVR.
- Item/Item Revision (Global) Level: List of items/revisions that must be replaced together with another list of items, regardless of the assembly where they are used.
@returns
- #ITK_ok on success
- #CXPOM_wrong_class if class of @p bo_name is not of Fnd0AbsInterchangeableGrp type
- Possibly other BOM errors
*/
extern BOM_API int BOM_create_interchangeable_groups(
const char* bo_name, /**< (I) The Business Object type name of the interchangeable group to create. */
int n_props, /**< (I) Number of properties. */
const char** prop_names, /**< (I) n_props Property names */
const char** prop_values, /**< (I) n_props Property values */
int n_src_objs, /**< (I) Number of source objects. */
const tag_t* src_objs, /**< (I) n_src_objs The list of source objects. BOM Line objects when creating substitute groups or Item/Item Revisions when creating alternate groups */
int n_tgt_objs, /**< (I) Number of interchangeable objects. */
const tag_t* tgt_objs, /**< (I) n_tgt_objs Item/Item revision objects as interchangeable group */
tag_t* created_obj /**< (O) The created interchangeable group object */
);
/**
Creates and saves the Occurrence Effectivity Expression on given BOM Line.
If the BOM Window is In-context, the API will override Effectivity Expression on the BOM Line. Otherwise, it will set the relative effectivity expression on BOM Line.
@returns
- #ITK_ok on success
- #PS_has_object_based_eff_cant_have_expr_based_eff if the occurrence has object-based effectivity.
- #BOM_invalid_configurable_object if the occurrence is not available.
- #BOM_cannot_perform_effectivity_operation if the occurrence is locked.
- #BOM_invalid_tag for invalid BOM Line
- Possibly other BOM errors
*/
extern BOM_API int BOM_set_line_occ_eff_formula(
const tag_t bom_line, /**< (I) The BOM Line. */
const char * formula /**< (I) Effectivity Expression Formula to set on the BOM Line. */
);
/**
Retrieves the Effectivity Expressions on given BOM Lines.
If a BOM Line overrides the Effectivity Expression, this will have precedence over any relative Effectivity Expression.
This API supports partial errors,i.e. if an error occurs during the operation on any input BOM Line, that will be added to @p occ_effectivity_info and other inputs will be processed.
@returns #ITK_ok always
*/
extern BOM_API int BOM_get_line_occ_eff_info(
const int n_bomlines, /**< (I) Number of BOM Lines. */
const tag_t* bomlines, /**< (I) n_bomlines BOM Lines to consider. */
BOM_occ_effectivity_info_t** occ_effectivity_info /**< (OF) n_bomlines The Effectivity formula from the BOM Lines.
Note that it can also contain a processing error code for the corresponding input BOM Line.
The array is packed, which means that the memory is to be deallocated by calling #MEM_free on the container only. */
);
/**
Aligns part occurrences with their corresponding design occurrences as specified by @p alignment_data.
Global Part-CAD alignment between Parts and Designs will also be created.
The API will first try to create alignments in bulk, and if this fails it will iterate through each input to create alignment.
@returns
- #ITK_ok on success
- #PS_entcba_invalid_input_error if input from @p alignment_data is invalid.
*/
extern BOM_API int BOM_align_occurrences(
const int n_alignment_data, /**< (I) Number of alignment objects to create. */
const BOM_part_design_occurrence_alignment_data_t* alignment_data, /**< (I) n_alignment_data The alignment data used to create the occurrence alignment objects. */
tag_t** occurrence_alignments, /**< (OF) n_alignment_data The created occurrence alignment objects. */
int** error_codes, /**< (OF) n_alignment_data Error code for the creation of each object. The content for a successful creation will be #ITK_ok. */
char*** error_messages /**< (OF) n_alignment_data Error message in case of error. This array is packed, which means that #MEM_free needs to be called on the container only to free all the memory. */
);
/**
Deletes alignment between part occurrences corresponding design occurrences as specified by @p alignment_data.
@returns
- #ITK_ok on success
- #PS_entcba_invalid_input_error if input from @p alignment_data is invalid.
- #PS_entcba_alignment_not_found_error if alignment not found
*/
extern BOM_API int BOM_unalign_occurrences(
const int n_alignment_data, /**< (I) Number of alignment objects to delete. */
const BOM_part_design_occurrence_alignment_data_t* alignment_data, /**< (I) n_alignment_data The alignment data used to delete the occurrence alignment objects. */
int** error_codes, /**< (OF) n_alignment_data Error code for the deletion of each object. The content for a successful deletion will be #ITK_ok. */
char*** error_messages /**< (OF) n_alignment_data Error message in case of error. This array is packed, which means that #MEM_free needs to be called on the container only to free all the memory. */
);
/**
Retrieves the aligned design line for part line.
@returns
- #ITK_ok on success.
- #BOM_invalid_tag if @p bom_line is invalid or #NULLTAG.
*/
extern BOM_API int BOM_line_get_aligned_design_line(
tag_t bom_line, /**< (I) The BOM Line */
tag_t* aligned_design_line /**< (O) The aligned Design Line. It can be #NULLTAG if no Design Line is aligned to Part Line. */
);
/** @} */
/*================================================================================================*/
#ifdef __cplusplus
}
#endif
#include
#endif