Skip to content

Commit

Permalink
重新生成代码
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Sep 8, 2023
1 parent 130a09e commit 263cabd
Show file tree
Hide file tree
Showing 17 changed files with 219 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,22 @@ Nop平台的前端代码在[nop-chaos项目](https://gitee.com/canonical-entropy
```shell
git clone https://gitee.com/canonical-entropy/nop-entropy.git
cd nop-entropy
mvn -T 2C clean install -DskipTests -Dquarkus.package.type=uber-jar
mvn clean install -DskipTests -Dquarkus.package.type=uber-jar
```

注意: **编译运行需要JDK11以上版本,不支持JDK8**
注意: **编译运行需要JDK11以上版本,不支持JDK8**, **在PowerShell中执行的时候需要用引号将参数包裹起来**

```
mvn clean install "-DskipTests" "-Dquarkus.package.type=uber-jar"
```

quarkus.package.type参数是quarkus框架所识别的一个参数,指定它为uber-jar将会把nop-quarkus-demo等项目打包成一个包含所有依赖类的单一jar包。可以通过java -jar XXX-runner.jar的方式直接运行。

maven3.9.4打包quarkus可能会失败,可以先用如下方式跳过quarkus打包
````
mvn install -DskipTests
````

* nop-idea-plugin
nop-idea-plugin是IDEA的插件项目,必须采用Gradle编译。

Expand Down
22 changes: 22 additions & 0 deletions docs/dev-guide/rule/rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 规则引擎

决策树和决策矩阵是业务人员可以直观理解的复杂IF-ELSE逻辑表达形式,也是规则引擎中最常用、最有用的部分。常见的规则引擎如Drools虽然提供了更加丰富的功能特性集,
特别是所谓的RETE算法可以用于高效复用多次重复出现的表达式片段,但在实际业务应用中很少出现必须使用RETE算法的情况,大部分情况下我们都是把规则引擎降级为决策表和决策矩阵来使用。

> 合理安排决策树和决策矩阵的节点顺序已经可以起到优化执行的作用。对于必须使用RETE算法的情况往往一般人已经难以直观理解,难以交给业务人员直接配置。
> 甚至程序员理解其中的执行细节也存在困难,还不如手工实现更加便于优化。基本的决策表+类似流程图的执行控制往往比使用RETE算法更加合用。
NopRule规则引擎使用Excel作为可视化设计工具,可以高效的执行决策表和决策矩阵逻辑。NopRule是一个非常轻量级的规则引擎,它可以嵌入在Java程序内部使用,也可以作为微服务使用,
可以提供在线可视化设计界面,将规则模型保存在数据库中实现动态更新,也可以使用静态的模型文件,不依赖数据库存储。

# 使用方式

## 决策表配置

### 在线修改

## 决策矩阵配置


# 设计原理

Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,14 @@
<join>
<on leftProp="deptId" rightProp="deptId"/>
</join>
<ref-set/>
</to-one>
<to-one displayName="岗位" name="position" refEntityName="io.nop.auth.dao.entity.NopAuthPosition"
tagSet="pub,ref-pub" i18n-en:displayName="Position">
<join>
<on leftProp="positionId" rightProp="positionId"/>
</join>
<ref-set/>
</to-one>
<to-many displayName="角色映射" name="roleMappings" refEntityName="io.nop.auth.dao.entity.NopAuthUserRole"
refPropName="user" tagSet="pub,cascade-delete,insertable,updatable"
Expand Down Expand Up @@ -189,6 +191,7 @@
<join>
<on leftProp="userId" rightProp="userId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -279,13 +282,15 @@
<join>
<on leftProp="userId" rightProp="userId"/>
</join>
<ref-set/>
</to-one>
<to-one displayName="角色" name="role" refEntityName="io.nop.auth.dao.entity.NopAuthRole"
refPropName="userMappings" tagSet="pub,ref-pub,ref-cascade-delete,ref-insertable,ref-updatable"
i18n-en:displayName="Role" ref-i18n-en:displayName="UserMappings">
<join>
<on leftProp="roleId" rightProp="roleId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -328,12 +333,14 @@
<join>
<on leftProp="userId" rightProp="userId"/>
</join>
<ref-set/>
</to-one>
<to-one displayName="角色" name="substitutedUser" refEntityName="io.nop.auth.dao.entity.NopAuthUser"
tagSet="pub" i18n-en:displayName="Substituted User">
<join>
<on leftProp="substitutedUserId" rightProp="userId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -470,13 +477,15 @@
<join>
<on leftProp="parentId" rightProp="resourceId"/>
</join>
<ref-set/>
</to-one>
<to-one displayName="子系统" name="site" refEntityName="io.nop.auth.dao.entity.NopAuthSite"
refPropName="resources" tagSet="pub,ref-pub,cascade-delete,ref-connection,queryable,sortable"
i18n-en:displayName="Site" ref-i18n-en:displayName="Resources">
<join>
<on leftProp="siteId" rightProp="siteId"/>
</join>
<ref-set/>
</to-one>
<to-many displayName="子资源" name="children" refEntityName="io.nop.auth.dao.entity.NopAuthResource"
refPropName="parent" tagSet="pub" i18n-en:displayName="Children">
Expand Down Expand Up @@ -531,13 +540,15 @@
<join>
<on leftProp="roleId" rightProp="roleId"/>
</join>
<ref-set/>
</to-one>
<to-one displayName="资源" name="resource" refEntityName="io.nop.auth.dao.entity.NopAuthResource"
refPropName="roleMappings" tagSet="pub,ref-pub,ref-cascade-delete,ref-insertable,ref-updatable"
i18n-en:displayName="Resource" ref-i18n-en:displayName="Roles">
<join>
<on leftProp="resourceId" rightProp="resourceId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -585,6 +596,7 @@
<join>
<on leftProp="roleId" rightProp="roleId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -676,6 +688,7 @@
<join>
<on leftProp="sessionId" rightProp="sessionId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -725,6 +738,7 @@
<join>
<on leftProp="parentId" rightProp="deptId"/>
</join>
<ref-set/>
</to-one>
<to-many displayName="子资源" name="children" refEntityName="io.nop.auth.dao.entity.NopAuthDept"
refPropName="parent" tagSet="pub" i18n-en:displayName="Children">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<join>
<on leftProp="inputFileId" rightProp="sid"/>
</join>
<ref-set/>
</to-one>
<to-many displayName="任务状态变量" name="taskStates"
refEntityName="io.nop.batch.dao.entity.NopBatchTaskState" refPropName="task"
Expand Down Expand Up @@ -151,6 +152,7 @@
<join>
<on leftProp="taskId" rightProp="sid"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -191,6 +193,7 @@
<join>
<on leftProp="taskId" rightProp="sid"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
<join>
<on leftProp="dictId" rightProp="sid"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
<join>
<on leftProp="txnId" rightProp="txnId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<join>
<on leftProp="parentWfId" rightProp="wfId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -251,12 +252,14 @@
<join>
<on leftProp="wfId" rightProp="wfId"/>
</join>
<ref-set/>
</to-one>
<to-one displayName="子流程实例" name="subWfInstance" refEntityName="io.nop.wf.dao.entity.NopWfInstance"
tagSet="pub,ref-pub" i18n-en:displayName="Sub Workflow Instance">
<join>
<on leftProp="subWfId" rightProp="wfId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -287,18 +290,21 @@
<join>
<on leftProp="wfId" rightProp="wfId"/>
</join>
<ref-set/>
</to-one>
<to-one displayName="工作流步骤" name="wfStep" refEntityName="io.nop.wf.dao.entity.NopWfStepInstance"
tagSet="pub,ref-pub" i18n-en:displayName="Workflow Step">
<join>
<on leftProp="stepId" rightProp="stepId"/>
</join>
<ref-set/>
</to-one>
<to-one displayName="工作流步骤" name="prevWfStep" refEntityName="io.nop.wf.dao.entity.NopWfStepInstance"
tagSet="pub,ref-pub" i18n-en:displayName="Prev Workflow Step">
<join>
<on leftProp="prevStepId" rightProp="stepId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down Expand Up @@ -343,13 +349,15 @@
<join>
<on leftProp="wfId" rightProp="wfId"/>
</join>
<ref-set/>
</to-one>
<to-one displayName="工作流步骤实例" name="wfStepInstance"
refEntityName="io.nop.wf.dao.entity.NopWfStepInstance" tagSet="pub,ref-pub"
i18n-en:displayName="Workflow Step Instance">
<join>
<on leftProp="stepId" rightProp="stepId"/>
</join>
<ref-set/>
</to-one>
</relations>
</entity>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" x:extends="_WfActionRequestBean.xmeta">

<props/>
</meta>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" x:extends="_WfCommandRequestBean.xmeta">

<props/>
</meta>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" x:extends="_WfStartRequestBean.xmeta">

<props/>
</meta>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" x:extends="_WfStartResponseBean.xmeta">

<props/>
</meta>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" x:extends="_WfSubFlowEndRequestBean.xmeta">

<props/>
</meta>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" xmlns:i18n-en="i18n-en" displayName="执行动作请求消息"
i18n-en:displayName="Workflow Action Request" ext:model="api">

<props>
<prop name="wfName" displayName="工作流名称" i18n-en:displayName="Workflow Name">
<schema type="java.lang.String" precision="500"/>
</prop>
<prop name="wfVersion" displayName="工作流版本" i18n-en:displayName="Workflow Version">
<schema type="java.lang.String" precision="50"/>
</prop>
<prop name="wfId" displayName="工作流ID" i18n-en:displayName="Workflow ID" mandatory="true">
<schema type="java.lang.String" precision="50"/>
</prop>
<prop name="stepId" displayName="工作流步骤ID" i18n-en:displayName="Step ID" mandatory="true">
<schema type="java.lang.String" precision="50"/>
</prop>
<prop name="actionName" displayName="执行动作" i18n-en:displayName="Action Name" mandatory="true">
<schema type="java.lang.String" precision="100"/>
</prop>
<prop name="args" displayName="执行参数" i18n-en:displayName="Action Args">
<schema type="java.util.Map&lt;java.lang.String,java.lang.Object&gt;" precision="4000"/>
</prop>
</props>
</meta>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" xmlns:i18n-en="i18n-en" displayName="执行命令请求消息"
i18n-en:displayName="Workflow Command Request" ext:model="api">

<props>
<prop name="wfName" displayName="工作流名称" i18n-en:displayName="Workflow Name">
<schema type="java.lang.String" precision="500"/>
</prop>
<prop name="wfVersion" displayName="工作流版本" i18n-en:displayName="Workflow Version">
<schema type="java.lang.String" precision="50"/>
</prop>
<prop name="wfId" displayName="工作流ID" i18n-en:displayName="Workflow ID" mandatory="true">
<schema type="java.lang.String" precision="50"/>
</prop>
<prop name="args" displayName="执行参数" i18n-en:displayName="Action Args">
<schema type="java.util.Map&lt;java.lang.String,java.lang.Object&gt;" precision="4000"/>
</prop>
</props>
</meta>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" xmlns:i18n-en="i18n-en" displayName="启动工作流请求消息"
i18n-en:displayName="Workflow Start Request" ext:model="api">

<props>
<prop name="wfName" displayName="工作流名称" i18n-en:displayName="Workflow Name" mandatory="true">
<schema type="java.lang.String" precision="500"/>
</prop>
<prop name="wfVersion" displayName="工作流版本" i18n-en:displayName="Workflow Version" mandatory="true">
<schema type="java.lang.String" precision="50"/>
</prop>
<prop name="args" displayName="启动参数" i18n-en:displayName="Start Args">
<schema type="java.util.Map&lt;java.lang.String,java.lang.Object&gt;" precision="4000"/>
</prop>
<prop name="parentWfName" displayName="父工作流名称" i18n-en:displayName="Parent Workflow Name">
<schema type="java.lang.String" precision="500"/>
</prop>
<prop name="parentWfVersion" displayName="父工作流版本" i18n-en:displayName="Parent Workflow Version">
<schema type="java.lang.String" precision="50"/>
</prop>
<prop name="parentWfId" displayName="父工作流ID" i18n-en:displayName="Parent Workflow ID">
<schema type="java.lang.String" precision="500"/>
</prop>
<prop name="parentWfStepId" displayName="父工作流步骤ID" i18n-en:displayName="Parent Workflow Step ID">
<schema type="java.lang.String" precision="50"/>
</prop>
</props>
</meta>
Loading

0 comments on commit 263cabd

Please sign in to comment.