Interface OnSaveAction

All Superinterfaces:
Action
All Known Implementing Classes:
AbstractOnSaveAction, DebugOnSaveActionFactory.DebugOnSaveAction

public interface OnSaveAction
extends Action
Action that is called when an item is saved in gui. Actions are called after all regular properties have been updated. It is recommended that implemting classes extend the AbstractOnSaveAction class since we may add more callback methods to this interface in the future.

The onSave() method is called first and then either onCommit() or onRollback(Exception). Note that onRollback is called for all exceptions, even if they happen before the onSave method has been called.

Since:
2.17
Author:
Nicklas
Last modified
$Date: 2010-11-15 13:53:05 +0100 (må, 15 nov 2010) $
  • Method Summary

    Modifier and Type Method Description
    void onCommit()
    This event is fired after a successful commit.
    void onRollback​(Exception ex)
    This event is fired after an error that caused the save action to rollback.
    void onSave()
    This event is fired first to let the action do something with the current item.
  • Method Details

    • onSave

      void onSave()
      This event is fired first to let the action do something with the current item. Implementors may throw an exception from this method to indicate that something went wrong. If so, any remaining extensions will be unprocessed and the onRollback(Exception) is called.
    • onCommit

      void onCommit()
      This event is fired after a successful commit. Implementors should not throw any exceptions from this method since it may confuse users to see error messages and may cause other extensions to not be called.
    • onRollback

      void onRollback​(Exception ex)
      This event is fired after an error that caused the save action to rollback. Implementors should not throw any exceptions from this method since it may hide original exception and may cause other extensions to not be called.
      Parameters:
      ex - The exception that caused the transaction to rollback