| Auszug |
|---|
|
Nuclos generic implementation: generic business objects (GBO), mapping, generic rules, wrapper class, getGenericBusinessObject. |
Language: Deutsch · English
Generic implementation
One rule for many business objects: abstract commonalities in generic business objects instead of instanceof chains.
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
Why a generic implementation?
The generic implementation enables rules that apply to several business objects alike – e.g. sequential numbers or net/gross totals for quote, order, delivery note and invoice. Instead of instanceof chains you abstract commonalities in a generic business object (GBO).
| Hinweis |
|---|
|
Previously each type had to be checked individually in a rule: | Codeblock |
|---|
| final Modifiable<?> bo = context.getBusinessObject(Modifiable.class);
if (bo instanceof Geschaeftspartner) { ... }
else if (bo instanceof Angebot) { ... }
else if (bo instanceof Auftrag) { ... } |
|
Menu: Configuration → Rule sets → Generic implementation
Configuration
A BO marked as generic (checkbox in the BO wizard) is required. Then the mapping is maintained:
- Generic business object – the BO defined as GBO.
- Implementing business object – the concrete BO.
- Attributes – mapping GBO ↔ BO. Mandatory GBO attributes must be mapped (the BO attribute itself need not be mandatory).

Mapping of the generic implementation.
Terms
| Term | Meaning |
|---|
| GenericBusinessobject (GBO) | abstracts commonalities of several BOs |
| Wrapper class | generated class mapping GBO attributes to a BO |
| Implementing BO | concrete BO mapped to a GBO |
| Generic rule | rule that works with GBOs |
Aspects
- A GBO can be mapped to any number of BOs and vice versa; mappings belong to the same Nuclet.
- Access in the rule context via
getGenericBusinessObject(GBOClass); GBOs may have reference fields to other GBOs. - GBOs are only supported by parts of the API (no QueryProvider/StatemodelProvider).
- Generic rules are attached manually to an implementing BO; if the context BO type does not match, a runtime error occurs.
Related pages
Server-side rules
Server rules.
Open →
Business object
Mark as GBO.
Open →