Step 4: Add Logic to the Microflows

Last update: Download PDF Edit

1 Introduction

This is the final how-to in the series for creating a to-do app based on the Mendix Mobile Quick Starter app.

This how-to will teach you how to do the following:

  • Add logic to the microflows
  • Simulate touch behavior of mobile device

2 Prerequisites

Before starting this how-to, make sure you have completed the following prerequisite:

3 Adding Logic to the Microflows

The List view swipe widget has been configured, but the two microflows you created do not have any logic yet. Follow these steps to add logic to the microflows so they will execute the behavior we want:

  1. Open the ACT_ToDo_Delete microflow.
  2. Add an Activity that deletes the ToDo object and refreshes the client.
  3. Open the ACT_ToDo_MarkAsCompleted microlfow.
  4. Add an Activity that changes the Completed attributed of the ToDo object to true and set Commit to Yes.

4 Running the App and Simulating Touch Behavior of Mobile Device

The app is now finished, so you are going to view it on a simulated mobile device. To emulate the touch behavior of a user on a mobile device (which is mentioned in Step 2: Create the Pages), follow these steps:

  1. Save all changes and run the app locally.
  2. Open the View drop-down menu and select Responsive Browser (F9).
  3. Change the URL to http://localhost:8080/index.html?profile=HybridPhone to simulate a phone profile. This will result in a simulation that is easier to preview.
  4. Press F12 to open the browser’s Developer Tools.
  5. Select the device you want to simlate, and your mouse will act like a finger on the screen.

Fantastic! You’ve finished this how-to series and now have a mobile to-do app that works well and looks great.

5 Feedback

We are very interested in your feedback. Please take this short survey to let us know what you think about this how-to.