规则引擎

我爱海鲸 2025-09-02 18:22:14 暂无标签

简介liteflow、vueflow

2025-09-02 start:

LiteFlow v2.15.0 发布:拥抱虚拟线程,告别JVM参数! 

end

2025-08-24 start:

https://gitee.com/liu-haijin/flow

项目地址:

案例一:

el表达式:

<chain name="orderProcessChain">
  THEN(
    orderCreate,
    IF(isVip, vipDiscount, regularDiscount),
    WHEN(stockCheck, couponCheck),
    payment
  )
</chain>

test1解析的结果:

{
    "elExpression": "THEN(orderCreate, IF(isVip, vipDiscount, regularDiscount), WHEN(stockCheck, couponCheck), payment)",
    "success": true,
    "message": "Vue Flow流程图解析成功"
}

案例二:

el表达式:

<chain name="complexOrderChain">
  THEN(
    initOrder,
    checkInventory,
    IF(
      hasEnoughInventory,
      
      THEN(
        normalOrderChain,
        SWITCH(userType).TO(
          vipProcess, 
          newUserProcess, 
          defaultProcess
        )
      ),
      
      preOrderChain
    ),
    WHEN(
      calcPrice,
      checkRisk, 
      sendNotify
    ),
    createPayment
  )
</chain>

test2解析的结果:

{
    "elExpression": "THEN(initOrder, checkInventory, IF(hasEnoughInventory, THEN(normalOrderChain, SWITCH(userType).TO(vipProcess, newUserProcess, defaultProcess)), preOrderChain), WHEN(calcPrice, checkRisk, sendNotify), createPayment)",
    "success": true,
    "message": "Vue Flow流程图解析成功"
}

end

LiteFlow官网: https://liteflow.cc/pages/71ff49/

VueFlow官网:https://vue-flow.nodejs.cn/guide/composables.html

el表达式解析:参考:ivy-el-parser: 基于LiteFlow规则引擎,把前端LogicFlow数据解析成EL表达式的工具。 支持代码中动态构建LogicFlow数据格式。

example:liteflow-editor-server: LiteFlow可视化编辑器后端项目

liteflow-editor-client: Liteflow可视化编辑器前端项目

你好:我的2025