Implemented a first and basic version of a Rete rule engine
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from core.global_symbols import NotFound
|
||||
from core.global_symbols import NotFound, ErrorObj
|
||||
from core.utils import sheerka_deepcopy
|
||||
|
||||
|
||||
@@ -14,8 +14,9 @@ class BaseService:
|
||||
Base class for services
|
||||
"""
|
||||
|
||||
def __init__(self, sheerka):
|
||||
def __init__(self, sheerka, order=999):
|
||||
self.sheerka = sheerka
|
||||
self.order = order # initialisation order. The lowest is initialized first
|
||||
|
||||
def initialize(self):
|
||||
"""
|
||||
@@ -46,3 +47,8 @@ class BaseService:
|
||||
Store/record the value of an attribute
|
||||
"""
|
||||
self.sheerka.record_var(context, self.NAME, var_name, getattr(self, var_name))
|
||||
|
||||
|
||||
@dataclass()
|
||||
class FailedToCompileError(Exception, ErrorObj):
|
||||
cause: list
|
||||
|
||||
Reference in New Issue
Block a user