ITK Function Reference

(V10000.1.0.60_20160308.00)
Macros | Functions
User exits for mbom creation

Macros

#define ME_USER_EXIT_CONTINUE   101
 

Functions

ME_API int USER_BOMLINE_find_candidates (int n_mbom_lines, const tag_t *mbom_lines, int n_ebom_candidates, const tag_t *ebom_candidates, int n_criteria, const char **property_names, const int *property_types, const int *operators, const char **values, const int *is_empty_value_valid, const int *is_mandatory, const char *user_data, tag_t ***matching_candidates, int ****property_indices)
 
ME_API int USER_BOMLINE_repair_bomlines (int n_lines, const tag_t *mbom_lines, const tag_t *ebom_lines, const char **repair_actions, int n_propagation_properties, const char **propagation_properties, int **statuses, char ****error_messages)
 
ME_API int USER_create_or_ref_item (tag_t ebom_node, tag_t ebom_line_node, const char *user_data, int *num_mfk_keys, char ***mfk_keys, char ***mfk_values, tag_t *to_be_created_type, tag_t *create_input)
 
ME_API int USER_item_action_on_release (tag_t ebom_item, tag_t ebom_line_node, tag_t mbom_released_object, tag_t mbom_line_node, const char *user_data, int suggested_action_on_release, logical *modify_released, int *action_on_release)
 
ME_API int USER_item_find_equivalent_line (tag_t ebom_item, tag_t ebom_line_node, tag_t mbom_parent_node, const char *user_data, tag_t *mbom_line_node)
 
ME_API int USER_sync_item (tag_t ebom_item, tag_t ebom_line_node, tag_t mbom_line_node, const char *user_data)
 

Detailed Description

The user exits defined here are called during mirroring of Engineering BOM (EBOM) to Manufacturing BOM (MBOM).

Macro Definition Documentation

#define ME_USER_EXIT_CONTINUE   101

Used by the user exit extension to instruct the user exit ITK implementation to continue to execute the out-of-the-box behavior.

Definition at line 34 of file me_user_exits.h.

Function Documentation

ME_API int USER_BOMLINE_find_candidates ( int  n_mbom_lines,
const tag_t mbom_lines,
int  n_ebom_candidates,
const tag_t ebom_candidates,
int  n_criteria,
const char **  property_names,
const int *  property_types,
const int *  operators,
const char **  values,
const int *  is_empty_value_valid,
const int *  is_mandatory,
const char *  user_data,
tag_t ***  matching_candidates,
int ****  property_indices 
)

Finds matching Engineering BOM (EBOM) lines given a list of Manufacturing BOM (MBOM) lines and search criteria.
If the user exit is not overridden, the default implementation finds the candidates from the input EBOM lines based on the search criteria.

Note
Searching for matching candidates can be done by redefining the implementation of this user exit function.
When implementing the extension function registered against the operation BMF_BOMLINE_find_candidates_msg on BOMLine (or any of its subclasses), its arguments must match the exact same arguments as this ITK.
Returns
Parameters
n_mbom_lines(I) The number of MBOM lines.
mbom_lines(I) n_mbom_lines The MBOM lines to search candidates for.
n_ebom_candidates(I) The number of EBOM candidate lines.
ebom_candidates(I) n_ebom_candidates The EBOM candidate lines to search from.
n_criteria(I) The number of search criteria.
property_names(I) n_criteria The list of property names in the search criteria.
property_types(I) n_criteria The list of primitive property types in the search criteria.
Valid values are:
  • 0 for integer
  • 1 for string
  • 2 for character
  • 3 for double
  • 4 for boolean
operators(I) n_criteria The list of relational operators in the search criteria.
Valid values are:
  • 0 for =
  • 1 for <=
  • 2 for >=
  • 3 for <=/li>
  • 4 for >
  • 5 for !=

Currently only = is supported.
values(I) n_criteria The list of property values in the search criteria. To compare two property values to each other, specify NULL in the value.
is_empty_value_valid(I) n_criteria Indicates if the value can be an empty string or not. Valid values are 0 (empty string invalid) and 1 (empty string valid).
is_mandatory(I) n_criteria Whether a specific criteria is mandatory or not. Valid values are 0 (optional) and 1 (mandatory).
user_data(I) Opaque data passed in.
The out-of-the-box implementation of this user exit ITK does not leverage this data. Implementors of an override can, however, use it.
matching_candidates(OF) The matching EBOM candidates for all input mbom_lines. The first dimension of the list represents the candidate lists for all MBOM lines, and the size of it is specified by n_mbom_lines. The second dimension of the list represents the candidate list for each MBOM line, and this candidate list is terminated by a NULLTAG. If an MBOM line does not have matching EBOM candidates, its candidate list is NULL. The memory is deallocated by calling MEM_free on each dimension container.
property_indices(OF) The indices of the property_names by which the EBOM candidates are matched. The first dimension of the list represents the property lists for all MBOM lines, and the size of it is specified by n_mbom_lines. The second dimension of the list represents the property list for each MBOM line, and this property list is terminated by NULL. The third dimension of the list represents the property list for each matching EBOM line, and this property list is terminated by -1. If an MBOM line does not have matching EBOM candidates, its matching property list is NULL. The memory is deallocated by calling MEM_free on each dimension container.
ME_API int USER_BOMLINE_repair_bomlines ( int  n_lines,
const tag_t mbom_lines,
const tag_t ebom_lines,
const char **  repair_actions,
int  n_propagation_properties,
const char **  propagation_properties,
int **  statuses,
char ****  error_messages 
)

