Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ If applicable, add screenshots to help explain your problem.

**Environment**

- FlexiRule version:
- Frappe/ERPNext version:
- Browser (if UI related):
- FlexiRule version:
- Frappe/ERPNext version:
- Browser (if UI related):

**Additional context**
Add any other context about the problem here.
18 changes: 9 additions & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ Fixes #(issue)

## Type of Change

- [ ] Bug fix
- [ ] New feature
- [ ] Refactor
- [ ] Documentation update
- [ ] Bug fix
- [ ] New feature
- [ ] Refactor
- [ ] Documentation update

## Checklist

- [ ] My code follows the project’s coding standards
- [ ] I have added tests that prove my fix is effective or my feature works
- [ ] I have added necessary documentation
- [ ] All new and existing tests pass
- [ ] I have updated the README if needed
- [ ] My code follows the project’s coding standards
- [ ] I have added tests that prove my fix is effective or my feature works
- [ ] I have added necessary documentation
- [ ] All new and existing tests pass
- [ ] I have updated the README if needed

## Additional Notes

Expand Down
18 changes: 9 additions & 9 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ We pledge to act and interact in ways that contribute to an open, welcoming, div

Examples of behavior that contributes to a positive environment:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior:

- Harassment, intimidation, or discriminatory jokes and language
- Personal attacks or insults
- Publishing others’ private information without consent
- Any behavior that could reasonably be considered inappropriate in a professional setting
- Harassment, intimidation, or discriminatory jokes and language
- Personal attacks or insults
- Publishing others’ private information without consent
- Any behavior that could reasonably be considered inappropriate in a professional setting

## Enforcement

Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Thank you for your interest in contributing!

## How to contribute

- Open an issue for bugs, enhancements, or questions.
- Submit pull requests (PRs) for fixes or new features.
- Follow existing coding standards and folder structure.
- Add clear descriptions to your PRs.
- Open an issue for bugs, enhancements, or questions.
- Submit pull requests (PRs) for fixes or new features.
- Follow existing coding standards and folder structure.
- Add clear descriptions to your PRs.

## Development setup

Expand All @@ -17,10 +17,10 @@ Thank you for your interest in contributing!

## What we welcome

- Improvements to the rule engine.
- Process expansions.
- UI/UX improvements for the Rule Builder.
- Documentation and test cases.
- Improvements to the rule engine.
- Process expansions.
- UI/UX improvements for the Rule Builder.
- Documentation and test cases.

## Communication

Expand Down
118 changes: 59 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ In modern enterprise systems like **Frappe / ERPNext**, business logic often evo

### 💎 Why FlexiRule?

- **Centralized Logic**: Move rules out of scattered `.py` files into a single, auditable dashboard.
- **No-Code Configuration**: Custom UI controls (pickers, autocomplete) allow complex logic setup without a single line of code.
- **Explicit Execution**: Connections define deterministic paths. No more guessing which hook runs first.
- **Schema-Driven UI**: Configuration forms for custom logic are auto-generated from JSON schemas.
- **Centralized Logic**: Move rules out of scattered `.py` files into a single, auditable dashboard.
- **No-Code Configuration**: Custom UI controls (pickers, autocomplete) allow complex logic setup without a single line of code.
- **Explicit Execution**: Connections define deterministic paths. No more guessing which hook runs first.
- **Schema-Driven UI**: Configuration forms for custom logic are auto-generated from JSON schemas.

---

Expand Down Expand Up @@ -79,9 +79,9 @@ FlexiRule is built around three core pillars that bridge the gap between design

A **Rule** defines _when_ logic should trigger. It serves as the gateway to the graph and binds to one of three context sources:

- **DocType Event**: Tied to database hooks (e.g., `Before Save`, `On Submit`).
- **Scheduler Event**: Scheduled CRON-based executions via background jobs.
- **Callable Event**: A sub-rule meant strictly to be executed by other parent rules via `Priority: 0`.
- **DocType Event**: Tied to database hooks (e.g., `Before Save`, `On Submit`).
- **Scheduler Event**: Scheduled CRON-based executions via background jobs.
- **Callable Event**: A sub-rule meant strictly to be executed by other parent rules via `Priority: 0`.

### 2. The Rule Action (The Node)

Expand All @@ -91,8 +91,8 @@ Each node in the graph is a **Rule Action**. It represents a specific step in yo

A **Process** is a file-backed module (similar to Frappe Reports/Dashboards) that acts as a container for reusable logic.

- **File-Backed**: Logic is stored in code (`.py`) for performance and version control.
- **Operations**: Individual functions within a process that declare their own **JSON Schema** for configuration parameters.
- **File-Backed**: Logic is stored in code (`.py`) for performance and version control.
- **Operations**: Individual functions within a process that declare their own **JSON Schema** for configuration parameters.

---

Expand Down Expand Up @@ -125,24 +125,24 @@ graph LR

## 🛠️ Key Features

