From 8073f9f44f86af5bd5afdc851657a23921d6094f Mon Sep 17 00:00:00 2001 From: 75349 <753495441@qq.com> Date: Thu, 1 Dec 2022 18:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0xml=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liteflow/mysql/LiteFlowCommand.java | 6 +- src/main/resources/application.properties | 36 ++++---- src/main/resources/application.yml | 37 ++++---- src/main/resources/liteflow/flow1.el.xml | 85 +++++++++++++++++++ 4 files changed, 127 insertions(+), 37 deletions(-) create mode 100644 src/main/resources/liteflow/flow1.el.xml diff --git a/src/main/java/com/example/liteflow/mysql/LiteFlowCommand.java b/src/main/java/com/example/liteflow/mysql/LiteFlowCommand.java index bbb8886..a73c87a 100644 --- a/src/main/java/com/example/liteflow/mysql/LiteFlowCommand.java +++ b/src/main/java/com/example/liteflow/mysql/LiteFlowCommand.java @@ -29,7 +29,11 @@ public class LiteFlowCommand implements CommandLineRunner { costCenter.setSalesman("仓干配物流部(物流)"); costCenter.setBusinessCategory("全货船业务"); - LiteflowResponse response = flowExecutor.execute2Resp("costCenter", costCenter, CostCenterContext.class); + // 数据库匹配 +// LiteflowResponse response = flowExecutor.execute2Resp("costCenter", costCenter, CostCenterContext.class); + // xml匹配 + LiteflowResponse response = flowExecutor.execute2Resp("mainChain", costCenter, CostCenterContext.class); + CostCenterContext costCenterContext = response.getFirstContextBean(); String code = costCenterContext.getCode(); String name = costCenterContext.getName(); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index c060559..ac4dc52 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,18 +1,18 @@ -spring.application.name=liteflow-mysql -liteflow.rule-source-ext-data={\ - "url":"jdbc:mysql://localhost:3306/test_db",\ - "driverClassName":"com.mysql.cj.jdbc.Driver",\ - "username":"root",\ - "password":"123456",\ - "applicationName": "demo",\ - "chainTableName": "chain",\ - "chainApplicationNameField": "application_name",\ - "chainNameField": "chain_name",\ - "elDataField": "el_data",\ - "scriptTableName": "script",\ - "scriptApplicationNameField": "application_name",\ - "scriptIdField": "script_id",\ - "scriptNameField": "script_name",\ - "scriptDataField": "script_data",\ - "scriptTypeField": "script_type" - } \ No newline at end of file +#spring.application.name=liteflow-mysql +#liteflow.rule-source-ext-data={\ +# "url":"jdbc:mysql://localhost:3306/test_db",\ +# "driverClassName":"com.mysql.cj.jdbc.Driver",\ +# "username":"root",\ +# "password":"123456",\ +# "applicationName": "demo",\ +# "chainTableName": "chain",\ +# "chainApplicationNameField": "application_name",\ +# "chainNameField": "chain_name",\ +# "elDataField": "el_data",\ +# "scriptTableName": "script",\ +# "scriptApplicationNameField": "application_name",\ +# "scriptIdField": "script_id",\ +# "scriptNameField": "script_name",\ +# "scriptDataField": "script_data",\ +# "scriptTypeField": "script_type" +# } \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b211918..c17ede1 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,21 +3,22 @@ spring: name: liteflow-mysql liteflow: - rule-source-ext-data-map: - url: jdbc:mysql://localhost:3306/test_db - driverClassName: com.mysql.cj.jdbc.Driver - username: root - password: 123456 - applicationName: demo - #以下是chain表的配置,这个一定得有 - chainTableName: chain - chainApplicationNameField: application_name - chainNameField: chain_name - elDataField: el_data - #以下是script表的配置,如果你没使用到脚本,下面可以不配置 - scriptTableName: script - scriptApplicationNameField: application_name - scriptIdField: script_id - scriptNameField: script_name - scriptDataField: script_data - scriptTypeField: script_type \ No newline at end of file + rule-source: liteflow/*.el.xml +# rule-source-ext-data-map: +# url: jdbc:mysql://localhost:3306/test_db +# driverClassName: com.mysql.cj.jdbc.Driver +# username: root +# password: 123456 +# applicationName: demo +# #以下是chain表的配置,这个一定得有 +# chainTableName: chain +# chainApplicationNameField: application_name +# chainNameField: chain_name +# elDataField: el_data +# #以下是script表的配置,如果你没使用到脚本,下面可以不配置 +# scriptTableName: script +# scriptApplicationNameField: application_name +# scriptIdField: script_id +# scriptNameField: script_name +# scriptDataField: script_data +# scriptTypeField: script_type \ No newline at end of file diff --git a/src/main/resources/liteflow/flow1.el.xml b/src/main/resources/liteflow/flow1.el.xml new file mode 100644 index 0000000..8e9e444 --- /dev/null +++ b/src/main/resources/liteflow/flow1.el.xml @@ -0,0 +1,85 @@ + + + + THEN( + s3, s4, s5, s6, + IF (sectionClassification, + IF (businessType, + IF (salesman, + IF (businessCategory, + s7, + s9 + ), + s9 + ), + s9 + ), + IF (businessType, + IF (salesman, + s8, + s9 + ), + IF (businessType, + s8, + s9 + ) + ) + ) + ); + + + + + + + + + + + + + + + + + + + + + + + + + +