Hello Gleb, thx for answering and sorry for my late reply.
In the editor screen controller the only custom code is a call to a kieServer processing rules.
public void onBeforeCommitChanges(BeforeCommitChangesEvent event) {
//even without calling dataManager.save(getEditedEntity()); the value for StamGUID is saved.
User user = (User) currentAuthentication.getUser();
getEditedEntity().setStammGUID(user);
dialogs.createOptionDialog()
.withCaption("Bestätigung")
.withMessage("Möchten Sie die Änderungen speichern?")
.withActions(
new DialogAction(DialogAction.Type.YES).withHandler(e -> {
// Speichern der Änderungen, wenn der Benutzer auf "Ja" klickt
// keine Aktion benötigt, da dies die Standardeinstellung ist
try{
boolean bSpeichern = false;
//not included in this snippet is the code which runs the kiesession and updates the editedEntity with getEditedEntity.setParticularPropertyName(retrievedValue)
//if everything runs fine then I force the save. Without calling the save-Method, the property values set within the .withAction part of the code are not saved. But the values for properties bound the screen are saved.
if (bSpeichern){
dataManager.save(getEditedEntity());
}
}
}catch (Exception exception){
System.out.println("Fehler bei onBeforeCommitChanges: " + exception.getMessage());
System.out.println(exception.getStackTrace().toString());
event.preventCommit();
}
}),
new DialogAction(DialogAction.Type.NO).withHandler(e -> {
// verhindern Sie das Speichern der Änderungen, wenn der Benutzer auf "Nein" klickt
event.preventCommit();
})
)
.show();
}
I hope, this compressed code snippet gives you a picture of the structure of my code.
Entity relation is manytoone.
Hope this helps.
thx in advance
Michael