awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
aasm avatar

aasm/aasm

0
View on GitHub↗
5,219 stars·648 forks·Ruby·MIT·9 views

Aasm

This library provides a framework for defining finite state machines within Ruby classes to manage complex object lifecycles. It functions as a declarative workflow engine, allowing developers to model object states, events, and transitions through a readable domain-specific language. By integrating directly with database persistence layers, the framework ensures that state changes are synchronized with storage records while maintaining data integrity through transaction management and row locking.

The library distinguishes itself by enforcing strict business rules through conditional transition guards and preventing direct state modification, ensuring that all lifecycle changes occur exclusively through defined events. It supports multiple independent state machines within a single class by mapping them to distinct database fields, providing isolated lifecycle control. Furthermore, it automatically generates dynamic instance methods for querying states and event triggering, alongside database query scopes that simplify filtering objects based on their current status.

Beyond core lifecycle management, the framework includes utilities for state name localization to support multi-language interfaces and provides hooks for executing custom logic before or after transitions. It also offers specialized testing matchers to verify state machine configurations and transition logic within automated test suites. The project includes tools for compiling source code and configurations into structured documentation to assist with system reference.

Features

  • State Machine Logic - Provides a framework for defining finite state machines within Ruby classes to manage object lifecycles.
  • Business Logic Extensions - Restricts object transitions to predefined paths to ensure business logic compliance throughout the lifecycle.
  • Active Record Mappers - Integrates state machine transitions directly with database records using Active Record patterns to ensure data consistency.
  • Database Integration Layers - Synchronizes state changes with database records using transactions and locking to maintain data integrity.
  • State Modification Restrictions - Prevents direct modification of state storage columns to ensure all lifecycle changes occur exclusively through defined events.
  • Declarative Workflow Engines - Models complex object workflows using a declarative domain-specific language to enforce transition rules.
  • Transition Guards - Enforces business rules by evaluating conditional predicates that must be satisfied before a state transition is permitted.
  • Application State Machines - Allows configuration of states, events, and transitions within a class to control object behavior.
  • State Machine Integrations - Integrates state machine logic with database persistence layers to ensure integrity during transitions.
  • State Transition Mapping - Maps trigger events to source and destination states to define and enforce consistent object lifecycle flows.
  • Conditional Transition Guards - Enforces business rules by evaluating conditional predicates before permitting state transitions.
  • Transactional State Persistence - Ensures data consistency by synchronizing state changes with database records using transactional persistence.
  • Query Scopes - Automatically generates reusable database query constraints for filtering objects based on their current lifecycle state.
  • State Querying - Automatically generates database query scopes for filtering objects based on their current lifecycle status.
  • Domain Specific Languages - Provides a declarative domain-specific language for defining complex state machine rules and transitions.
  • State Transition Lifecycle Hooks - Executes custom callback logic automatically during specific phases of state transitions.
  • State Machine Logic Verifications - Offers specialized testing matchers to verify state machine configurations and transition logic within automated test suites.
  • Multi-Machine Configurations - Supports hosting multiple independent state machines within a single class by mapping them to distinct database fields.
  • State Lifecycle Callbacks - Triggers custom logic automatically before or after state transitions to perform lifecycle side effects.
  • State Transition Validation - Provides utilities to inspect and retrieve valid events available for the current state to determine permissible next steps.
  • Lifecycle State Verifications - Provides dynamic methods to verify current states and check if specific lifecycle events are permitted.
  • Model Enhancements - State machine implementation for Ruby classes.
  • Ruby Frameworks and Tools - State machine library for Ruby.
  • State Machines - State machine implementation for Ruby and Rails.

Star history

Star history chart for aasm/aasmStar history chart for aasm/aasm

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Aasm

Similar open-source projects, ranked by how many features they share with Aasm.
  • dotnet-state-machine/statelessdotnet-state-machine avatar

    dotnet-state-machine/stateless

    6,191View on GitHub↗

    Stateless is a .NET state machine library used to manage complex object behaviors and lightweight workflows through C# code. It functions as an asynchronous workflow engine that executes state transitions, guards, and entry-exit actions using asynchronous tasks. The library implements a hierarchical state machine, allowing child states to inherit transitions and properties from parent superstates. It includes a state persistence framework that decouples state tracking from machine logic by reading and writing the current state to external properties or databases. Additionally, it features a g

    C#
    View on GitHub↗6,191
  • pytransitions/transitionspytransitions avatar

    pytransitions/transitions

    6,548View on GitHub↗

    Transitions is an object-oriented finite state machine library for Python. It provides a framework for managing valid states and the logic for moving between them, including implementations for asynchronous state machines and thread-safe state managers. The library supports hierarchical state machines that allow states to be nested to organize complex subtasks and logical contexts. It includes tools for generating visual diagrams of states and transitions to document machine logic. The project covers state management primitives such as lifecycle callbacks, conditional transition guarding, an

    Python
    View on GitHub↗6,548
  • jakesgordon/javascript-state-machinejakesgordon avatar

    jakesgordon/javascript-state-machine

    8,751View on GitHub↗

    This library is a finite state machine framework for JavaScript designed to manage application states and valid transitions. It provides a system for executing state changes with lifecycle hooks, conditional guards, and transition cancellation. The project is distinguished by its ability to inject state machine logic and transition capabilities directly into existing JavaScript class instances or objects. It also includes a visualization tool that exports state configurations into Graphviz DOT language for auditing system logic. The framework covers asynchronous transition execution and paus

    JavaScript
    View on GitHub↗8,751
  • pluginaweek/state_machinepluginaweek avatar

    pluginaweek/state_machine

    3,722View on GitHub↗

    This project is a Ruby library for defining and managing object lifecycles through states, events, and transition rules. It functions as a declarative workflow engine that enforces business logic by restricting attribute changes to predefined, valid paths within Ruby classes. The library distinguishes itself through deep integration with database persistence layers, allowing it to automatically synchronize state changes with data models, validation frameworks, and transaction management. It supports dynamic configuration, enabling the construction of lifecycle rules at runtime from external d

    Ruby
    View on GitHub↗3,722
See all 30 alternatives to Aasm→

Frequently asked questions

What does aasm/aasm do?

This library provides a framework for defining finite state machines within Ruby classes to manage complex object lifecycles. It functions as a declarative workflow engine, allowing developers to model object states, events, and transitions through a readable domain-specific language. By integrating directly with database persistence layers, the framework ensures that state changes are synchronized with storage records while maintaining data integrity through transaction…

What are the main features of aasm/aasm?

The main features of aasm/aasm are: State Machine Logic, Business Logic Extensions, Active Record Mappers, Database Integration Layers, State Modification Restrictions, Declarative Workflow Engines, Transition Guards, Application State Machines.

What are some open-source alternatives to aasm/aasm?

Open-source alternatives to aasm/aasm include: dotnet-state-machine/stateless — Stateless is a .NET state machine library used to manage complex object behaviors and lightweight workflows through C#… pytransitions/transitions — Transitions is an object-oriented finite state machine library for Python. It provides a framework for managing valid… jakesgordon/javascript-state-machine — This library is a finite state machine framework for JavaScript designed to manage application states and valid… pluginaweek/state_machine — This project is a Ruby library for defining and managing object lifecycles through states, events, and transition… day8/re-frame — re-frame is a functional framework for building single-page applications in ClojureScript. It provides a centralized,… gaarason/database-all — This project is a Java-based object-relational mapping framework that utilizes the active record pattern to simplify…