This project is not covered by Drupal’s security advisory policy.
This module provides generic support for transactional operations linked to content entities. An example of transactional operation is an accounting account, where the content entity acts as the account and each transaction is a movement.
Different transactional flows can be created in addition to accounting, such as tracking/logging systems, workflows, or your own by integration with rules or by programming a transactor.
How it works
The parts involved are:
- a content entity
the target entity to which the transaction flow is linked
- a transaction type
that defines the transactional flow
- the transactor
the plugin that performs the transaction logic
- transactions
content entities where the data of each transaction is stored
Usage
The first basic steps are:
- create a transaction type
at Configuration -> Workflow -> Transaction types -> Add transaction type. Then, choose the target entity type and the involved transactor
- go to any target entity to work with
- create your first transaction
in the transaction tab, label as the transaction type
- execute the transaction to perform the operation
Available transactors
Currently there are two transactors included:
- Balance transactor
maintains an account with debit and credit operations. Useful for accounting, point systems, etc.
- Generic transactor
for basic transaction flows with just tracking information without a specific logic. Useful for integration with rules. Use it as a base to implement your own transactor plugin
Transactor provided by other modules:
- User points
point system for users, provided by the userpoints module
- Workflow transactor
allows to create multipurpose workflows, provided by the transaction workflow module
Features
- works with standard fields
does not require its own field type, so it is very versatile. For example, the balance transactor stores the current balance in a standard decimal number field in the transaction entity, with optional reflection in a decimal number field in the target entity
- works with existing fields
select the fields to work with in the transaction type, or create new ones if needed
- supports transaction operations
define custom operations per transaction type, with tokenized description and detail templates
- computed transaction description and details
the description of the transaction is generated by the transactor, with optional details, which makes it multilingual
- rules integration
react to the transaction execution event
- automatic transaction execution options
on save, ask the user or delayed
To be added:
- #2960955: Scheduled transaction execution
- #2960962: Transaction revert (roll-back)
- #2960963: Transaction expiration
- #2960958: Related transactions
- #2961115: Max, min and step options in balance transactor
Dependencies
Currently, the core entity_reference field type is restricted to one target type. The transaction entity type stores a reference to the target entity, which can be of any type. The module depends on dynamic entity reference to refer the target entity in transactions. This dependency will be removed once the support is in core, see #2407587: Allow multiple target entity types in the entity reference field
Roadmap
On the way of a stable release. It is currently feature freeze and actively working on #3118339: Add tests.
About the transaction namespace
This project replaces an obsolete one developed in 2008 by David Strauss.
Project information
- Module categories: Content Editing Experience
- Ecosystem: Transaction
- 238 sites report using this module
- By manuel.adan on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.