Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@

### Adding the Component to Active Workspace{#adding-component}

1. Obtain the `MendixEmbedded` component from [GitHub](https://github.com/mendixlabs/mendix-inside-teamcenter).
2. Install the component into your Active Workspace stage repository under `src/repo`.
3. Configure the component with the URL of your Mendix runtime.
4. Optionally, set up context passing. For more information, see [Passing Context from Teamcenter](#passing-context).
1. Obtain the `mx-in-tc` kit (containing the `MendixEmbedded` component) from the [mendix-inside-teamcenter](https://github.com/mendixlabs/mendix-inside-teamcenter) repo in GitHub.

Check failure on line 109 in content/en/docs/refguide/runtime/mendix-client/mendix-inside-teamcenter.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.Capitalization] Use ''Mendix'' (capitalized) Raw Output: {"message": "[Mendix.Capitalization] Use ''Mendix'' (capitalized)", "location": {"path": "content/en/docs/refguide/runtime/mendix-client/mendix-inside-teamcenter.md", "range": {"start": {"line": 109, "column": 84}}}, "severity": "ERROR"}
2. Install the kit in your Active Workspace stage repository under `src/repo`.
3. Configure the `MendixEmbedded` component with the URL of your Mendix runtime.
4. Optionally, configure context passing. For more information, see [Passing Context from Teamcenter](#passing-context).
5. Rebuild Active Workspace using `awbuild.cmd`.

To verify the component was picked up correctly, check that its view model entry exists in the `src/repo/out/pathMap.json` registry file in the build output.
Expand Down Expand Up @@ -142,6 +142,20 @@

Detailed Active Workspace customization and build steps are outside the scope of this documentation. Refer to the Siemens [Active Workspace Customization](https://docs.sw.siemens.com/en-US/doc/282219420/PL20250520748650994.Configuration/yiv1688486682769) documentation for instructions (link requires authentication).

### Registering the Component on an XML Rendering Template (XRT)

To display the Mendix app on an XRT, add the following to the document using the XRT editor:

```xml
<htmlPanel
declarativeKey="MendixEmbedded"
context="https://your-mendix-runtime.example.com">
</htmlPanel>
```

* The `htmlPanel` component loads custom components in Active Workspace.
* Set `declarativeKey` to `MendixEmbedded`, the name of the component obtained in the [Adding the Component to Active Workspace](#adding-component) section.

## Configuring the Content Security Policy (CSP) in Teamcenter

Active Workspace enforces a Content Security Policy that must be updated to allow Mendix content to load.
Expand Down Expand Up @@ -209,16 +223,30 @@

## Passing Context from Teamcenter {#passing-context}

The `MendixEmbedded` Active Workspace component passes Teamcenter object context to the Mendix app as startup parameters. These are configured in the Active Workspace component and forwarded to the Mendix `render()` call as the `parameters` object.
The `MendixEmbedded` Active Workspace component passes Teamcenter object context to the Mendix app as startup parameters. Configure these parameters in the `context` and `declarativeKeyContext` fields of the XRT `htmlPanel` and Product Lifecycle (PL) Home card.

Pass context values as explicit URL query parameters. Use `target={context.path}` to map a value from the Teamcenter context, or `target=value` to pass a hardcoded primitive value. For example, the following URL passes the selected item's UID and a hardcoded mode:

```text
https://your-mendix-runtime.example.com/?itemUID={selected.uid}&mode=edit
```

Use dot notation to access nested context values. In an XRT, write query parameter separators as `&amp;`. In a PL Home card, use `&` directly.

An unavailable context path causes the parameter to receive `undefined`.

{{% alert color="info" %}}
Objects and arrays are not supported as Mendix parameters.
{{% /alert %}}

Please see `mx-in-tc-context` on [GitHub](https://github.com/mendixlabs/mendix-inside-teamcenter) for an example of how to pass the identifier of the selected object to the embedded Mendix application.
For more information about configuring context, see the []`mx-in-tc` README](https://github.com/mendixlabs/mendix-inside-teamcenter/blob/main/mx-in-tc/README.md) on GitHub.

For the full `render()` API, see [Embedding the Client](/refguide/mendix-client/embedding-the-client/).

### Best Practices for Context Parameters

* **Use persistable object IDs only.** Pass `Item` UIDs or `ItemRevision` UIDs. These are stable and unique across sessions.
* **Avoid non-persistable IDs.** BOM line IDs are runtime calculation results that lose synchronization when Teamcenter configuration rules change. Do not use them as parameters.
* **Avoid non-persistable IDs.** Bill of Materials (BOM) line IDs are runtime calculation results that lose synchronization when Teamcenter configuration rules change. Do not use them as parameters.
* **Prefer `Item` IDs over `ItemRevision` IDs** where possible. `Item` IDs are context-independent and do not depend on the revision rule in effect.
* **Discover available parameters** by referring to the Active Workspace documentation for a list of available context parameters.

Expand Down