Document Mendix inside Teamcenter (public Beta, 11.12)#11384
Conversation
|
Jonathan Diehl seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
wanchoorohan
left a comment
There was a problem hiding this comment.
Provided few suggestions.
|
|
||
| | | Mendix | Teamcenter | Teamcenter Connector | | ||
| | --- | --- | --- | --- | | ||
| | **Beta** | 11.12 | 2512 | 2512.1.0 or above | |
There was a problem hiding this comment.
Don't you need TcC 2606 for the login enhancements? - https://mendix.slack.com/archives/C0B6TMJ3SUC/p1781199462908459
There was a problem hiding this comment.
Yes indeed, the user should use TcC 2606 with the latest changes (which is compatible with 2512 if I understood correctly)
There was a problem hiding this comment.
So the conclusion is
| | **Beta** | 11.12 | 2512 | 2512.1.0 or above | | |
| | **Beta** | 11.12 | 2512 | 2606.0.0 or above | |
I note that this version is not yet available in Marketplace, does this mean this PR should wait until it is released?
| 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). | ||
| 5. Rebuild Active Workspace. |
There was a problem hiding this comment.
Can we provide the command to do this? Is it awbuild?
There was a problem hiding this comment.
Yes indeed, it is awbuild.cmd. I would assume the user to know this already though, not sure if we need to add it to the docs
| 4. Optionally, set up context passing. For more information, see [Passing Context from Teamcenter](#passing-context). | ||
| 5. Rebuild Active Workspace. | ||
|
|
||
| To verify the component was picked up correctly, check that its view model entry exists in the `pathMap.json` registry file in the build output. |
There was a problem hiding this comment.
Where does pathmap.json reside? Would the users know this?
There was a problem hiding this comment.
It is located at src/repo/out/pathMap.json, not sure if this is common knowledge. Not sure if this is needed
|
|
||
| ### Registering the Component on a Page | ||
|
|
||
| To display the Mendix app on an Active Workspace page, add a card definition for it to the relevant `layoutsViewModel.json` file in your AWC stage repository. Set `declarativeKeyContext` to the URL of your Mendix runtime: |
There was a problem hiding this comment.
Same question for layoutsViewModel.json
There was a problem hiding this comment.
This is located in the src/repo, but depends on which PL Home screen you want to add the card to. Would be nice if there is Teamcenter documentation we can link to, but I cannot find that.
|
|
||
| The following example shows how the AWC component passes a selected Teamcenter item UID to the Mendix app: | ||
|
|
||
| ```js |
There was a problem hiding this comment.
This example corresponds more to the actual component:
(including PascalCase for parameter key)
const app = await import(/* webpackIgnore: true */ `${mendixUrl}'dist/embedded-index.js'`);
cleanup = await app.render(container, {
remoteUrl: mendixUrl,
minHeight: '100vh',
parameters: {
SelectedItem: selectedItem
}
});
|
|
||
| 1. **Add an SSO Login Button to the Login Page**: | ||
|
|
||
| Add a Teamcenter SSO login button to the Mendix app's `login.html` so users can initiate the TcSS authentication flow. For instructions, see [Adding an SSO Login Button to Your Login Page](/appstore/modules/siemens-plm/configuring-connection-2512/#add-sso-login-button). Optionally, use JavaScript to trigger the authentication automatically. Note that browsers may block the popup unless it is triggered directly by a user action. |
There was a problem hiding this comment.
See above, this should be removed
|
|
||
| 1. **Configure User Provisioning**: | ||
|
|
||
| Set up user provisioning so that Mendix accounts are matched to Teamcenter users on login. For instructions, see [User Provisioning for SSO](/appstore/modules/siemens-plm/configuring-connection-2512/#user-provisioning-for-sso). |
There was a problem hiding this comment.
User provisioning should be setup with EXAMPLE_UserProvisioningAnonymous. For the Mendix application itself, anonymous users should be disabled
|
|
||
| ## Configuring Authentication {#authentication} | ||
|
|
||
| During Beta, authentication uses the Teamcenter Connector's Teamcenter SSO flow. The Mendix app login page shows an SSO button. When a user clicks it, they are redirected to Teamcenter Security Services (TcSS) for authentication. After a successful login, TcSS redirects back to the Mendix app, where the user is provisioned or matched to an existing Mendix account and a Teamcenter Connector session is established. |
There was a problem hiding this comment.
This part is incorrect. There is no need to add an SSO button, after setting up the Teamcenter connector, the authentication is done with the popup logic in the AW component, which uses the Tc Connector published REST endpoint, no need to change login.html.
| 1. **Add an SSO Login Button to the Login Page**: | ||
|
|
||
| Add a Teamcenter SSO login button to the Mendix app's `login.html` so users can initiate the TcSS authentication flow. For instructions, see [Adding an SSO Login Button to Your Login Page](/appstore/modules/siemens-plm/configuring-connection-2512/#add-sso-login-button). Optionally, use JavaScript to trigger the authentication automatically. Note that browsers may block the popup unless it is triggered directly by a user action. | ||
|
|
There was a problem hiding this comment.
Instead, for now the following needs to be configured (there are plans to improve this):
- Add a JavaScript action called JS_CloseWindow with the following:
*/
export async function JS_CloseWindow() {
// BEGIN USER CODE
window.close();
// END USER CODE
}
- Add a Nanoflow that calls this JavaScript action
- Add an empty page called 'AuthSuccess' to the application which contains an 'Component load' event that calls this Nanoflow
- Change the
DL_HandleSSOLoginMicroflowto showAuthSuccessinstead of the home page as the last action in the Microflow.
|
@jdiehl |
| {{% alert color="info" %}} | ||
| Both the Mendix runtime and the Active Workspace server must be served over HTTPS. When `SameSiteCookies` is set to `None`, the `Secure` attribute is automatically added to cookies, which requires HTTPS on both origins. | ||
| {{% /alert %}} | ||
|
|
There was a problem hiding this comment.
CORS should also be enabled for the TCSSO Published Rest Service, add the Teamcenter origin to the allow origin, as described at CORS Settings for Published REST Services
There was a problem hiding this comment.
This sounds like it needs a third section heading. CORS for Team Center SSO or something.
Is this a configuration which is needed in this app or is it applied somewhere else? I haven't seen a TCSSO published REST Service as a prerequisite for this how-to.
Can you propose something to cover this?
| } | ||
| ``` | ||
|
|
||
| The `parameters` object is available to the Mendix app at startup. Use a JavaScript action on the home page to read parameters and pass them to your application logic. |
There was a problem hiding this comment.
This would be the actual code snippet needed to pass the uid as a parameter (code that needs to be be added is prefixed with >>):
export const mendixRenderFunction = (props) => {
const [error, setError] = useState(null);
>> const selectedItem = props.ctx?.selected?.uid ?? '';
const mendixUrl = getMendixUrl(props);
if (mendixUrl === undefined) {
setError('There is no Mendix URL configured. Contact support to resolve this issue.');
}
const retryError = () => {
setError(null);
};
const load = useCallback(async (container) => {
mendixCleanupFunction();
if (!container) {
return;
}
try {
if (REQUIRE_SESSION) {
await ensureHasValidSession(mendixUrl);
}
const app = await import(/* webpackIgnore: true */ `${mendixUrl}dist/embedded-index.js`);
const cleanup = await app.render(container, { remoteUrl: mendixUrl, minHeight: '100vh',
>> parameters: { SelectedItem: selectedItem }
});
const onReload = () => load(container);
container.addEventListener(RELOAD_EVENT, onReload, { once: true });
currentMendixCleanup = () => {
container.removeEventListener(RELOAD_EVENT, onReload);
cleanup?.();
};
} catch (error) {
setError(error);
}
}, [mendixUrl,
>> selectedItem
]);
if (error) {
if (error.code === 'POPUP_BLOCKED') {
return <PopupBlockedView subPanelContext={{ retry: retryError }} />;
}
return <GeneralErrorViewModel subPanelContext={{ errorMessage: error.message ?? 'An unexpected error occurred.', retry: retryError }} />;
}
return <div ref={load} style={{ width: '100%', height: '100vh' }} />;
};
MarkvanMents
left a comment
There was a problem hiding this comment.
I started reviewing this, but realize that there are a lot of things which are still awaiting confirmation/more documentation.
Can you let me know when this is ready for me to do more work on it?
|
|
||
| | | Mendix | Teamcenter | Teamcenter Connector | | ||
| | --- | --- | --- | --- | | ||
| | **Beta** | 11.12 | 2512 | 2512.1.0 or above | |
There was a problem hiding this comment.
So the conclusion is
| | **Beta** | 11.12 | 2512 | 2512.1.0 or above | | |
| | **Beta** | 11.12 | 2512 | 2606.0.0 or above | |
I note that this version is not yet available in Marketplace, does this mean this PR should wait until it is released?
| {{% alert color="info" %}} | ||
| Both the Mendix runtime and the Active Workspace server must be served over HTTPS. When `SameSiteCookies` is set to `None`, the `Secure` attribute is automatically added to cookies, which requires HTTPS on both origins. | ||
| {{% /alert %}} | ||
|
|
There was a problem hiding this comment.
This sounds like it needs a third section heading. CORS for Team Center SSO or something.
Is this a configuration which is needed in this app or is it applied somewhere else? I haven't seen a TCSSO published REST Service as a prerequisite for this how-to.
Can you propose something to cover this?
Description
New reference page under
/refguide/mendix-client/mendix-inside-teamcenter/documenting how to embed a Mendix web app as a native component inside Siemens Teamcenter Active Workspace using the embedded client.This builds on the embedded client documentation added by @WimJongeneel in #11204 and is tied to the 11.12 release.
Changes
refguide/runtime/mendix-client/mendix-inside-teamcenter.mdrefguide/runtime/mendix-client/_index.mdwith a cross-reference to the new pageCoverage
The new page covers:
MendixEmbeddedAWC component and registering it on a pagegateway/config.jsondirectives)