Code Monkey home page Code Monkey logo

regel's Introduction

regel

轻量级规则引擎,参考了:https://github.com/dyingbleed/g-rule 做了部分优化和代码重构&接入Spring boot,方便改造直接接入生产环境

使用方式

运行App.java,启动一个服务,访问localhost:8080

1.插入测试脚本

测试脚本就是一个groovy代码块,继承自ActionScript或者ConditionScript,左边输入脚本名字,比如a,右边提入代码块,点击提交,然后在下面输入框输入刚才的name,验证是否提交成功

2.执行测试用例

在这个case里面,我们的输入就三个变量,用户名(username),想干嘛(will),年龄(age),然后紧接着是响应的动作和条件脚本,点击执行,就能看到结果

如何在自己项目中使用

代码开源,copy本项目的core模块放在自己项目里面,或者单独拉一个轻量级服务,提供restful接口,无论如何,都是要自己实现Scriptloader这个service的~

为啥用groovy

groovy的同一个classLoader,在加载同一个类名时,每次加载,都会生产一个class实例,进而实现热部署。虽然有点反模式的意思,不过这不正是我们要的么,详情自己看源码

regel's People

Contributors

nanchengking avatar

Watchers

James Cloos avatar  avatar

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.