Repairs Manufacturing BOM (MBOM) lines from their equivalent Engineering BOM (EBOM) lines given a list of repair actions.
If the user exit is not overridden, the default implementation either replaces the MBOM line or propagates the EBOM line properties.

Note
Repairing MBOM lines can be done by redefining the implementation of this user exit function.
When implementing the extension function registered against the operation BMF_BOMLINE_repair_bomlines_msg on BOMLine (or any of its subclasses), its arguments must match the exact same arguments as this ITK.
If any value in statuses is 2 or 3, the user exit function must return ME_USER_EXIT_CONTINUE in order to delegate the custom repair action to the out-of-the-box repair action.
Returns
Parameters
n_lines(I) The number of MBOM lines to repair.
mbom_lines(I) n_lines The list of MBOM lines to repair.
ebom_lines(I) n_lines The parallel list of equivalent EBOM lines to repair from.
repair_actions(I) n_lines The list of repair actions. The out-of-the-box values for the repair action are "Propagate" and "Replace".
n_propagation_properties(I) The number of properties to propagate for partial matched lines. If the repair action is "Propagate", n_propagation_properties must be greater than 0. Otherwise, it must be 0.
propagation_properties(I) n_propagation_properties The list of properties to propagate for partial matched lines. This list is applicable only if the repair action is "Propagate". It will be NULL for other repair actions.
statuses(OF) List of statuses of MBOM lines' repair.
Valid values are:
  • 0 for succeeded
  • 1 for failed
  • 2 for delegate to Propagate
  • 3 for delegate to Replace/li>

The customization code is expected to allocate memory for this variable using MEM_alloc, and set one of the above statuses for each line it repairs.
The memory is deallocated by calling MEM_free on the array of statuses.
error_messages(OF) The error strings for the repaired MBOM lines.
The first dimension of the list represents the error strings for all MBOM lines, and the size of it is specified by n_lines. The second dimension of the list represents the error strings for each MBOM line, and this list is terminated by NULL.
The customization code is expected to allocate memory for this variable using MEM_alloc. If the customization code sets the status to 2 or 3 for a line at index i, or if the customization code decides there is no error for that line, the corresponding error list for that line must be set to NULL, i.e., (*error_messages)[i] = NULL.
The memory is deallocated by calling MEM_free on each element and on each container for each dimension.
ME_API int USER_create_or_ref_item ( tag_t  ebom_node,
tag_t  ebom_line_node,
const char *  user_data,
int *  num_mfk_keys,
char ***  mfk_keys,
char ***  mfk_values,
tag_t to_be_created_type,
tag_t create_input 
)

Generates a Manufacturing BOM (MBOM) when an Engineering BOM (EBOM) is being used as a basis.
The parameter user_data is a pass-through data from ME_create_mbom_from_ebom or ME_update_mbom_from_ebom.
If the user exit is not overridden, default implementation creates a new item instance based on EBOM node if second argument is topline of structure. Implementator operation should always return NULL pointer for create_input to indicate referenced/shared item.

Note
The create_input object must be populated with all the details including compound create inputs. Potentially clients can override finalizeCreateInput and/or createPost. So, any additional data needed in those methods should be filled in here.
When implementing the extension function registered against the operation "BMF_ITEM_create_or_ref_id" on Item (or any of its subclass), its arguments must match the exact same arguments as this ITK.
This ITK must not be invoked directly. Teamcenter will call it during MBOM mirror creation or update.
Returns
Parameters
ebom_node(I) The source item.
ebom_line_node(I) The BOMLine corresponding to the source item.
user_data(I) Opaque data passed in.
The out-of-the-box implementation of this user exit ITK does not leverage this data. Implementors of an override can, however, use it.
num_mfk_keys(O) number of mfk key value pairs. Set to 0 if unused.
mfk_keys(OF) num_mfk_keys MFK keys if item_id is not unique. object_type and item_id need not be added. Array is packed.
mfk_values(OF) num_mfk_keys MFK values corresponding to mfk keys. Array is packed..
to_be_created_type(OF) type of mbom item to be created. If referencing ebom item type, set to NULLTAG.
create_input(OF) The createInput object to be populated by callee.
ME_API int USER_item_action_on_release ( tag_t  ebom_item,
tag_t  ebom_line_node,
tag_t  mbom_released_object,
tag_t  mbom_line_node,
const char *  user_data,
int  suggested_action_on_release,
logical modify_released,
int *  action_on_release 
)

