With the release of the AppCloud, Mendix introduced a new project layout and module that make use of the new Mendix AppCloud services. With the AppCloud Default Project layout you can easily create new apps that make use of AppCloud services out of the box. You can upgrade your existing app with the separate AppCloudServices module. Do you want to know more about all the possibilities this opens up? Take a look at the press release.
In this how-to we will explain how you can incorporate the AppCloudServices module into your existing app.
1. Read More
The AppCloudServices module requires version 5.3.2 of the Mendix Modeler. If your app was not created with Mendix 5.3.2 or newer, you need to convert it first. For more information about converting apps, see this page.
2. Step-by-step Guide with an Example
This how-to uses version 3.0 of the Company Expenses (CE) app, which does not yet contain the AppCloudServices module. This version can be found in the Modeler AppStore by going to the app page and opening the versions tab. Company Expenses 3.0 was built in an older version of Mendix, so it should first be converted to Mendix 5.3.2.
- Start the Mendix Modeler and open your existing app that has been converted to Mendix 5.3.2 or newer.
- Open the App Store inside the Mendix Modeler.
- Search for AppCloudServices, click on the AppCloudServices module created by Mendix and click Download.
Select Add as a new module and click on Import. The module should now be visible in the project explorer: Once the module has been imported, you can make use of the Mendix AppCloud Navigation widget. In order to do this, make sure all starting pages in your app use the
AppCloudMasterLayoutas their master layout. In the CE app, we need to apply the master layout to both
Do not forget pages which can be opened through microflows and deeplinks.
If your app does not make use of Mendix 5 layouts yet, you need to convert your app to use Mendix 5 layouts on every page (in Mendix 4, pages were called “forms”). Alternatively, you can manually add the Mendix AppCloud Navigation widget to all pages that are used as starting pages.
Copy and rename the (excluded) microflow
Example_OnFirstLoginAppCloudUser(located in the folder
Single Sign On/
API) to an appropriate module and include it.
In the CE app, copying it to the
Expensesmodule and renaming it to
OnFirstLoginAppCloudUseris a logical choice.
Any changes made to the AppCloudServices module in your app will be overwritten when you upgrade to a newer version of the AppCloudServices module.
InvokeOnFirstLoginAppCloudUsermicroflow from the
Single Sign On/Implementationfolder. There you will find an action called
Call OnFirstLoginAppCloudUser. You need to change this action so it will call the microflow created in the previous step.
Add the boolean attribute
**IsLocalUser** (with default **true**) to your app user entity. This is the entity that represents your user accounts. It extends the
System.Userentity. The boolean attribute allows you to differentiate between Mendix accounts and local accounts. For the CE app this entity is located in the
Expensesmodule and is called
Expenses.Employee. It is a good idea to give the administrator role(s) (or equivalent) read access to the
IsLocalUserattribute with an access rule.
Open the microflow you copied in step 5.
Open the Create action and select your app user entity as the object type to be created, instead of the pre-selected
UserManagement.Account. You will need to re-set the two attributes in the Create action afterwards.
In the CE app you want to change it to
Expenses.Employee, and change the first attribute to
FullNameand the second to
IsLocalUser. Now you want to make sure the
StartAppCloudServicesmicroflow is called during startup.
Open the Project Settings.
Go to the Model tab, and set
AppCloudServices.StartAppCloudServicesas the After startup microflow. Alternatively, you can call this microflow in your own After startup microflow.
If this microflow is not called during startup, your users will encounter 404 Not Found errors when trying to navigate to your app from the Launchpad.
Congratulations! Your app now makes use of the AppCloud services.
When you deploy your upgraded app in the AppCloud it will now be automatically added to your Launchpad. Opening the app from your Launchpad will automatically log you in with your Mendix account, and you can easily invite other Mendix accounts through app user management.
3. Related content
- Different user logins when integrated with Mendix SSO
- Trends in Mendix Cloud v3
- How to Deploy to the Mendix Cloud
- How to deploy a Mendix app on Azure
- Sending Email
After completing this how to on configuring AppCloud services, you might want to check out how to improve logging in with different types of user accounts.