Abstract Private _pendingPrivate _preprocessingPrivate _statusPrivate _variablesPrivate transactionOptional error?: anyOptional results?: TransactionResult[]Protected PendingThe array of variables that are to be used within the transaction group. These are used to pass data from one transaction item to another. See documentation on TransactionVariable
This is used by the BaseEntity/Provider objects to manage transactions on your behalf. WARNING: Do NOT directly call this method. Instead set the TransactionGroup property on the
class to make an entity object part of a transaction group.
Adds a new variable to the transaction group.
Protected Abstract HandleSubclasses of the TransactionGroupBase class must implement this method to handle the actual transaction submission which is provider-specific.
Protected MapHelper method for sub-classes to map a variable to a position in the pending transactions array
Private NotifyNotifies observers about transaction success or failure
Whether the transaction was successful
Optional results: TransactionResult[]The transaction results (if applicable)
Optional error: anyAny error that occurred (if applicable)
If an entity object needs to conduct any type of asynchronous preprocessing before a transaction is submitted, it must notify its transaction group that it is doing so with this method. This causes the TransactionGroup to wait for all preprocessing to be completed before submitting the transaction. This method checks to see if an the entity has already been registered for preprocessing and if so, does nothing.
Protected SetThis utility method is to be used by sub-classes to set the values of the variables on the BaseEntity objects before the transaction is executed for variables that are defined as 'Use' type. This is used to pass values from one transaction item to another.
the number of values set on the entity object
Protected SetThis utility method is to be used by sub-classes to set the values of the variables on the BaseEntity objects after the transaction is executed for variables
the number of variables that had their processed values set from the provided entity object
Submits the transaction group to the provider for handling. The provider will handle the actual transaction and call the callback functions
If true, the transaction group will be resubmitted even if it has failed. If false, the transaction group will not be resubmitted if it has failed.
true if the transaction was successful, false if it failed. If the method fails, check each of the individual BaseEntity objects within the TransactionGroup for their result histories using BaseEntity.ResultHistory and BaseEntity.LatestResult
Protected wait
TransactionGroup is a class that handles the bundling of multiple transactions into a single request. The provider handles the implementation details. If a transaction group is provided to the baseEntity object before either Save() or Delete() is called instead of just immediately executing its SQL or GQL, it provides the instructions to the TransactionGroup object instead.
Then, whenever the TransactionGroup object instance has its Submit() method called, all of the requests will be bundled into a single request and handled. For example in the case of the GraphQLDataProvider, we queue up all of the GQL statements for all of the mutations and send them across as a single GraphQL request. The GraphQL server handles the actual DB transaction stuff.
TransactionGroup will call a callback function, if provided, after the transaction has either completed succesfully or failed. If it is succesful, for Save() method calls, the latest data for that record will be provided back. For Delete() method calls, the callback will be called with no data.
This class is the base class for managing a group of transactions and submitting it to the provider so it can be handled as an ATOMic transaction