Determines the action to take if the underlying item object to be modified is released.
The parameter user_data is pass-through data from ME_create_mbom_from_ebom or ME_update_mbom_from_ebom.
The parameter suggested_action_on_release is passed in from ME_create_mbom_from_ebom or ME_update_mbom_from_ebom.
If the user exit is not overridden, the default implementation is to use the value for the parameter suggested_action_on_release.

Note
When implementing the extension function registered against the operation "BMF_ITEM_action_on_release" on Item (or any of its subclass), its arguments must match the exact same arguments as this ITK.
This ITK must not be invoked directly. Teamcenter will call it during MBOM mirror creation or update.
Returns
  • ITK_ok on success.
  • ME_invalid_input_data if an invalid item is provided for ebom_item or ebom_line_node or mbom_released_object or mbom_line_node or suggested_action_on_release.
  • Possibly other errors
Parameters
ebom_item(I) The source Item
ebom_line_node(I) The BOM Line corresponding to the source Item whose children need to be synchronized.
mbom_released_object(I) The released MBOM object. Currently, this can only be subtype (or subclass) of Item or ItemRevision or BOM View Revision.
mbom_line_node(I) The target BOM Line equivalent to the source ebom_line_node.
user_data(I) Opaque data passed in.
The out-of-the-box implementation of this user exit ITK does not leverage this data. Implementors of an override can, however, use it.
suggested_action_on_release(I) Default action to take. Valid values are:
modify_released(O) If the released node mbom_released_object is currently modifiable, setting this flag to 1 will modify the released object, irrespective of the value of action_on_release.
action_on_release(O) Action to perform. Valid values are:
ME_API int USER_item_find_equivalent_line ( tag_t  ebom_item,
tag_t  ebom_line_node,
tag_t  mbom_parent_node,
const char *  user_data,
tag_t mbom_line_node 
)

Generates a Manufacturing BOM (MBOM) when an Engineering BOM (EBOM) is being used as a basis.
The parameter user_data is a pass-through data from ME_create_mbom_from_ebom or ME_update_mbom_from_ebom.
If the user exit is not overridden, default implementation is empty.

This function is invoked only if Id in context (top level) equivalence is not met and occurrence threads are different.

Note
When implementing the extension function registered against the operation "BMF_ITEM_find_eqv_line" on Item (or any of its subclass), its arguments must match the exact same arguments as this ITK.
This ITK must not be invoked directly. Teamcenter will call it during MBOM mirror creation or update.
Returns
  • ITK_ok on success.
  • ME_invalid_input_data if an invalid item is provided for ebom_item or ebom_line_node or mbom_line_node.
  • Possibly other errors
Parameters
ebom_item(I) The source Item
ebom_line_node(I) The BOMLine corresponding to the source Item whose children need to be synchronized.
mbom_parent_node(I) The target BOMLine where the synchronized needs to be done.
user_data(I) Opaque data passed in.
The out-of-the-box implementation of this user exit ITK does not leverage this data. Implementors of an override can, however, use it.
mbom_line_node(O) MBOM Line equivalent to the EBOM Line.
ME_API int USER_sync_item ( tag_t  ebom_item,
tag_t  ebom_line_node,
tag_t  mbom_line_node,
const char *  user_data 
)

Generates a Manufacturing BOM (MBOM) when an Engineering BOM (EBOM) is being used as a basis.
The parameter user_data is a pass-through data from ME_create_mbom_from_ebom or ME_update_mbom_from_ebom.
If the user exit is not overridden, default implementation synchonizes occurrence level attributes.

Note
Synchronization of removed lines can be done by redefining the implementation of this user exit function.
When implementing the extension function registered against the operation "BMF_ITEM_sync" on Item (or any of its subclass), its arguments must match the exact same arguments as this ITK.
This ITK must not be invoked directly. Teamcenter will call it during MBOM mirror creation or update.
Returns
  • ITK_ok on success.
  • ME_invalid_input_data if an invalid item is provided for ebom_item or ebom_line_node or mbom_line_node.
  • Possibly other errors
Parameters
ebom_item(I) The source Item.
ebom_line_node(I) The BOMLine corresponding to the source Item whose children need to be synchronized.
mbom_line_node(I) The target BOMLine where the sync needs to be done.
user_data(I) Opaque data passed in.
The out-of-the-box implementation of this user exit ITK does not leverage this data. Implementors of an override can, however, use it.