- **Vue 3 Visual Builder**: Smooth graph-editing via a VueFlow canvas rendered dynamically from Frappe backend schemas.
- **Condition Compilation**: Visual engine builds JSON `trigger_conditions` that are transparently pre-compiled into ultra-fast, single-pass pure Python strings `compiled_expression` on Save to avoid runtime overhead.
- **Node Execution State Management**: Real-time tracking of execution state across components for visualization and debugging.
- **Compiled Runtime Registry**: Layered caching system (request-local → Redis → DB) for compiled rules and dependencies.
- **Role-Based Execution Control**: `skip_for_roles` field to prevent rule execution for specific roles.
- **Permission Audit Logging**: `skip_permissions` with audit reason for tracking bypassed permission checks.
- **Watched Fields Optimization**: Automatic extraction and change-based filtering for event-driven rules.
- **Comprehensive Error Handling**:
- Retry with exponential backoff
- Rollback with savepoints
- Escalate to caller
- Continue or Stop (default)
- **Async Execution via Background Queues**: Offload long-running rules to background jobs.
- **Timeout Protection**: Per-rule and per-action timeout limits.
- **Asynchronous Execution Log Enqueuing**: Non-blocking persistence of execution traces.
- **Graph Validation with Cycle Detection**: Prevents infinite loops with visit counting and iteration limits.
- **Deterministic Graph Execution**: Zero ambiguity in execution order via Registry strategy pattern.
- **Safety First**: Sandboxed execution via `SafeFrappeAPI`, savepoint rollbacks, and input validation.
- **Vue 3 Visual Builder**: Smooth graph-editing via a VueFlow canvas rendered dynamically from Frappe backend schemas.
- **Condition Compilation**: Visual engine builds JSON `trigger_conditions` that are transparently pre-compiled into ultra-fast, single-pass pure Python strings `compiled_expression` on Save to avoid runtime overhead.
- **Node Execution State Management**: Real-time tracking of execution state across components for visualization and debugging.
- **Compiled Runtime Registry**: Layered caching system (request-local → Redis → DB) for compiled rules and dependencies.
- **Role-Based Execution Control**: `skip_for_roles` field to prevent rule execution for specific roles.
- **Permission Audit Logging**: `skip_permissions` with audit reason for tracking bypassed permission checks.
- **Watched Fields Optimization**: Automatic extraction and change-based filtering for event-driven rules.
- **Comprehensive Error Handling**:
- Retry with exponential backoff
- Rollback with savepoints
- Escalate to caller
- Continue or Stop (default)
- **Async Execution via Background Queues**: Offload long-running rules to background jobs.
- **Timeout Protection**: Per-rule and per-action timeout limits.
- **Asynchronous Execution Log Enqueuing**: Non-blocking persistence of execution traces.
- **Graph Validation with Cycle Detection**: Prevents infinite loops with visit counting and iteration limits.
- **Deterministic Graph Execution**: Zero ambiguity in execution order via Registry strategy pattern.
- **Safety First**: Sandboxed execution via `SafeFrappeAPI`, savepoint rollbacks, and input validation.

---

Expand Down Expand Up @@ -176,16 +176,16 @@ Developers can extend FlexiRule by creating **Standard Processes**:

FlexiRule provides a comprehensive set of whitelisted backend methods for programmatic interaction:

- **`test_rule`** - Test rule execution with `dry_run` and `save_log` options
- **`simulate_rule`** - Dry-run simulation without persisting logs
- **`execute_rule`** - Manual/API execution of a rule
- **`transition_rule`** - Lifecycle management (enable/disable rules)
- **`get_execution_preview`** - Path prediction for rule execution
- **`get_contract_dto`** - Frontend introspection of rule contracts
- **`get_node_config_schema`** - Dynamic configuration schema generation
- **`get_action_context_schema`** - Variable resolution context inspection
- **`clone_rule`** / **`amend_rule`** - Rule versioning operations
- **`get_rule_stats`** - Monitoring and performance metrics
- **`test_rule`** - Test rule execution with `dry_run` and `save_log` options
- **`simulate_rule`** - Dry-run simulation without persisting logs
- **`execute_rule`** - Manual/API execution of a rule
- **`transition_rule`** - Lifecycle management (enable/disable rules)
- **`get_execution_preview`** - Path prediction for rule execution
- **`get_contract_dto`** - Frontend introspection of rule contracts
- **`get_node_config_schema`** - Dynamic configuration schema generation
- **`get_action_context_schema`** - Variable resolution context inspection
- **`clone_rule`** / **`amend_rule`** - Rule versioning operations
- **`get_rule_stats`** - Monitoring and performance metrics

All APIs are accessible via `frappe.call()` and follow standard Frappe whitelisted method conventions.

Expand All @@ -197,33 +197,33 @@ The FlexiRule codebase has undergone significant architectural improvements:

### Core Engine Enhancements

