Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Auszug
hiddentrue

Nuclos BusinessObjectProvider: save, insert, update, delete, deleteLogical, insertAll, Collection, Modifiable, rule.

globe with meridians Language: Deutsch · English

open book BusinessObjectProvider

Create, update and delete BOs from rules – save(), *All methods and logical deletion.

Status
colourGrey
titleReferenz
Status
colourBlue
titleDeveloper
Status
colourGreen
titleUpdated: Jul 2026
Status
colourGrey
titleapplies to Nuclos 4.2026.x

Panel
bgColor#F4F5F7

On this page

Inhalt
maxLevel2
minLevel2

What is the BusinessObjectProvider for?

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.

Warnung
titleCaution: 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.

Hinweis
titleModern approach

The static methods insert, update and delete are deprecated. Use the Modifiable interface instead (save()/delete() on the BO).

save() – create & update

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.

Codeblock
languagejava
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();
    }
}

insertAll / updateAll / deleteAll

Process a Collection sequentially and pass each entry to the respective single method.

Codeblock
languagejava
public static <T extends BusinessObject> void insertAll(Collection<T> type) throws BusinessException;

deleteLogical / deleteLogicalAll

Delete entries logically (only for BOs implementing LogicalDeletable). Existing links can prevent deletion and abort rule processing.

Codeblock
languagejava
QueryProviders

Related pages

gear QueryProvider


Daten laden.

Open →

gear DatasourceProvider


run data sources.

Open →

gear GenerationProvider


Arbeitsschritte.

Open →