Mendix uses visual models called microflows to define the logic of your application. Microflows are visual ways of expressing what traditionally would be written in code. This how-to explains how you can create a very simple “Hello World” microflow.
This how-to will teach you how to do the following:
- Create a menu item
- Create and edit a microflow
Microflows can be triggered in many different ways (for details, see Trigger Logic Using Microflows). For this how-to, you’ll be using a menu item to trigger the new microflow.
To create a menu item, follow these steps:
Open the Navigation editor, add a menu item in the desktop navigation settings, and enter the caption of Hello World:
Click Select… in the Target section of the New Menu Item dialog box to open the Select Navigation Target pop-up window:
For On click, select Call a microflow:
In the Select Microflow dialog box, select a microflow and then click New:
Enter HelloWorld for the Name of the new microflow.
Save the new menu item by clicking OK.
3 Editing the New Microflow
To edit the new microflow, follow these steps:
Open the new microflow by right-clicking the new menu item created in 2 Creating a Menu Item and selecting Go to target from the context menu:
You will see an empty microflow like this:
Open the Toolbox in the bottom-right corner of the Modeler:
Drag a Show message action from the Toolbox to the line between the green start even and red end event, which will insert a show message action activity:
Double-click the message activity to open the Show Message properties editor.
Enter Hello World for the Template value and click OK:
Run the application locally and click View to see the application in your default browser:
Locate the new navigation item in the menu bar and click it to see the message.
4 Related Content
- How to Define Access Rules Using XPath
- How to Trigger Logic Using Microflows
- How to Create a Custom Save Button
- How to Extend Your Application with Custom Java
- How to Work with Lists in a Microflow
- How to Optimize the Retrieve Activities
- How to Configure Error Handling
- How to Optimize Microflow Aggregates
- How to Extract and Use Sub-Microflows