Mendix AI Assist — Your friendly Peer Programmers

QUANG NHAT TRAN
Mendix Community
Published in
5 min readDec 8, 2021

--

Learning any new technology is always challenging. Wouldn’t it be great if you could learn with the proper guidance of an AI trained to help? Peer programming with a bot can be more fun and reduce some of the hurdles and stress along the learning path. Join me as I share my journey in this blog (using Mendix 9.8.1).

Mendix provides us with two co-developer bots, which are MxAssist Logic Bot and MxAssist Performance Bot.

MxAssist Logic Bot focuses on microflows and is not yet available for nanoflows. MxAssist Performance Bot focuses on the whole application to check anti-patterns to help makers avoid critical issues in production. Let’s dive into this with a simple workflow example.

MxAssist Logic Bot and MxAssist Performance Bot

Error in a loop with a commit object change.

The maker is able to disable the logic bot whenever they want. When it is off, the logic bot indicator (the blue circle) will not appear on the microflow line.

When it is set to on, you can mouse over the blue circle, and the bot will give you several recommendations, about what to do next.

As you add more activities in the flow, it will continue to analyze and give us a new list of recommendations.

From this point, you could decide to retrieve another object over an association.

After retrieving a list of an object via association, the bot may suggest a loop action.

Using this example, I tried to commit inside a loop (A commonly known bad practice). With a new loop, I try to commit the object change of the IteratorEntity1.

Next, I ran the performance bot Inspection. In this scenario after running the inspection, the bot identified this and made a recommendation.

You should know that having an error in your project, will prevent you from running the inspection, so try to fix all the errors attempting this.

Double click on the recommendation in the list, it will jump you to the microflow in question. There will be a blue circle above the action with the recommendation, you can click on it to see more details.

MxAssist Performance Bot

Index missing

It's good to have a friend to tell you where the weak point of your app is, a great example of this is the data grid performance without an index.

Not to worry, Performance Bot will help you. In this scenario, I have a Datagrid that will use an attribute in a sort bar. Performance bot not only recommends but also does it for us by giving us the option to easily “Add index”

MxAssist Performance Bot

Convert to nanoflow when entities are non-persistable.

When you have a domain model with non-persistable entities. It may be better to use nanoflow to change the way of calling a page.

For example, I call a page via microflow from the navigation menu.

Using this Microflow

With a Non-persistent entity

Performance Bot will detect this and recommends changing the microflow to a nanoflow.

Final Thoughts

Overall I found the bots to be incredibly useful. As I am an experienced Mendix developer, I would not rely on the logic bot too often as I normally know what I want to do in a Microflow— but I see how it would be a great tool to help someone new to the platform learn. The performance bot is a great tool to review the performance of your app, often we forget about things like indexing which can massively impact performance when dealing with large lists of data, and it's a great catch-all to make sure an oversight doesn't end up in rework down the road.

Read More

From the Publisher -

If you enjoyed this article you can find more like it on our Medium page. For great videos and live sessions, you can go to MxLive or our community Youtube page.

For the makers looking to get started, you can sign up for a free account, and get instant access to learning with our Academy.

Interested in getting more involved with our community? You can join us in our Slack community channel or for those who want to be more involved, look into joining one of our Meetups.

--

--

QUANG NHAT TRAN
Mendix Community

Certified Mendix Expert MVP, Data Scientist, and Technical Practitioner @ TBN Software