| Auszug |
|---|
|
Nuclos BusinessObjectProvider: save, insert, update, delete, deleteLogical, insertAll, Collection, Modifiable, rule. |
Language: Deutsch · English
BusinessObjectProvider
Create, update and delete BOs from rules – save(), *All methods and logical deletion.
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
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 |
|---|
| title | 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. |
| Hinweis |
|---|
|
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 |
|---|
|
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 |
|---|
|
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.
Related pages
QueryProvider
Daten laden.
Open →
DatasourceProvider
run data sources.
Open →
GenerationProvider
Arbeitsschritte.
Open →