Code Monkey home page Code Monkey logo

Comments (5)

CacheControl avatar CacheControl commented on May 14, 2024

@arsalans Would you mind elaborating on why you need to persist actual code? The library is designed with the intention that you won't need to do this. The idea is that you save the rule.toJSON() results into the database, and hydrate a new engine instance when they are later later retrieved.

The fact definitions themselves should remain in code-land, and shouldn't ever need to be persisted.

from json-rules-engine.

arsalans avatar arsalans commented on May 14, 2024

@CacheControl So I created two micro-services, one creates the rules and facts and saves them into the database, the other one consumes them. With this limitation of not saving methods in Json (not by the engine btw), I may have to merge both of them into one.

from json-rules-engine.

CacheControl avatar CacheControl commented on May 14, 2024

@arsalans If the first microservice is just providing rule CRUD, why does it need to know about the facts? Why not just have the runner service have the fact definitions?

In case I'm missing something and this is necessary, an alternative to merging the services would be to move the fact definitions into a private npm package and install it into both services.

from json-rules-engine.

arsalans avatar arsalans commented on May 14, 2024

from json-rules-engine.

CacheControl avatar CacheControl commented on May 14, 2024

Great, I'll close this for now but feel free to reopen if there are any surprises

from json-rules-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.