HelperUtils

Content Type: Module
Categories: Utility

Overview

Here you can find various Java codes that will handle different repetitive utilities in Mendix that currently do not exist.

Documentation

Description

Helper Utils is a multifunctional module for Mendix designed to provide a set of

reusable Java actions for common development tasks. It includes utilities for list

operations, enum conversions, string and regex handling, dynamic attribute access,

and entity inheritance filtering.

 

Typical usage scenario

This module is useful for developers who need to perform common tasks in Mendix in an

efficient and effective way. Typical scenarios include:

 

* Converting between Enums and Lists.

* Retrieving objects from lists by index or size, slicing, reversing, sorting or

deduplicating lists by any attribute.

* Splitting strings using regular expressions, extracting matches, validating

formats, counting occurrences, truncating and masking strings.

* Joining an attribute of a list of objects into a single string, and building

object lists from comma-separated strings.

* Reading and writing attributes by name at runtime (generic imports, configurable

mappings, audit).

* Filtering object lists by sub-meta types in inheritance structures and checking

whether an object belongs to a specific sub-meta type.

 

Features and limitations

Features

 

* Conversion from Enum to List and vice versa.

* List utilities: size, get by index, slice by index range, reverse, distinct by

attribute, sort by a runtime attribute name (case-insensitive, empty values last),

and join an attribute into a single string (JoinListAttribute, inverse of

ListBuilderString).

* Regex utilities: split by pattern (SplitByRegex), extract the first or all

matches (RegexExtract / RegexExtractAll), full-string validation (RegexIsMatch)

and counting occurrences (CountOccurrences).

* String utilities: truncate to a hard maximum length with optional suffix

(StringTruncate) and mask sensitive values such as IBANs, phones or emails

keeping first/last N characters visible (MaskString).

* Dynamic object access: get the concrete meta object name (GetMetaObjectName) and

read/write attributes by name at runtime with automatic type conversion —

String, Enum, Integer, Long, Boolean, Decimal, DateTime

(GetAttributeValueAsString / SetAttributeValue).

* Filter List By Meta Object – filters a mixed object list (base entity +

specializations) by the specified meta type.

* IsSubMetaObject? – checks if an object's concrete meta type matches the

specified sub-meta type.

 

Limitations

 

* Limited handling of custom or complex data types.

* SetAttributeValue does not support AutoNumber or Binary attributes and does not

commit the object (commit explicitly if needed).

* Filtering actions only make sense when the base entity has specializations;

without them, sub-meta checks will always resolve to the base type.

 

Dependencies [optional]

 

* Mendix 10.24.0

 

Installation [optional]

Installation from the Marketplace

 

Configuration [optional]

There are no additional steps for the configuration of this module.

 

Known bugs [optional]

To date, there are no known bugs.

 

Releases

Version: 1.2.0
Framework Version: 10.24.0
Release Notes:

14 new Java actions:

 

List operations

- ListSlice: sublist by index range, with safe bounds handling

- ListReverse: returns the list in reverse order

- ListDistinctByAttribute: removes duplicates by attribute value

- ListSortByAttribute: sorts by an attribute name resolved at runtime (case-insensitive, empty values last)

- JoinListAttribute: joins an attribute of each object into a single string (inverse of ListBuilderString)

 

Regex & strings

- RegexExtract / RegexExtractAll: return the first or all fragments matching a pattern (complement of SplitByRegex)

- RegexIsMatch: full-string pattern validation

- CountOccurrences: counts pattern matches in a string

- StringTruncate: cuts a string to a hard maximum length with optional suffix

- MaskString: masks a string keeping first/last N characters visible (IBANs, phones, emails)

 

Dynamic object access

- GetMetaObjectName: returns the concrete meta object name of an object (complements IsSubMetaObject)

- GetAttributeValueAsString / SetAttributeValue: read and write attributes by name at runtime, with automatic type conversion (String, Enum, Integer, Long, Boolean, Decimal, DateTime)

 

All actions include documentation with inputs, behavior and examples. No breaking changes to existing actions.

Version: 1.1.0
Framework Version: 10.0.0
Release Notes: New Features Filter List By Meta Object Java action that filters a mixed list of objects (base entity + specializations) by the specified meta object type. Inputs: ObjectList (List of objects) IncludeSubMeta (String) – meta object type to include ExcludeSubMeta (String, optional) – meta object type to exclude Output: filtered list containing only the objects of the included sub-meta type. Use case: Retrieve only Module.Project objects or only Module.BS_Project objects from a general Project list. IsSubMetaObject? Java action that checks if an object’s concrete meta type matches the provided SubMetaName. Inputs: ObjectInspect (Object) – the object to check SubMetaName (String) – meta object name to compare against Output: true if the object’s meta name equals the provided string; otherwise false. Use case: Distinguish between Module.Project and Module.BS_Project objects even when both come from the base entity list. Why these actions? Mendix automatically includes child objects when retrieving a generalized entity (e.g., Project retrieves both Project and BS_Project). These actions solve the limitation by enabling: Exact filtering of object lists by sub-meta type. Exact meta-name checks on individual objects. This makes it easier to work with inheritance-heavy domain models without cluttered microflows or performance-heavy workarounds.
Version: 1.0.0
Framework Version: 10.0.0
Release Notes: - Enum to list. - String to enum. - Get list size. - Get object from list by index - List builder string - Split by regex