A .NET Standard 2.0 library that manages flow state and rule engine execution for applications built with LogicBuilder.
LogicBuilder.RulesDirector provides the runtime infrastructure for executing business logic flows defined visually in the LogicBuilder application. It serves as the orchestration layer that:
- Manages Flow State: Tracks the current position in a flow by maintaining module names, page indices, and shape indices
- Coordinates Rule Execution: Switches between rule engines as the flow navigates between different modules
- Maintains Navigation History: Preserves calling module stacks to support nested module invocation and returns
- Provides Flow Progress Tracking: Records the execution path through flow diagrams for debugging and auditing
- Supports State Backup/Restore: Enables save points and rollback functionality for complex workflows
The abstract base class that defines the core flow management contract:
- Driver Property: Encodes the current position in the flow (format:
{ShapeIndex}P{PageIndex}) - Selection Property: Handles multiple-choice branching logic within flows
- Module Management: Tracks module begin/end events and maintains module call stacks
- Flow Backup: Captures and restores complete flow state via
FlowBackupDataobjects - Progress Tracking: Maintains a list of visited flow positions for visibility
- Automatically retrieves and executes the appropriate ruleset when modules change
- Manages module invocation stacks for nested flow calls
- Handles flow initialization via
StartInitialFlow() - Coordinates with
IRulesCacheto access compiled rule engines
- IFlowActivity: The execution context that connects the Director to application-specific logic
- IRulesCache: Repository for accessing compiled rule engines by module name
- Progress: Event-driven collection of flow execution steps
- Flow Initialization:
StartInitialFlow()is called with a module name - Rule Execution: The Director retrieves the ruleset from the cache and executes it
- State Tracking: As rules fire, the
Driverproperty is updated with shape/page coordinates - Module Navigation: When a rule invokes a new module,
ModuleBeginNametriggers:- Current state is pushed onto the calling module stack
- The new module's ruleset is loaded and executed
- Module Return: When
ModuleEndNameis set, state is restored from the stack - Progress Logging: Each state change is recorded in the
Progresscollection
The Driver property encodes position as: {ShapeIndex}P{PageIndex}
Example: "15P2" means Shape 15 on Page 2 of the flow diagram
- Business process automation systems
- Rules-based workflow engines
- Decision management applications
- Dynamic form flows and wizards
- State machine implementations
- .NET Standard 2.0 or higher
- Compatible with .NET Framework 4.6.1+ and .NET Core 2.0+
- CLS-compliant for cross-language interoperability
- LogicBuilder - Visual flow diagram designer and code generator