HelperUtils
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
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.