Triggering a Microflow From a Menu Item
Introduction
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 document explains how you can create a very simple “Hello World” microflow and trigger it from a menu item.
This document teaches you how to do the following:
- Create a menu item
- Create and edit a microflow
Creating a Menu Item
You will create a menu item that triggers a microflow and shows the Hello World message to the end-users.
Microflows can be triggered in many different ways. In this document, you will learn to use a menu item to trigger a microflow.
To create a menu item, follow these steps:
-
Open the Navigation editor.
-
In the Responsive tab > the Menu section, click New Item:
-
In the New Menu Item dialog box, set the Caption to Hello World:
-
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.
You have created the menu item that will trigger the Hello World microflow.
Editing the New Microflow
The new microflow is now empty and needs to be configured to show the message to the end-users.
To edit the new microflow, follow these steps:
-
Open the Hello World microflow by right-clicking the new menu item created in the Creating a Menu Item section above and selecting Go to target from the context menu:
You will see an empty microflow like this:
-
Open the Toolbox and search for the Show message activity:
-
Drag the Show message activity from the Toolbox into the flow between the start event and end event:
-
Double-click the Show message activity to open its properties.
-
Enter Hello World for the Template value and click OK:
-
Click Run Locally () and then View App to see the application in your default browser.
-
Click the Hello World menu item in the menu bar to see the message:
Congratulations! You have created a menu item that triggers a microflow and shows a Hello World message to your end-users!
Read More
- Navigation
- Menu Item
- Creating a Custom Save Button with a Microflow
- Working with Lists in a Microflow