Language: Deutsch · English
Create, update and delete BOs from rules – save(), *All methods and logical deletion.
REFERENZ DEVELOPER UPDATED: JUL 2026 APPLIES TO NUCLOS 4.2026.X
On this page
The BusinessObjectProvider class provides functions to create, update and delete business objects from within a rule – including objects that do not belong to the current context.
Caution: parallel editing
Data already shown in forms is loaded into the rule via the context. If the same data is processed in parallel via the BusinessObjectProvider (update), differing edit versions can cause errors.
Modern approach
The static methods insert, update and delete are deprecated. Use the Modifiable interface instead (save()/delete() on the BO).
Instantiate new BOs with new, fill them and store with save(). Assign references (e.g. article, warehouse) via their id – e.g. through the QueryProvider.
public class Bestellunganlegen implements InsertRule {
public void insert(InsertContext context) throws BusinessException {
Anfrageposition newPos = new Anfrageposition();
Artikel myArticel = QueryProvider.getById(Artikel.class, 40465351L);
Lager myLager = QueryProvider.getById(Lager.class, 40276065L);
newPos.setPositionsnr(0);
newPos.setArtikelId(myArticel.getId());
newPos.setAnzahl(2.0d);
newPos.setLagerId(myLager.getId());
newPos.save();
}
}
Process a Collection sequentially and pass each entry to the respective single method.
public static <T extends BusinessObject> void insertAll(Collection<T> type) throws BusinessException;
Delete entries logically (only for BOs implementing LogicalDeletable). Existing links can prevent deletion and abort rule processing.
QueryProviders