- **Assignment Action (V2)**: Replaced legacy "Set Value" with a powerful batch assignment system supporting multiple operators (Set, Clear, Increment, Decrement, Append, Merge, Toggle).
- **Condition System (V2)**: Introduced recursive collection logic (Any, All, None) and iterator aliases for complex child-table evaluations.
- **Node Execution State Management**: Real-time tracking of execution state across components for visualization and debugging.
- **Compiled Runtime Registry**: Layered caching system (request-local → Redis → DB) for compiled rules and dependencies.
- **Graph Validation Improvements**: Enhanced cycle detection with visit counting and iteration limits.
- **Async Execution Refinements**: Better background job handling and timeout protection.
- **Assignment Action (V2)**: Replaced legacy "Set Value" with a powerful batch assignment system supporting multiple operators (Set, Clear, Increment, Decrement, Append, Merge, Toggle).
- **Condition System (V2)**: Introduced recursive collection logic (Any, All, None) and iterator aliases for complex child-table evaluations.
- **Node Execution State Management**: Real-time tracking of execution state across components for visualization and debugging.
- **Compiled Runtime Registry**: Layered caching system (request-local → Redis → DB) for compiled rules and dependencies.
- **Graph Validation Improvements**: Enhanced cycle detection with visit counting and iteration limits.
- **Async Execution Refinements**: Better background job handling and timeout protection.

### Security & Reliability

- **Permission Audit Logging**: `skip_permissions` with audit reason for tracking bypassed permission checks
- **Role-Based Execution Control**: `skip_for_roles` field to prevent rule execution for specific roles
- **Watched Fields Optimization**: Automatic extraction and change-based filtering for event-driven rules
- **Comprehensive Error Handling**: Retry with exponential backoff, rollback with savepoints, escalate to caller
- **Permission Audit Logging**: `skip_permissions` with audit reason for tracking bypassed permission checks
- **Role-Based Execution Control**: `skip_for_roles` field to prevent rule execution for specific roles
- **Watched Fields Optimization**: Automatic extraction and change-based filtering for event-driven rules
- **Comprehensive Error Handling**: Retry with exponential backoff, rollback with savepoints, escalate to caller

### Developer Experience

- **Dynamic Configuration Schemas**: Improved `get_node_config_schema` and `get_action_context_schema` APIs
- **Extended Process Operation Metadata**: New fields like `writes_to`, `requires_doc`, `transactional`, `has_side_effect`, `config_schema`, `output_schema`, `action_overrides`
- **Enhanced Rule Lifecycle APIs**: Better `clone_rule`, `amend_rule`, `transition_rule` functionality
- **Improved Monitoring**: Enhanced `get_rule_stats` and execution tracing capabilities
- **Dynamic Configuration Schemas**: Improved `get_node_config_schema` and `get_action_context_schema` APIs
- **Extended Process Operation Metadata**: New fields like `writes_to`, `requires_doc`, `transactional`, `has_side_effect`, `config_schema`, `output_schema`, `action_overrides`
- **Enhanced Rule Lifecycle APIs**: Better `clone_rule`, `amend_rule`, `transition_rule` functionality
- **Improved Monitoring**: Enhanced `get_rule_stats` and execution tracing capabilities

### Frontend Improvements

- **Vue 3 + Pinia Architecture**: Modular state management with 5 dedicated stores
- **Real-time Execution Visualization**: `useNodeExecutionState` composable for test runs
- **Enhanced Condition Builder**: Improved visual multi-condition builder with nested AND/OR groups
- **Dynamic Control Factory**: Schema-driven UI generation for Process Operations
- **Vue 3 + Pinia Architecture**: Modular state management with 5 dedicated stores
- **Real-time Execution Visualization**: `useNodeExecutionState` composable for test runs
- **Enhanced Condition Builder**: Improved visual multi-condition builder with nested AND/OR groups
- **Dynamic Control Factory**: Schema-driven UI generation for Process Operations

These changes solidify FlexiRule as a production-ready, enterprise-grade workflow automation platform for Frappe/ERPNext.

Expand All @@ -240,10 +240,10 @@ FlexiRule is evolving fast. Whether you are a developer, designer, or documenter

### How You Can Help

- 🐛 **Bug Reports**: Open an issue for any glitches.
- 💡 **Feature Requests**: Suggest new Nodes or Process Operations.
- 📖 **Documentation**: Help us clarify concepts or add examples.
- 🔧 **Pull Requests**: We welcome fixes, optimizations, and new features.
- 🐛 **Bug Reports**: Open an issue for any glitches.
- 💡 **Feature Requests**: Suggest new Nodes or Process Operations.
- 📖 **Documentation**: Help us clarify concepts or add examples.
- 🔧 **Pull Requests**: We welcome fixes, optimizations, and new features.

Follow [Frappe Coding Standards](https://frappeframework.com/docs/v14/user/en/guidelines/coding-standards) and ensure all tests pass.

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

If you discover a security vulnerability in FlexiRule, please report it **privately**:

- Email:
- Email:

Do **not** create a public issue for security vulnerabilities.

Expand Down
Loading
Loading