Transaction class

A Transaction holds a list of ChangedEvents collected during a transaction, as the value of the read-only #changes property.

Start a transaction by calling UndoManager#startTransaction (or Model#startTransaction or Diagram#startTransaction, which call that method). Be sure to finish a transaction with a matching call to UndoManager#commitTransaction (or Model#commitTransaction or Diagram#commitTransaction), or a call to UndoManager#rollbackTransaction (or the same named methods on Model or Diagram).

If you are performing multiple or repeated changes to a model or diagram, surround all of the code with calls to start and commit the transaction -- do not perform repeated calls to start-commit-start-commit. Typically each change caused by the user, such as a button click or a change of focus or a mouse drag, should perform one transaction in which all changes are made. All of the predefined commands and tools perform transactions.

Undoing or redoing a transaction is done by calling UndoManager#undo or UndoManager#redo. Those methods call the #undo or #redo methods here.

The UndoManager holds a list of Transactions in its UndoManager#history.

Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

Transaction()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited