TxnManager Class

Beta

Local Txns in an IModelDb. Local Txns persist only until IModelDb.pushChanges is called.

Methods

Name Description
constructor(_iModel: IModelDb): TxnManager    
beginMultiTxnOperation(): DbResult Begin a new multi-Txn operation.  
cancelTo(txnId: TxnIdString): IModelStatus Reverse and then cancel (make non-reinstatable) all changes back to a previous TxnId.  
describeChangeSet(endTxnId?: TxnIdString): string Make a description of the changeset by combining all local txn comments.  
endMultiTxnOperation(): DbResult End a multi-Txn operation  
getCurrentTxnId(): TxnIdString Get the Id of the current (tip) transaction.  
getMultiTxnOperationDepth(): number Return the depth of the multi-Txn stack.  
getRedoString(): string Get a description of the operation that would be reinstated by calling reinstateTxn.  
getTxnDescription(txnId: TxnIdString): string Get the description that was supplied when the specified transaction was saved.  
getUndoString(): string Get the description of the operation that would be reversed by calling reverseTxns(1).  
isTxnIdValid(txnId: TxnIdString): boolean Test if a TxnId is valid  
queryFirstTxnId(): TxnIdString Get the Id of the first transaction, if any.  
queryNextTxnId(txnId: TxnIdString): TxnIdString Get the successor of the specified TxnId  
queryPreviousTxnId(txnId: TxnIdString): TxnIdString Get the predecessor of the specified TxnId  
reinstateTxn(): IModelStatus Reinstate the most recently reversed transaction.  
reportError(error: ValidationError): void Dependency handlers may call method this to report a validation error.  
reverseAll(): IModelStatus Reverse all changes back to the beginning of the session.  
reverseSingleTxn(): IModelStatus Reverse the most recent operation.  
reverseTo(txnId: TxnIdString): IModelStatus Reverse all changes back to a previously saved TxnId.  
reverseTxns(numOperations: number): IModelStatus Reverse (undo) the most recent operation(s) to this IModelDb.  

Properties

Name Type Description
hasFatalError Accessor ReadOnly boolean Determine whether any fatal validation errors have occurred during dependency propagation.  
hasLocalChanges Accessor ReadOnly boolean Query if there are un-saved or un-pushed local changes.  
hasPendingTxns Accessor ReadOnly boolean Query if there are any pending Txns in this IModelDb that are waiting to be pushed.  
hasUnsavedChanges Accessor ReadOnly boolean Query if there are any changes in memory that have yet to be saved to the IModelDb.  
isRedoPossible Accessor ReadOnly boolean Determine if there are currently any reinstatable (redoable) changes to this IModelDb  
isUndoPossible Accessor ReadOnly boolean Determine if there are currently any reversible (undoable) changes to this IModelDb.  
onAfterUndoRedo BeEvent<(_action: TxnAction) => void> Event raised after an undo/redo operation has been performed.  
onBeforeUndoRedo BeEvent<() => void> Event raised before an undo/redo operation is performed.  
onChangesApplied BeEvent<() => void> Event raised after a ChangeSet has been applied to this briefcase  
onCommit BeEvent<() => void> Event raised before a commit operation is performed.  
onCommitted BeEvent<() => void> Event raised after a commit operation has been performed.  
validationErrors ValidationError[] Array of errors from dependency propagation  

Defined in

Last Updated: 13 May, 2019