Skip to content

Conversation

@mahesh-lalwani-work
Copy link

Description

This PR adds comprehensive support for custom MaskedTextBox form fields in KIE Server REST API responses, enabling full feature parity with Business Central UI.

New Functionality Added

1. JSON API Support for MaskedTextBox Fields

  • MaskedTextBox fields now appear in JSON responses from KIE Server REST API endpoints
  • Full property support including minLength, maxLength, maskingCharacter, maskingStartIndex, maskingFromStartLength, maskingFromEndLength, isMaskedInDB

2. HTML API Support for MaskedTextBox Fields

  • MaskedTextBox fields render correctly in HTML responses from KIE Server REST API endpoints
  • Interactive masking behavior matching Business Central UI functionality
  • Proper HTML attributes and client-side JavaScript for masking operations

3. Complete Property Support

  • All MaskedTextBox properties are now supported in KIE Server responses
  • Proper data flow from form definitions to both JSON and HTML outputs
  • Consistent behavior between Business Central UI and KIE Server APIs

Technical Implementation

Backend Enhancements

  • FormField.java: Extended with MaskedTextBox-specific properties
  • LayoutItem.java: Added MaskedTextBox property support for HTML rendering
  • AbstractFormRenderer.java:
    • Added MaskedTextBox field type mapping
    • Implemented property extraction and assignment logic
  • Service Provider: Configured proper field provider discovery

Frontend Enhancements

  • input-form-group-template.html: Specialized MaskedTextBox rendering with HTML attributes
  • masked-textbox.js: Client-side masking implementation with focus/blur/input event handling
  • main-template.html: Script integration for masking functionality

Benefits

  • Complete feature parity between Business Central UI and KIE Server APIs
  • Consistent MaskedTextBox behavior across all jBPM interfaces
  • Enhanced data privacy protection in REST API responses
  • Improved developer experience with unified form field support
How to backport a pull request to a different branch?

In order to automatically create a backporting pull request please add one or more labels having the following format backport-<branch-name>, where <branch-name> is the name of the branch where the pull request must be backported to (e.g., backport-7.74.1.Final to backport the original PR to the 7.74.1.Final branch).

NOTE: backporting is an action aiming to move a change (usually a commit) from a branch (usually the main one) to another one, which is generally referring to a still maintained release branch. Keeping it simple: it is about to move a specific change or a set of them from one branch to another.

Once the original pull request is successfully merged, the automated action will create one backporting pull request per each label (with the previous format) that has been added.

If something goes wrong, the author will be notified and at this point a manual backporting is needed.

NOTE: this automated backporting is triggered whenever a pull request on main branch is labeled or closed, but both conditions must be satisfied to get the new PR created.

- Implement MaskedTextBox field type with configurable input masking
- Add 6 custom properties: minLength, maskingCharacter, maskingStartIndex,
  maskingFromStartLength, maskingFromEndLength, isMaskedInDB
- Support client-side masking with configurable characters (*, #, @, $, %, &, !, ?, alphanumeric)
- Implement flexible masking positioning (start index, length from start/end)
- Add comprehensive validation rules and error handling
- Include complete i18n support with proper field labels
- Add side-by-side layout for masking indices

This provides a reusable masked input field component for jBPM forms.
…ities

* Add new MaskedTextBox field definition extending AbstractMaskedTextBoxFieldDefinition
  - Support for start index masking with configurable length
  - Support for end masking with configurable length
  - Support for database-level masking with isMaskedInDB flag
  - Configurable masking character (default: *)
  - Min/max length validation support

* Implement MaskedTextBoxFieldProvider with String type support
  - Set priority to 5 to avoid TreeSet collision with TextBoxFieldProvider
  - Register with BackendFieldManagerImpl and ClientFieldManagerImpl
  - Enable automatic CDI discovery

* Add MaskedTextBox to form editor field type providers
  - Include in EditorFieldTypesProviderImpl for palette and properties
  - Support field type dropdown functionality in form modeler

* Implement comprehensive test coverage
  - MaskedTextBoxFieldDefinitionTest: 6 tests for field properties, equals/hashCode, serialization
  - Fix equals/hashCode implementation with proper ID and name handling
  - All tests passing with 100% success rate

Resolves: MaskedTextBox field type implementation for Business Central forms
- Add MaskedTextBoxFieldDefinition with masking properties (maskingCharacter, maskingStartIndex, maskingFromStartLength, maskingFromEndLength, isMaskedInDB)
- Implement MaskedTextBoxFieldProvider for field registration and management
- Add MaskedTextBoxFieldType with proper @portable annotation for serialization
- Create service provider file for FieldProvider discovery
- Ensure proper CDI bean registration in BackendFieldManagerImpl
- Support minLength validation and placeholder functionality
- Enable MaskedTextBox fields to appear in Form Controls Palette and work in Business Central UI

This enables data privacy protection through configurable text masking in jBPM forms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant