Nuclos BusinessObjectProvider: save, insert, update, delete, deleteLogical, insertAll, Collection, Modifiable, rule. |
Language: Deutsch · English
Create, update and delete BOs from rules – save(), *All methods and logical deletion.
Auf dieser Seite |
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.
Data already shown in forms is loaded into the rule via the context. If the same data is processed in parallel via the BusinessObjectProvider ( |
The static methods |
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 |