|
| 1 | +--- |
| 2 | +title: "Advanced Customization Options" |
| 3 | +url: /partners/siemens/bom-widget-customization/ |
| 4 | +weight: 3 |
| 5 | +description: "Describes the customization capabilities that allow developers to add data from external systems, and how these can be combined into the Teamcenter BOM widget." |
| 6 | +--- |
| 7 | + |
| 8 | +## Augmenting with Mendix Data |
| 9 | + |
| 10 | +Client columns allow you to display custom data next to Teamcenter properties in the BOM view. The widget calls the following two microflows: |
| 11 | + |
| 12 | +* `CUSTOM_RetrieveClientColumnDefinitions` – Microflow to retrieve the client column definitions: client column name, width, and column order. |
| 13 | +* `CUSTOM_RetrieveClientColumnData` – Microflow to retrieve the additional cell data to display for the BOM lines and client columns. |
| 14 | + |
| 15 | +As a developer, you are free to implement this according to your own needs. Additional data includes calculated values, third-party data, or data from the database. |
| 16 | + |
| 17 | +### CUSTOM_RetrieveClientColumnDefinitions |
| 18 | + |
| 19 | +This microflow is invoked by the Teamcenter BOM widget to retrieve the definitions of the client columns to display in the widget. |
| 20 | + |
| 21 | +{{< figure src="/attachments/partners/siemens/teamcenter-bom-component/custom-retrieveclientcolumndefinitions.png">}} |
| 22 | + |
| 23 | +#### Input Parameter |
| 24 | + |
| 25 | +* **Object**: `MendixColumnRoot` |
| 26 | +* **Attribute**: |
| 27 | + |
| 28 | + * `WidgetId` is a unique identifier for the specific Teamcenter BOM widget instance that is making the request. This is useful if your app includes multiple Teamcenter BOM widgets that need to display different columns. You can use this ID to differentiate and return the appropriate data. |
| 29 | + |
| 30 | +{{< figure src="/attachments/partners/siemens/teamcenter-bom-component/domain-model-mendixcolumnroot.png">}} |
| 31 | + |
| 32 | +#### Return Value |
| 33 | + |
| 34 | +* **Object**: `List of ClientColumn` |
| 35 | +* **Attributes**: |
| 36 | + |
| 37 | + * `Name` – The name of the client column. This name is used in the UI of the Teamcenter BOM widget as the column title. |
| 38 | + * `ColumnOrder` – The order of the column within the widget, respectively. Teamcenter columns also have their own order, so this needs to be filled in conjunction. If the order is identical, Teamcenter columns take priority. |
| 39 | + The first column should be object_string, which is already defined. |
| 40 | + All Mendix client columns must start with `columnOrder 2` and will be displayed before the Teamcenter columns. |
| 41 | + Mendix columns are sorted based on their `columnOrder` parameter. |
| 42 | + Teamcenter columns are displayed after the client columns. |
| 43 | + The `columnOrder` for Teamcenter columns is defined by the Teamcenter administrator using the column configuration utilities in the Teamcenter Admin Console. |
| 44 | + |
| 45 | +{{< figure src="/attachments/partners/siemens/teamcenter-bom-component/domain-model-clientcolumn.png">}} |
| 46 | + |
| 47 | +### CUSTOM_RetrieveClientColumnData |
| 48 | + |
| 49 | +This microflow is invoked by the Teamcenter BOM widget to retrieve the data to be rendered in the BOM tree. It gathers cell data for specific BOM lines and any client columns. |
| 50 | + |
| 51 | +{{< figure src="/attachments/partners/siemens/teamcenter-bom-component/custom-retrieveclientcolumndata.png">}} |
| 52 | + |
| 53 | +#### Input Parameter |
| 54 | + |
| 55 | +* **Object**: `MendixDataRoot` |
| 56 | +* **Attributes and associations**: |
| 57 | + |
| 58 | + * `WidgetId` – A unique identifier for the specific Teamcenter BOM widget instance that is making the request. This is useful if your app includes multiple Teamcenter BOM widgets that need to display different data. You can use this ID to differentiate and return the appropriate data. |
| 59 | + * Associated `MendixDataColumnName` objects – This list specifies which custom columns the widget is configured to display. Each object has a `Name` attribute, representing the identifier of a custom column. |
| 60 | + * Associated `MendixDataBOMLine` objects – This list contains the specific BOM lines for which the widget requires data. Each object includes attributes such as `ItemId`, `RevisionId`, `RevisionUId`, and `BOMlineUid` to identify the BOM line and its `ItemRevision`. |
| 61 | + |
| 62 | +{{< figure src="/attachments/partners/siemens/teamcenter-bom-component/domain-model-mendixdataroot-with-associations.png">}} |
| 63 | + |
| 64 | +#### Return Value |
| 65 | + |
| 66 | +* **Object**: `List of ClientDataResponse` |
| 67 | +* **Attributes**: |
| 68 | + |
| 69 | + * `Value` – The value to display in a targeted cell in the BOM. |
| 70 | + * `ClientColumnName` – The name of the column of the targeted cell. |
| 71 | + * `ItemRevisionUID` – The item revision UID of the corresponding BOM line of the targeted cell. |
| 72 | + |
| 73 | +{{< figure src="/attachments/partners/siemens/teamcenter-bom-component/domain-model-clientdataresponse.png">}} |
| 74 | + |
| 75 | +### ClientColumn Overview Page |
| 76 | + |
| 77 | +For convenience, the `TcBOMModule` includes overview and edit pages to define and manage `ClientColumns`. |
| 78 | + |
| 79 | +## Upgrade Note |
| 80 | + |
| 81 | +Please be aware that any direct modifications made to this specific microflow within the `TcBOMModule` will be overwritten and lost during future upgrades of the `TcBOMModule`. |
| 82 | + |
| 83 | +To ensure your custom data retrieval logic is preserved across upgrades, Mendix highly recommends that you to create two new microflows in your own module to fetch the column definition and cell-data, and to return a list of `ClientColumn` objects and `ClientDataResponse` objects, respectively. These microflows can then be called in `CUSTOM_RetrieveClientColumnDefinitions` and `CUSTOM_RetrieveClientColumnData`. |
0 commit comments