Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
2abf0cec
提交
2abf0cec
编写于
11月 09, 2022
作者:
chenxiang@lab.ibiz5.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
2022.11.09.001 行为附加逻辑
上级
52cf1851
变更
15
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
471 行增加
和
104 行删除
+471
-104
logback.xml
modules/ibizlab-generator-cli/src/main/resources/logback.xml
+0
-19
ActionLogicModel.java
.../main/java/cn/ibizlab/codegen/model/ActionLogicModel.java
+38
-0
ActionModel.java
...e/src/main/java/cn/ibizlab/codegen/model/ActionModel.java
+237
-70
EntityModel.java
...e/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
+0
-6
LogicModel.java
...re/src/main/java/cn/ibizlab/codegen/model/LogicModel.java
+8
-4
ModelStorage.java
.../src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
+7
-0
TemplateFileType.java
.../java/cn/ibizlab/codegen/templating/TemplateFileType.java
+2
-0
DEAction.hbs
...ge/src/main/resources/templ/@macro/logic/drl/DEAction.hbs
+2
-2
{{entityLogics}}Rule.drl.hbs
...resources/rules/{{entities}}/{{entityLogics}}Rule.drl.hbs
+3
-2
{{entityLogics}}RuleFlow.bpmn.hbs
...rces/rules/{{entities}}/{{entityLogics}}RuleFlow.bpmn.hbs
+3
-1
after.bpmn.hbs
...s/{{entities}}/{{lowerCase entityActions}}/after.bpmn.hbs
+34
-0
after.drl.hbs
...es/{{entities}}/{{lowerCase entityActions}}/after.drl.hbs
+40
-0
before.bpmn.hbs
.../{{entities}}/{{lowerCase entityActions}}/before.bpmn.hbs
+34
-0
before.drl.hbs
...s/{{entities}}/{{lowerCase entityActions}}/before.drl.hbs
+40
-0
exec.bpmn.hbs
...es/{{entities}}/{{lowerCase entityActions}}/exec.bpmn.hbs
+23
-0
未找到文件。
modules/ibizlab-generator-cli/src/main/resources/logback.xml
浏览文件 @
2abf0cec
...
@@ -33,25 +33,6 @@
...
@@ -33,25 +33,6 @@
<MaxFileSize>
100MB
</MaxFileSize>
<MaxFileSize>
100MB
</MaxFileSize>
</triggeringPolicy>
</triggeringPolicy>
</appender>
</appender>
<!-- <appender name="DB-CLASSIC-MYSQL-POOL" class="ch.qos.logback.classic.db.DBAppender">-->
<!-- <connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">-->
<!-- <dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">-->
<!-- <driverClass>com.mysql.cj.jdbc.Driver</driverClass>-->
<!-- <url>jdbc:mysql://127.0.0.1:3306/logback</url>-->
<!-- <user>root</user>-->
<!-- <password>root</password>-->
<!-- <sqlDialect class="ch.qos.logback.core.db.dialect.MySQLDialect" />-->
<!-- </dataSource>-->
<!-- </connectionSource>-->
<!-- <sqlDialect class="ch.qos.logback.core.db.dialect.MySQLDialect" />-->
<!-- </appender>-->
<!-- <!– 异步日志记录 –>-->
<!-- <appender name="ASYNC_APPENDER" class="ch.qos.logback.classic.AsyncAppender">-->
<!-- <appender-ref ref="DB-CLASSIC-MYSQL-POOL" />-->
<!-- <includeCallerData>true</includeCallerData>-->
<!-- </appender>-->
<!-- 日志输出级别 -->
<!-- 日志输出级别 -->
<root
level=
"INFO"
>
<root
level=
"INFO"
>
<appender-ref
ref=
"Console"
/>
<appender-ref
ref=
"Console"
/>
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ActionLogicModel.java
0 → 100644
浏览文件 @
2abf0cec
package
cn
.
ibizlab
.
codegen
.
model
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.dataentity.action.IPSDEAction
;
import
net.ibizsys.model.dataentity.action.IPSDEActionLogic
;
import
net.ibizsys.model.dataentity.action.IPSDELogicAction
;
import
net.ibizsys.model.dataentity.action.IPSDEScriptAction
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.util.*
;
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
public
class
ActionLogicModel
extends
BaseModel
{
public
ActionLogicModel
(
ActionModel
actionModel
,
IPSDEActionLogic
iPSDEActionLogic
,
int
index
)
{
this
.
opt
=
iPSDEActionLogic
;
this
.
actionModel
=
actionModel
;
this
.
entityModel
=
actionModel
.
getEntity
();
this
.
id
=
String
.
format
(
"%s_%s"
,
actionModel
.
getCodeName
(),
index
);
}
public
IPSDEActionLogic
getPSDEActionLogic
()
{
return
(
IPSDEActionLogic
)
opt
;
}
private
ActionModel
actionModel
;
private
EntityModel
entityModel
;
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ActionModel.java
浏览文件 @
2abf0cec
...
@@ -5,138 +5,305 @@ import lombok.NoArgsConstructor;
...
@@ -5,138 +5,305 @@ import lombok.NoArgsConstructor;
import
lombok.Setter
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.dataentity.action.IPSDEAction
;
import
net.ibizsys.model.dataentity.action.IPSDEAction
;
import
net.ibizsys.model.dataentity.action.IPSDEActionLogic
;
import
net.ibizsys.model.dataentity.action.IPSDELogicAction
;
import
net.ibizsys.model.dataentity.action.IPSDELogicAction
;
import
net.ibizsys.model.dataentity.action.IPSDEScriptAction
;
import
net.ibizsys.model.dataentity.action.IPSDEScriptAction
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.HashSet
;
import
java.util.*
;
import
java.util.Set
;
@Getter
@Getter
@Setter
@Setter
@NoArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
public
class
ActionModel
extends
BaseModel
{
public
class
ActionModel
extends
BaseModel
{
public
ActionModel
(
EntityModel
entityModel
,
IPSDEAction
action
)
public
ActionModel
(
EntityModel
entityModel
,
IPSDEAction
action
)
{
{
this
.
opt
=
action
;
this
.
opt
=
action
;
this
.
entity
=
entityModel
;
this
.
entity
=
entityModel
;
this
.
setCodeName
(
action
.
getCodeName
());
this
.
setCodeName
(
action
.
getCodeName
());
this
.
setName
(
action
.
getName
());
this
.
setName
(
action
.
getName
());
this
.
setId
(
String
.
format
(
"%1$s-%2$s"
,
entity
.
getCodeName
(),
action
.
getCodeName
()));
this
.
setId
(
String
.
format
(
"%1$s-%2$s"
,
entity
.
getCodeName
(),
action
.
getCodeName
()));
if
(!
CollectionUtils
.
isEmpty
(
this
.
getDEAction
().
getBeforePSDEActionLogics
()))
{
for
(
int
i
=
0
;
i
<
action
.
getBeforePSDEActionLogics
().
size
();
i
++)
{
IPSDEActionLogic
iPSDEActionLogic
=
action
.
getBeforePSDEActionLogics
().
get
(
i
);
if
((
iPSDEActionLogic
.
getPSDELogic
()
!=
null
&&
iPSDEActionLogic
.
getPSDELogic
().
isEnableBackend
())
||
iPSDEActionLogic
.
getDstPSDEAction
()
!=
null
&&
iPSDEActionLogic
.
getDstPSDEAction
().
isEnableBackend
())
{
beforeActionLogics
.
add
(
new
ActionLogicModel
(
this
,
iPSDEActionLogic
,
i
));
}
}
}
if
(!
CollectionUtils
.
isEmpty
(
this
.
getDEAction
().
getAfterPSDEActionLogics
()))
{
for
(
int
i
=
0
;
i
<
action
.
getAfterPSDEActionLogics
().
size
();
i
++)
{
IPSDEActionLogic
iPSDEActionLogic
=
action
.
getAfterPSDEActionLogics
().
get
(
i
);
if
((
iPSDEActionLogic
.
getPSDELogic
()
!=
null
&&
iPSDEActionLogic
.
getPSDELogic
().
isEnableBackend
())
||
iPSDEActionLogic
.
getDstPSDEAction
()
!=
null
&&
iPSDEActionLogic
.
getDstPSDEAction
().
isEnableBackend
())
{
afterActionLogics
.
add
(
new
ActionLogicModel
(
this
,
iPSDEActionLogic
,
i
));
}
}
}
}
}
public
IPSDEAction
getDEAction
()
private
List
<
ActionLogicModel
>
beforeActionLogics
=
new
ArrayList
<>();
{
return
(
IPSDEAction
)
opt
;
private
List
<
ActionLogicModel
>
afterActionLogics
=
new
ArrayList
<>();
public
IPSDEAction
getDEAction
()
{
return
(
IPSDEAction
)
opt
;
}
}
private
EntityModel
entity
;
private
EntityModel
entity
;
public
boolean
isGetAction
()
public
boolean
isGetAction
()
{
{
return
codeName
.
toLowerCase
().
startsWith
(
"get"
);
return
codeName
.
toLowerCase
().
startsWith
(
"get"
);
}
}
public
String
getInParam
()
public
boolean
isEnableBackend
()
{
{
return
this
.
getDEAction
().
isEnableBackend
();
String
param
=
this
.
getEntity
().
getCodeName
();
}
if
(
getDEAction
().
getPSDEActionInput
()==
null
)
public
boolean
hasBeforeLogics
()
{
return
beforeActionLogics
.
size
()
>
0
;
}
public
boolean
hasBeforeLogicsDEAction
()
{
return
beforeActionLogics
.
stream
().
anyMatch
(
actionLogicModel
->
actionLogicModel
.
getPSDEActionLogic
().
getDstPSDEAction
()
!=
null
);
}
public
List
<
String
>
getBeforeLogicParams
()
{
List
<
String
>
params
=
new
ArrayList
<>();
if
(
hasBeforeLogics
())
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
for
(
ActionLogicModel
actionLogicModel
:
beforeActionLogics
)
{
IPSDEActionLogic
iPSDEActionLogic
=
actionLogicModel
.
getPSDEActionLogic
();
if
(
iPSDEActionLogic
.
getDstPSDE
()
!=
null
&&
iPSDEActionLogic
.
getDstPSDEAction
()
!=
null
)
{
if
(!
map
.
containsKey
(
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
()))
{
String
param
=
String
.
format
(
"<tns:metaData express=\"T(cn.ibizlab.util.security.SpringContextHolder).getBean(T(%s.core.%s.service.%sService))\" name=\"%sService\" type=\"service\"/>"
,
entity
.
getSystem
().
getPackageName
(),
iPSDEActionLogic
.
getDstPSDE
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
(),
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
().
toLowerCase
()
);
params
.
add
(
param
);
map
.
put
(
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
(),
""
);
}
if
(!
map
.
containsKey
(
"srf_entity"
))
{
params
.
add
(
"<tns:metaData express=\"\" name=\"et\" type=\"entity\"/>"
);
map
.
put
(
"srf_entity"
,
""
);
}
}
}
}
return
params
;
}
public
List
<
String
>
getBeforeLogicSequenceFlows
()
{
List
<
String
>
params
=
new
ArrayList
<>();
if
(
hasBeforeLogics
())
{
String
source
=
"begin"
;
for
(
int
i
=
0
;
i
<
beforeActionLogics
.
size
();
i
++)
{
ActionLogicModel
actionLogicModel
=
beforeActionLogics
.
get
(
i
);
String
target
=
actionLogicModel
.
getId
();
params
.
add
(
String
.
format
(
"<sequenceFlow id=\"%1$s_%2$s\" sourceRef=\"%1$s\" targetRef=\"%2$s\"/>"
,
source
,
target
));
source
=
target
;
if
(
i
==
beforeActionLogics
.
size
()
-
1
)
{
params
.
add
(
String
.
format
(
"<sequenceFlow id=\"%1$s_%2$s\" sourceRef=\"%1$s\" targetRef=\"%2$s\"/>"
,
source
,
"prepareparam1_end"
));
}
}
}
return
params
;
}
public
List
<
String
>
getBeforeGlobalParams
(){
List
<
String
>
params
=
new
ArrayList
<>();
if
(
hasBeforeLogicsDEAction
())
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
for
(
ActionLogicModel
actionLogicModel
:
beforeActionLogics
)
{
IPSDEActionLogic
iPSDEActionLogic
=
actionLogicModel
.
getPSDEActionLogic
();
if
(
iPSDEActionLogic
.
getDstPSDE
()
!=
null
&&
iPSDEActionLogic
.
getDstPSDEAction
()
!=
null
)
{
if
(!
map
.
containsKey
(
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
()))
{
String
param
=
String
.
format
(
"global %s.core.%s.service.%sService %sService;"
,
entity
.
getSystem
().
getPackageName
(),
iPSDEActionLogic
.
getDstPSDE
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
(),
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
().
toLowerCase
()
);
params
.
add
(
param
);
map
.
put
(
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
(),
""
);
}
}
}
}
return
params
;
}
public
boolean
hasAfterLogics
()
{
return
afterActionLogics
.
size
()
>
0
;
}
public
boolean
hasAfterLogicsDEAction
()
{
return
afterActionLogics
.
stream
().
anyMatch
(
actionLogicModel
->
actionLogicModel
.
getPSDEActionLogic
().
getDstPSDEAction
()
!=
null
);
}
public
List
<
String
>
getAfterLogicParams
()
{
List
<
String
>
params
=
new
ArrayList
<>();
if
(
hasAfterLogics
())
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
for
(
ActionLogicModel
actionLogicModel
:
afterActionLogics
)
{
IPSDEActionLogic
iPSDEActionLogic
=
actionLogicModel
.
getPSDEActionLogic
();
if
(
iPSDEActionLogic
.
getDstPSDE
()
!=
null
&&
iPSDEActionLogic
.
getDstPSDEAction
()
!=
null
)
{
if
(!
map
.
containsKey
(
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
()))
{
String
param
=
String
.
format
(
"<tns:metaData express=\"T(cn.ibizlab.util.security.SpringContextHolder).getBean(T(%s.core.%s.service.%sService))\" name=\"%sService\" type=\"service\"/>"
,
entity
.
getSystem
().
getPackageName
(),
iPSDEActionLogic
.
getDstPSDE
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
(),
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
().
toLowerCase
()
);
params
.
add
(
param
);
map
.
put
(
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
(),
""
);
}
if
(!
map
.
containsKey
(
"srf_entity"
))
{
params
.
add
(
"<tns:metaData express=\"\" name=\"et\" type=\"entity\"/>"
);
map
.
put
(
"srf_entity"
,
""
);
}
}
}
}
return
params
;
}
public
List
<
String
>
getAfterLogicSequenceFlows
()
{
List
<
String
>
params
=
new
ArrayList
<>();
if
(
hasAfterLogics
())
{
String
source
=
"begin"
;
for
(
int
i
=
0
;
i
<
afterActionLogics
.
size
();
i
++)
{
ActionLogicModel
actionLogicModel
=
afterActionLogics
.
get
(
i
);
String
target
=
actionLogicModel
.
getId
();
params
.
add
(
String
.
format
(
"<sequenceFlow id=\"%1$s_%2$s\" sourceRef=\"%1$s\" targetRef=\"%2$s\"/>"
,
source
,
target
));
source
=
target
;
if
(
i
==
afterActionLogics
.
size
()
-
1
)
{
params
.
add
(
String
.
format
(
"<sequenceFlow id=\"%1$s_%2$s\" sourceRef=\"%1$s\" targetRef=\"%2$s\"/>"
,
source
,
"prepareparam1_end"
));
}
}
}
return
params
;
}
public
List
<
String
>
getAfterGlobalParams
(){
List
<
String
>
params
=
new
ArrayList
<>();
if
(
hasAfterLogicsDEAction
())
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
for
(
ActionLogicModel
actionLogicModel
:
afterActionLogics
)
{
IPSDEActionLogic
iPSDEActionLogic
=
actionLogicModel
.
getPSDEActionLogic
();
if
(
iPSDEActionLogic
.
getDstPSDE
()
!=
null
&&
iPSDEActionLogic
.
getDstPSDEAction
()
!=
null
)
{
if
(!
map
.
containsKey
(
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
()))
{
String
param
=
String
.
format
(
"global %s.core.%s.service.%sService %sService;"
,
entity
.
getSystem
().
getPackageName
(),
iPSDEActionLogic
.
getDstPSDE
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
(),
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
().
toLowerCase
()
);
params
.
add
(
param
);
map
.
put
(
iPSDEActionLogic
.
getDstPSDE
().
getCodeName
(),
""
);
}
}
}
}
return
params
;
}
public
String
getInParam
()
{
String
param
=
this
.
getEntity
().
getCodeName
();
if
(
getDEAction
().
getPSDEActionInput
()
==
null
)
return
param
;
return
param
;
if
(
"KEYFIELD"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
if
(
"KEYFIELD"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
param
=
this
.
getEntity
().
getKeyField
().
getType
().
java
;
param
=
this
.
getEntity
().
getKeyField
().
getType
().
java
;
else
if
(
"KEYFIELDS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
else
if
(
"KEYFIELDS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
param
=
"List<"
+
this
.
getEntity
().
getKeyField
().
getType
().
java
+
">"
;
param
=
"List<"
+
this
.
getEntity
().
getKeyField
().
getType
().
java
+
">"
;
else
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
else
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
param
=
"List<"
+
param
+
">"
;
param
=
"List<"
+
param
+
">"
;
return
param
;
return
param
;
}
}
public
String
getInParamName
()
public
String
getInParamName
()
{
{
String
param
=
"dto"
;
String
param
=
"dto"
;
if
(
getDEAction
().
getPSDEActionInput
()
==
null
)
if
(
getDEAction
().
getPSDEActionInput
()==
null
)
return
param
;
return
param
;
if
(
"KEYFIELD"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
if
(
"KEYFIELD"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
param
=
"key"
;
param
=
"key"
;
else
if
(
"KEYFIELDS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
else
if
(
"KEYFIELDS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionInput
().
getType
()))
param
=
"keys"
;
param
=
"keys"
;
return
param
;
return
param
;
}
}
public
boolean
isVoidReturn
()
public
boolean
isVoidReturn
()
{
{
if
(
getDEAction
().
getPSDEActionReturn
()
==
null
)
if
(
getDEAction
().
getPSDEActionReturn
()==
null
)
return
true
;
return
true
;
if
(!
"VOID"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
if
(!
"VOID"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
false
;
return
false
;
return
true
;
return
true
;
}
}
public
boolean
isListReturn
()
public
boolean
isListReturn
()
{
{
if
(
getDEAction
().
getPSDEActionReturn
()
==
null
)
if
(
getDEAction
().
getPSDEActionReturn
()==
null
)
return
false
;
return
false
;
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
||
"OBJECTS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
||
"OBJECTS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
||
"SIMPLES"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
||
"SIMPLES"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
true
;
return
true
;
return
false
;
return
false
;
}
}
public
String
typeReturn
()
public
String
typeReturn
()
{
{
if
(
isListReturn
())
{
if
(
isListReturn
())
{
if
(
"SIMPLES"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
if
(
"SIMPLES"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
PropType
.
findType
(
this
.
getDEAction
().
getPSDEActionReturn
().
getStdDataType
()).
java
;
return
PropType
.
findType
(
this
.
getDEAction
().
getPSDEActionReturn
().
getStdDataType
()).
java
;
else
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
else
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
||
"OBJECTS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
||
"OBJECTS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
this
.
getEntity
().
getCodeName
();
return
this
.
getEntity
().
getCodeName
();
}
}
return
""
;
return
""
;
}
}
public
String
getOutParam
()
public
String
getOutParam
()
{
{
String
param
=
this
.
getEntity
().
getCodeName
();
String
param
=
this
.
getEntity
().
getCodeName
();
if
(
getDEAction
().
getPSDEActionReturn
()
==
null
)
if
(
getDEAction
().
getPSDEActionReturn
()==
null
)
return
param
;
return
param
;
if
(
"VOID"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
if
(
"VOID"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
return
getInParam
();
return
getInParam
();
if
(
"SIMPLE"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
if
(
"SIMPLE"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
param
=
PropType
.
findType
(
this
.
getDEAction
().
getPSDEActionReturn
().
getStdDataType
()).
java
;
param
=
PropType
.
findType
(
this
.
getDEAction
().
getPSDEActionReturn
().
getStdDataType
()).
java
;
else
if
(
"SIMPLES"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
else
if
(
"SIMPLES"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
param
=
"List<"
+
PropType
.
findType
(
this
.
getDEAction
().
getPSDEActionReturn
().
getStdDataType
()).
java
+
">"
;
param
=
"List<"
+
PropType
.
findType
(
this
.
getDEAction
().
getPSDEActionReturn
().
getStdDataType
()).
java
+
">"
;
else
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
else
if
(
"DTOS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
())
||
"OBJECTS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
||
"OBJECTS"
.
equalsIgnoreCase
(
getDEAction
().
getPSDEActionReturn
().
getType
()))
param
=
"List<"
+
param
+
">"
;
param
=
"List<"
+
param
+
">"
;
return
param
;
return
param
;
}
}
public
Set
<
String
>
getLogics
()
public
Set
<
String
>
getLogics
()
{
{
Set
<
String
>
validLogic
=
new
HashSet
<>();
Set
<
String
>
validLogic
=
new
HashSet
<>();
if
(!
ObjectUtils
.
isEmpty
(
getDEAction
().
getBeforePSDEActionLogics
()))
{
if
(!
ObjectUtils
.
isEmpty
(
getDEAction
().
getBeforePSDEActionLogics
()))
getDEAction
().
getBeforePSDEActionLogics
().
forEach
(
logic
->
{
{
if
((
logic
.
isValid
()
&&
logic
.
isInternalLogic
()
&&
logic
.
getPSDELogic
().
isEnableBackend
())
||
getDEAction
().
getBeforePSDEActionLogics
().
forEach
(
logic
->{
(
logic
.
getDstPSDE
()
!=
null
&&
logic
.
getDstPSDEAction
()
!=
null
&&
(!(
logic
.
getDstPSDEAction
()
instanceof
IPSDEScriptAction
))))
if
((
logic
.
isValid
()
&&
logic
.
isInternalLogic
()
&&
logic
.
getPSDELogic
().
isEnableBackend
())
||
validLogic
.
add
((
entity
.
codeName
+
this
.
codeName
).
toLowerCase
()
+
"before.bpmn"
);
(
logic
.
getDstPSDE
()!=
null
&&
logic
.
getDstPSDEAction
()!=
null
&&
(!(
logic
.
getDstPSDEAction
()
instanceof
IPSDEScriptAction
))))
validLogic
.
add
((
entity
.
codeName
+
this
.
codeName
).
toLowerCase
()+
"before.bpmn"
);
});
});
}
}
if
(!
ObjectUtils
.
isEmpty
(
getDEAction
().
getAfterPSDEActionLogics
()))
if
(!
ObjectUtils
.
isEmpty
(
getDEAction
().
getAfterPSDEActionLogics
()))
{
{
getDEAction
().
getAfterPSDEActionLogics
().
forEach
(
logic
->
{
getDEAction
().
getAfterPSDEActionLogics
().
forEach
(
logic
->{
if
((
logic
.
isValid
()
&&
logic
.
isInternalLogic
()
&&
logic
.
getPSDELogic
().
isEnableBackend
())
||
if
((
logic
.
isValid
()
&&
logic
.
isInternalLogic
()
&&
logic
.
getPSDELogic
().
isEnableBackend
())
||
(
logic
.
getDstPSDE
()
!=
null
&&
logic
.
getDstPSDEAction
()
!=
null
&&
(!(
logic
.
getDstPSDEAction
()
instanceof
IPSDEScriptAction
))))
(
logic
.
getDstPSDE
()!=
null
&&
logic
.
getDstPSDEAction
()!=
null
&&
(!(
logic
.
getDstPSDEAction
()
instanceof
IPSDEScriptAction
))))
validLogic
.
add
((
entity
.
codeName
+
this
.
codeName
).
toLowerCase
()
+
"after.bpmn"
);
validLogic
.
add
((
entity
.
codeName
+
this
.
codeName
).
toLowerCase
()+
"after.bpmn"
);
});
});
}
}
if
(
"DELOGIC"
.
equalsIgnoreCase
(
getDEAction
().
getActionType
())&&
getDEAction
()
instanceof
IPSDELogicAction
)
if
(
"DELOGIC"
.
equalsIgnoreCase
(
getDEAction
().
getActionType
())
&&
getDEAction
()
instanceof
IPSDELogicAction
)
{
{
validLogic
.
add
((
entity
.
codeName
+
this
.
codeName
).
toLowerCase
()
+
"exec.bpmn"
);
validLogic
.
add
((
entity
.
codeName
+
this
.
codeName
).
toLowerCase
()+
"exec.bpmn"
);
}
}
return
validLogic
;
return
validLogic
;
}
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
浏览文件 @
2abf0cec
...
@@ -588,10 +588,6 @@ public class EntityModel extends BaseModel {
...
@@ -588,10 +588,6 @@ public class EntityModel extends BaseModel {
if
(
dataEntity
.
getMinorPSDERs
()
!=
null
)
{
if
(
dataEntity
.
getMinorPSDERs
()
!=
null
)
{
for
(
IPSDERBase
der
:
dataEntity
.
getMinorPSDERs
())
{
for
(
IPSDERBase
der
:
dataEntity
.
getMinorPSDERs
())
{
if
(
dataEntity
.
getName
().
equals
(
"IBIZCUSTOMERMG"
)
||
dataEntity
.
getName
().
equals
(
"IBIZCUSTOMER"
))
{
System
.
out
.
println
(
dataEntity
.
getName
());
}
RelationshipModel
rel
=
new
RelationshipModel
(
this
,
der
);
RelationshipModel
rel
=
new
RelationshipModel
(
this
,
der
);
rel
.
setRelationType
(
"reference"
).
setCodeName
(
der
.
getCodeName
()).
setEntityId
(
der
.
getMajorPSDataEntity
().
getId
())
rel
.
setRelationType
(
"reference"
).
setCodeName
(
der
.
getCodeName
()).
setEntityId
(
der
.
getMajorPSDataEntity
().
getId
())
.
setEntityCodeName
(
der
.
getMajorPSDataEntity
().
getCodeName
()).
setEntityName
(
der
.
getMajorPSDataEntity
().
getName
())
.
setEntityCodeName
(
der
.
getMajorPSDataEntity
().
getCodeName
()).
setEntityName
(
der
.
getMajorPSDataEntity
().
getName
())
...
@@ -759,8 +755,6 @@ public class EntityModel extends BaseModel {
...
@@ -759,8 +755,6 @@ public class EntityModel extends BaseModel {
//处理逻辑
//处理逻辑
if
(!
CollectionUtils
.
isEmpty
(
dataEntity
.
getAllPSDELogics
()))
{
if
(!
CollectionUtils
.
isEmpty
(
dataEntity
.
getAllPSDELogics
()))
{
for
(
IPSDELogic
logic
:
dataEntity
.
getAllPSDELogics
())
{
for
(
IPSDELogic
logic
:
dataEntity
.
getAllPSDELogics
())
{
if
(!
logic
.
isEnableBackend
())
continue
;
LogicModel
logicModel
=
new
LogicModel
(
this
,
logic
);
LogicModel
logicModel
=
new
LogicModel
(
this
,
logic
);
this
.
addLogic
(
logicModel
);
this
.
addLogic
(
logicModel
);
}
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/LogicModel.java
浏览文件 @
2abf0cec
...
@@ -41,7 +41,7 @@ public class LogicModel extends BaseModel {
...
@@ -41,7 +41,7 @@ public class LogicModel extends BaseModel {
iPSDELogicParam
.
getParamPSDataEntity
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
iPSDELogicParam
.
getParamPSDataEntity
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
iPSDELogicParam
.
getParamPSDataEntity
().
getCodeName
()
iPSDELogicParam
.
getParamPSDataEntity
().
getCodeName
()
);
);
ruleGlobalParams
.
add
(
String
.
format
(
"global %s %s;"
,
strDataType
,
strParamName
));
ruleGlobalParams
.
add
(
String
.
format
(
"global %s %s;"
,
strDataType
,
"param_"
+
strParamName
));
String
bpmnGlobalIdentifier
=
String
.
format
(
"<tns:global identifier=\"%s\" type=\"%s.core.%s.domain.%s\" />"
,
String
bpmnGlobalIdentifier
=
String
.
format
(
"<tns:global identifier=\"%s\" type=\"%s.core.%s.domain.%s\" />"
,
strParamName
,
strParamName
,
entityModel
.
getSystem
().
getPackageName
(),
entityModel
.
getSystem
().
getPackageName
(),
...
@@ -50,7 +50,7 @@ public class LogicModel extends BaseModel {
...
@@ -50,7 +50,7 @@ public class LogicModel extends BaseModel {
bpmnTnsParams
.
add
(
bpmnGlobalIdentifier
);
bpmnTnsParams
.
add
(
bpmnGlobalIdentifier
);
}
else
{
}
else
{
String
strDataType
=
"java.util.Map"
;
String
strDataType
=
"java.util.Map"
;
ruleGlobalParams
.
add
(
String
.
format
(
"global %s %s;"
,
strDataType
,
"param_"
+
strParamName
));
ruleGlobalParams
.
add
(
String
.
format
(
"global %s %s;"
,
strDataType
,
"param_"
+
strParamName
));
}
}
}
}
}
}
...
@@ -99,7 +99,7 @@ public class LogicModel extends BaseModel {
...
@@ -99,7 +99,7 @@ public class LogicModel extends BaseModel {
ruleGlobalParams
.
add
(
String
.
format
(
"global %s %s;"
,
strDataType
,
"wfClient"
));
ruleGlobalParams
.
add
(
String
.
format
(
"global %s %s;"
,
strDataType
,
"wfClient"
));
}
}
if
(
true
)
{
if
(
true
)
{
String
strDataType
=
String
.
format
(
"%s.core.%s.service.
I
%sService"
,
String
strDataType
=
String
.
format
(
"%s.core.%s.service.%sService"
,
entityModel
.
getSystem
().
getPackageName
(),
entityModel
.
getSystem
().
getPackageName
(),
entityModel
.
getDataEntity
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
entityModel
.
getDataEntity
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
entityModel
.
getDataEntity
().
getCodeName
()
entityModel
.
getDataEntity
().
getCodeName
()
...
@@ -107,7 +107,7 @@ public class LogicModel extends BaseModel {
...
@@ -107,7 +107,7 @@ public class LogicModel extends BaseModel {
ruleGlobalParams
.
add
(
String
.
format
(
"global %s %s;"
,
strDataType
,
String
.
format
(
"iBzSys%sDefaultService"
,
entityModel
.
getCodeName
())));
ruleGlobalParams
.
add
(
String
.
format
(
"global %s %s;"
,
strDataType
,
String
.
format
(
"iBzSys%sDefaultService"
,
entityModel
.
getCodeName
())));
String
strBpmnService
=
String
.
format
(
"<tns:metaData express=\"T(cn.ibizlab.util.security.SpringContextHolder).getBean(T(%s.core.%s.service.
I
%sService))\" name=\"iBzSys%sDefaultService\" type=\"service\"/>"
,
String
strBpmnService
=
String
.
format
(
"<tns:metaData express=\"T(cn.ibizlab.util.security.SpringContextHolder).getBean(T(%s.core.%s.service.%sService))\" name=\"iBzSys%sDefaultService\" type=\"service\"/>"
,
entityModel
.
getSystem
().
getPackageName
(),
entityModel
.
getSystem
().
getPackageName
(),
entityModel
.
getDataEntity
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
entityModel
.
getDataEntity
().
getPSSystemModule
().
getCodeName
().
toLowerCase
(),
entityModel
.
getDataEntity
().
getCodeName
(),
entityModel
.
getDataEntity
().
getCodeName
(),
...
@@ -122,6 +122,10 @@ public class LogicModel extends BaseModel {
...
@@ -122,6 +122,10 @@ public class LogicModel extends BaseModel {
return
(
IPSDELogic
)
opt
;
return
(
IPSDELogic
)
opt
;
}
}
public
boolean
isEnableBackend
(){
return
this
.
getPSDELogic
().
isEnableBackend
();
}
public
EntityModel
getEntity
()
{
public
EntityModel
getEntity
()
{
return
entity
;
return
entity
;
}
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
浏览文件 @
2abf0cec
...
@@ -173,6 +173,13 @@ public class ModelStorage {
...
@@ -173,6 +173,13 @@ public class ModelStorage {
rt
.
addOption
(
opt
);
rt
.
addOption
(
opt
);
});
});
}
}
else
if
(
type
.
equals
(
TemplateFileType
.
entityAction
))
{
getSystemModel
().
getEntities
().
forEach
(
item
->
item
.
getActions
().
values
().
forEach
(
actionModel
->
{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
entityAction
).
baseData
(
actionModel
,
actionModel
.
getCodeName
())
.
set
(
"entities"
,
item
.
getCodeName
());
rt
.
addOption
(
opt
);
}));
}
else
if
(
type
.
equals
(
TemplateFileType
.
entityLogic
))
{
else
if
(
type
.
equals
(
TemplateFileType
.
entityLogic
))
{
getSystemModel
().
getEntities
().
forEach
(
item
->
item
.
getLogics
().
forEach
(
logicModel
->
{
getSystemModel
().
getEntities
().
forEach
(
item
->
item
.
getLogics
().
forEach
(
logicModel
->
{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
entityLogic
).
baseData
(
logicModel
,
logicModel
.
getCodeName
())
CliOption
opt
=
newCliOption
(
TemplateFileType
.
entityLogic
).
baseData
(
logicModel
,
logicModel
.
getCodeName
())
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/templating/TemplateFileType.java
浏览文件 @
2abf0cec
...
@@ -8,6 +8,7 @@ public enum TemplateFileType {
...
@@ -8,6 +8,7 @@ public enum TemplateFileType {
apiEntity
(
Constants
.
API_ENTITIES
),
apiEntity
(
Constants
.
API_ENTITIES
),
apiDto
(
Constants
.
API_DTOS
),
apiDto
(
Constants
.
API_DTOS
),
entity
(
Constants
.
ENTITIES
),
entity
(
Constants
.
ENTITIES
),
entityAction
(
Constants
.
ENTITIY_ACTIONS
),
entityLogic
(
Constants
.
ENTITIY_LOGICS
),
entityLogic
(
Constants
.
ENTITIY_LOGICS
),
module
(
Constants
.
MODULES
),
module
(
Constants
.
MODULES
),
workflow
(
Constants
.
WORKFLOWS
),
workflow
(
Constants
.
WORKFLOWS
),
...
@@ -55,6 +56,7 @@ public enum TemplateFileType {
...
@@ -55,6 +56,7 @@ public enum TemplateFileType {
public
static
final
String
APPS
=
"apps"
;
public
static
final
String
APPS
=
"apps"
;
public
static
final
String
DICTS
=
"dicts"
;
public
static
final
String
DICTS
=
"dicts"
;
public
static
final
String
ENTITIES
=
"entities"
;
public
static
final
String
ENTITIES
=
"entities"
;
public
static
final
String
ENTITIY_ACTIONS
=
"entityActions"
;
public
static
final
String
ENTITIY_LOGICS
=
"entityLogics"
;
public
static
final
String
ENTITIY_LOGICS
=
"entityLogics"
;
public
static
final
String
WORKFLOWS
=
"workflows"
;
public
static
final
String
WORKFLOWS
=
"workflows"
;
public
static
final
String
SYSUTILS
=
"syUtils"
;
public
static
final
String
SYSUTILS
=
"syUtils"
;
...
...
modules/ibizlab-template/ibizlab-template-ibizedge/src/main/resources/templ/@macro/logic/drl/DEAction.hbs
浏览文件 @
2abf0cec
{{#if
(
eq
logicNodeModel
.
pSDELogicNode
.
dstPSDEAction
.
codeName
'Get'
)
}}
{{#if
(
eq
logicNodeModel
.
pSDELogicNode
.
dstPSDEAction
.
codeName
'Get'
)
}}
cn.ibizlab.util.helper.CachedBeanCopier.copy(
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
codeName
}}
service.get(param_
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDELogicParam
.
codeName
}}
.get
{{
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
keyPSDEField
.
codeName
}}
()),param_
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDELogicParam
.
codeName
}}
);
cn.ibizlab.util.helper.CachedBeanCopier.copy(
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
codeName
}}
service.get(param_
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDELogicParam
.
codeName
}}
.get
{{
pascalCase
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
keyPSDEField
.
codeName
}}
()),param_
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDELogicParam
.
codeName
}}
);
{{else}}
{{else}}
{{#if
(
eq
logicNodeModel
.
pSDELogicNode
.
dstPSDEAction
.
codeName
'Remove'
)
}}
{{#if
(
eq
logicNodeModel
.
pSDELogicNode
.
dstPSDEAction
.
codeName
'Remove'
)
}}
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
codeName
}}
service.remove(param_
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDELogicParam
.
codeName
}}
.get
{{
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
keyPSDEField
.
codeName
}}
());
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
codeName
}}
service.remove(param_
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDELogicParam
.
codeName
}}
.get
{{
pascalCase
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
keyPSDEField
.
codeName
}}
());
{{else}}
{{else}}
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
codeName
}}
service.
{{
camelCase
logicNodeModel
.
pSDELogicNode
.
dstPSDEAction
.
codeName
}}
(param_
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDELogicParam
.
codeName
}}
);
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDataEntity
.
codeName
}}
service.
{{
camelCase
logicNodeModel
.
pSDELogicNode
.
dstPSDEAction
.
codeName
}}
(param_
{{
lowerCase
logicNodeModel
.
pSDELogicNode
.
dstPSDELogicParam
.
codeName
}}
);
{{/if}}
{{/if}}
...
...
modules/ibizlab-template/ibizlab-template-ibizedge/src/main/resources/templ/{{projectName}}-core/src/main/resources/rules/{{entities}}/{{entityLogics}}Rule.drl.hbs
浏览文件 @
2abf0cec
{{#if
entityLogic
.
isEnableBackend
}}
package
{{
packageName
}}
.
{{
entityLogic
.
entity
.
module
}}
.logic.
{{
lowerCase
entityLogic
.
entity
.
codeName
}}
logic.
{{
lowerCase
entityLogic
.
codeName
}}
;
package
{{
packageName
}}
.
{{
entityLogic
.
entity
.
module
}}
.logic.
{{
lowerCase
entityLogic
.
entity
.
codeName
}}
logic.
{{
lowerCase
entityLogic
.
codeName
}}
;
import java.util.Map;
import java.util.Map;
...
@@ -25,8 +26,8 @@ ruleflow-group "{{lowerCase logicNodeModel.codeName}}group"
...
@@ -25,8 +26,8 @@ ruleflow-group "{{lowerCase logicNodeModel.codeName}}group"
{{#
eq
logicNodeModel
.
logicNodeType
"RAWSQLANDLOOPCALL"
}}{{>
@macro
/
logic
/
drl
/
RawSQLAndLoopCall
.
hbs
logicNodeModel
=
logicNodeModel
}}{{/
eq
}}
{{#
eq
logicNodeModel
.
logicNodeType
"RAWSQLANDLOOPCALL"
}}{{>
@macro
/
logic
/
drl
/
RawSQLAndLoopCall
.
hbs
logicNodeModel
=
logicNodeModel
}}{{/
eq
}}
{{#
eq
logicNodeModel
.
logicNodeType
"STARTWF"
}}{{>
@macro
/
logic
/
drl
/
StartWF
.
hbs
logicNodeModel
=
logicNodeModel
}}{{/
eq
}}
{{#
eq
logicNodeModel
.
logicNodeType
"STARTWF"
}}{{>
@macro
/
logic
/
drl
/
StartWF
.
hbs
logicNodeModel
=
logicNodeModel
}}{{/
eq
}}
{{#
each
entityLogic
.
pSDELogicParams
as
|
logicParam
|
}}
{{#
each
entityLogic
.
pSDELogicParams
as
|
logicParam
|
}}
update(
{{
lowerCase
logicParam
.
codeName
}}
);//更新fact中变量值
update(
param_
{{
lowerCase
logicParam
.
codeName
}}
);//更新fact中变量值
{{/
each
}}
{{/
each
}}
end
end
{{/
each
}}
{{/
each
}}
{{/if}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-ibizedge/src/main/resources/templ/{{projectName}}-core/src/main/resources/rules/{{entities}}/{{entityLogics}}RuleFlow.bpmn.hbs
浏览文件 @
2abf0cec
{{#if
entityLogic
.
isEnableBackend
}}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:di=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:g=
"http://www.jboss.org/drools/flow/gpd"
xmlns:tns=
"http://www.jboss.org/drools"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.mvel.org/2.0"
id=
"Definition"
name=
""
targetNamespace=
"http://www.jboss.org/drools"
typeLanguage=
"http://www.java.com/javaTypes"
>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:di=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:g=
"http://www.jboss.org/drools/flow/gpd"
xmlns:tns=
"http://www.jboss.org/drools"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.mvel.org/2.0"
id=
"Definition"
name=
""
targetNamespace=
"http://www.jboss.org/drools"
typeLanguage=
"http://www.java.com/javaTypes"
>
<process
id=
"
{{
packageName
}}
.core.
{{
entityLogic
.
entity
.
module
}}
.service.logic.
{{
lowerCase
entityLogic
.
entity
.
codeName
}}{{
lowerCase
entityLogic
.
codeName
}}
"
isClosed=
"false"
isExecutable=
"true"
<process
id=
"
{{
packageName
}}
.core.
{{
entityLogic
.
entity
.
module
}}
.service.logic.
{{
lowerCase
entityLogic
.
entity
.
codeName
}}{{
lowerCase
entityLogic
.
codeName
}}
"
isClosed=
"false"
isExecutable=
"true"
...
@@ -66,4 +67,5 @@
...
@@ -66,4 +67,5 @@
{{/if}}
{{/if}}
{{/
each
}}
{{/
each
}}
</process>
</process>
</definitions>
</definitions>
\ No newline at end of file
{{/if}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-ibizedge/src/main/resources/templ/{{projectName}}-core/src/main/resources/rules/{{entities}}/{{lowerCase entityActions}}/after.bpmn.hbs
0 → 100644
浏览文件 @
2abf0cec
{{#if
entityAction
.
hasAfterLogics
}}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:di=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:g=
"http://www.jboss.org/drools/flow/gpd"
xmlns:tns=
"http://www.jboss.org/drools"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.mvel.org/2.0"
id=
"Definition"
name=
""
targetNamespace=
"http://www.jboss.org/drools"
typeLanguage=
"http://www.java.com/javaTypes"
>
<process
id=
"
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.
{{
lowerCase
entityAction
.
entity
.
codeName
}}
.
{{
lowerCase
entityAction
.
codeName
}}
.afterLogic"
isClosed=
"false"
isExecutable=
"true"
name=
"
{{
entityAction
.
entity
.
module
}}
_
{{
lowerCase
entityAction
.
entity
.
codeName
}}
_
{{
lowerCase
entityAction
.
codeName
}}
_afterLogic"
processType=
"Private"
tns:packageName=
"
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.
{{
lowerCase
entityAction
.
entity
.
codeName
}}
.
{{
lowerCase
entityAction
.
codeName
}}
.afterLogic"
>
<extensionElements>
<tns:import
name=
"java.util.Map"
/>
<tns:import
name=
"org.springframework.util.StringUtils"
/>
<tns:import
name=
"cn.ibizlab.util.helper.RuleUtils"
/>
<tns:import
name=
"
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.domain.
{{
entityAction
.
entity
.
codeName
}}
"
/>
{{#
each
entityAction
.
afterLogicParams
as
|
afterLogicParam
|
}}
{{
afterLogicParam
}}
{{/
each
}}
</extensionElements>
<startEvent
id=
"begin"
isInterrupting=
"true"
/>
<endEvent
id=
"prepareparam1_end"
name=
"end"
/>
{{#
each
entityAction
.
afterActionLogics
as
|
logicModel
|
}}
{{#if
logicModel
.
pSDEActionLogic
.
pSDELogic
}}
<callActivity
activiti:exclusive=
"true"
calledElement=
"
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.service.logic.
{{
lowerCase
entityAction
.
entity
.
codeName
}}{{
lowerCase
logicModel
.
pSDEActionLogic
.
pSDELogic
.
codeName
}}
"
id=
"
{{
logicModel
.
id
}}
"
name=
"
{{
entityAction
.
entity
.
codeName
}}
/
{{
logicModel
.
pSDEActionLogic
.
pSDELogic
.
codeName
}}
RuleFlow.bpmn"
/>
{{/if}}
{{#if
logicModel
.
pSDEActionLogic
.
dstPSDEAction
}}
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"
{{
logicModel
.
id
}}
"
id=
"
{{
logicModel
.
id
}}
"
implementation=
"http://www.jboss.org/drools/rule"
name=
"
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
}}
"
/>
{{/if}}
{{/
each
}}
{{#
each
entityAction
.
afterLogicSequenceFlows
as
|
afterLogicSequenceFlow
|
}}
{{
afterLogicSequenceFlow
}}
{{/
each
}}
</process>
</definitions>
{{/if}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-ibizedge/src/main/resources/templ/{{projectName}}-core/src/main/resources/rules/{{entities}}/{{lowerCase entityActions}}/after.drl.hbs
0 → 100644
浏览文件 @
2abf0cec
{{#if
entityAction
.
hasAfterLogicsDEAction
}}
import cn.ibizlab.util.helper.CachedBeanCopier;
global
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.domain.
{{
entityAction
.
entity
.
codeName
}}
et;
{{#
each
entityAction
.
afterGlobalParams
as
|
afterGlobalParam
|
}}
{{
afterGlobalParam
}}
{{/
each
}}
no-loop
{{#
each
entityAction
.
afterActionLogics
as
|
logicModel
|
}}
{{#if
logicModel
.
pSDEActionLogic
.
dstPSDEAction
}}
rule "
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
}}
"
ruleflow-group "
{{
logicModel
.
id
}}
"
when
then
{{#if
ogicModel
.
pSDEActionLogic
.
isIgnoreException
}}
try{
{{/if}}
{{#if
(
or
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
actionType
'USERCUSTOM'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
actionType
'DELOGIC'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'Create'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'Update'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'Save'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'GetDraft'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'CheckKey'
))
}}
{{
packageName
}}
.core.
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
pSSystemModule
.
codeName
}}
.domain.
{{
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}
actionLogicDE =new
{{
packageName
}}
.core.
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
pSSystemModule
.
codeName
}}
.domain.
{{
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}
();
CachedBeanCopier.copy(et, actionLogicDE);
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}
Service.
{{
camelCase
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
}}
(actionLogicDE);
{{else}}
{{#if
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'Remove'
)
}}
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}
Service.remove(et.get
{{
pascalCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
keyPSDEField
.
codeName
}}
());
{{/if}}
{{/if}}
{{#if
ogicModel
.
pSDEActionLogic
.
isIgnoreException
}}
}catch(Exception e) {
log.error("执行[
{{
logicModel
.
pSDEActionLogic
.
dstPSDEAction
}}
]行为附加逻辑发生异常");
}
{{/if}}
end
{{/if}}
{{/
each
}}
{{/if}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-ibizedge/src/main/resources/templ/{{projectName}}-core/src/main/resources/rules/{{entities}}/{{lowerCase entityActions}}/before.bpmn.hbs
0 → 100644
浏览文件 @
2abf0cec
{{#if
entityAction
.
hasBeforeLogics
}}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:di=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:g=
"http://www.jboss.org/drools/flow/gpd"
xmlns:tns=
"http://www.jboss.org/drools"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.mvel.org/2.0"
id=
"Definition"
name=
""
targetNamespace=
"http://www.jboss.org/drools"
typeLanguage=
"http://www.java.com/javaTypes"
>
<process
id=
"
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.
{{
lowerCase
entityAction
.
entity
.
codeName
}}
.
{{
lowerCase
entityAction
.
codeName
}}
.beforeLogic"
isClosed=
"false"
isExecutable=
"true"
name=
"
{{
entityAction
.
entity
.
module
}}
_
{{
lowerCase
entityAction
.
entity
.
codeName
}}
_
{{
lowerCase
entityAction
.
codeName
}}
_beforeLogic"
processType=
"Private"
tns:packageName=
"
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.
{{
lowerCase
entityAction
.
entity
.
codeName
}}
.
{{
lowerCase
entityAction
.
codeName
}}
.beforeLogic"
>
<extensionElements>
<tns:import
name=
"java.util.Map"
/>
<tns:import
name=
"org.springframework.util.StringUtils"
/>
<tns:import
name=
"cn.ibizlab.util.helper.RuleUtils"
/>
<tns:import
name=
"
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.domain.
{{
entityAction
.
entity
.
codeName
}}
"
/>
{{#
each
entityAction
.
beforeLogicParams
as
|
beforeLogicParam
|
}}
{{
beforeLogicParam
}}
{{/
each
}}
</extensionElements>
<startEvent
id=
"begin"
isInterrupting=
"true"
/>
<endEvent
id=
"prepareparam1_end"
name=
"end"
/>
{{#
each
entityAction
.
beforeActionLogics
as
|
logicModel
|
}}
{{#if
logicModel
.
pSDEActionLogic
.
pSDELogic
}}
<callActivity
activiti:exclusive=
"true"
calledElement=
"
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.service.logic.
{{
lowerCase
entityAction
.
entity
.
codeName
}}{{
lowerCase
logicModel
.
pSDEActionLogic
.
pSDELogic
.
codeName
}}
"
id=
"
{{
logicModel
.
id
}}
"
name=
"
{{
entityAction
.
entity
.
codeName
}}
/
{{
logicModel
.
pSDEActionLogic
.
pSDELogic
.
codeName
}}
RuleFlow.bpmn"
/>
{{/if}}
{{#if
logicModel
.
pSDEActionLogic
.
dstPSDEAction
}}
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"
{{
logicModel
.
id
}}
"
id=
"
{{
logicModel
.
id
}}
"
implementation=
"http://www.jboss.org/drools/rule"
name=
"
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
}}
"
/>
{{/if}}
{{/
each
}}
{{#
each
entityAction
.
beforeLogicSequenceFlows
as
|
beforeLogicSequenceFlow
|
}}
{{
beforeLogicSequenceFlow
}}
{{/
each
}}
</process>
</definitions>
{{/if}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-ibizedge/src/main/resources/templ/{{projectName}}-core/src/main/resources/rules/{{entities}}/{{lowerCase entityActions}}/before.drl.hbs
0 → 100644
浏览文件 @
2abf0cec
{{#if
entityAction
.
hasBeforeLogicsDEAction
}}
import cn.ibizlab.util.helper.CachedBeanCopier;
global
{{
packageName
}}
.core.
{{
entityAction
.
entity
.
module
}}
.domain.
{{
entityAction
.
entity
.
codeName
}}
et;
{{#
each
entityAction
.
beforeGlobalParams
as
|
beforeGlobalParam
|
}}
{{
beforeGlobalParam
}}
{{/
each
}}
no-loop
{{#
each
entityAction
.
beforeActionLogics
as
|
logicModel
|
}}
{{#if
logicModel
.
pSDEActionLogic
.
dstPSDEAction
}}
rule "
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
}}
"
ruleflow-group "
{{
logicModel
.
id
}}
"
when
then
{{#if
ogicModel
.
pSDEActionLogic
.
isIgnoreException
}}
try{
{{/if}}
{{#if
(
or
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
actionType
'USERCUSTOM'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
actionType
'DELOGIC'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'Create'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'Update'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'Save'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'GetDraft'
)
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'CheckKey'
))
}}
{{
packageName
}}
.core.
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
pSSystemModule
.
codeName
}}
.domain.
{{
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}
actionLogicDE =new
{{
packageName
}}
.core.
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
pSSystemModule
.
codeName
}}
.domain.
{{
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}
();
CachedBeanCopier.copy(et, actionLogicDE);
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}
Service.
{{
camelCase
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
}}
(actionLogicDE);
{{else}}
{{#if
(
eq
logicModel
.
pSDEActionLogic
.
dstPSDEAction
.
codeName
'Remove'
)
}}
{{
lowerCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
codeName
}}
Service.remove(et.get
{{
pascalCase
logicModel
.
pSDEActionLogic
.
dstPSDE
.
keyPSDEField
.
codeName
}}
());
{{/if}}
{{/if}}
{{#if
ogicModel
.
pSDEActionLogic
.
isIgnoreException
}}
}catch(Exception e) {
log.error("执行[
{{
logicModel
.
pSDEActionLogic
.
dstPSDEAction
}}
]行为附加逻辑发生异常");
}
{{/if}}
end
{{/if}}
{{/
each
}}
{{/if}}
\ No newline at end of file
modules/ibizlab-template/ibizlab-template-ibizedge/src/main/resources/templ/{{projectName}}-core/src/main/resources/rules/{{entities}}/{{lowerCase entityActions}}/exec.bpmn.hbs
0 → 100644
浏览文件 @
2abf0cec
{{#if
(
and
(
eq
entityAction
.
dEAction
.
actionType
'DELOGIC'
)
(
entityAction
.
isEnableBackend
)
(
entityAction
.
pSDELogic
.
isEnableBackend
))
}}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:di=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:g=
"http://www.jboss.org/drools/flow/gpd"
xmlns:tns=
"http://www.jboss.org/drools"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.mvel.org/2.0"
id=
"Definition"
name=
""
targetNamespace=
"http://www.jboss.org/drools"
typeLanguage=
"http://www.java.com/javaTypes"
>
<process
id=
"
{{
packageName
}}
.core.extensions.service.logic.execute"
isClosed=
"false"
isExecutable=
"true"
name=
"
{{
entityAction
.
entity
.
module
}}
_
{{
lowerCase
entityAction
.
entity
.
module
}}
_
{{
lowerCase
entityAction
.
codeName
}}
.execLogic"
processType=
"Private"
tns:packageName=
"
{{
packageName
}}
.core.extensions.service.logic.execute"
>
<extensionElements>
<tns:import
name=
"java.util.Map"
/>
<tns:import
name=
"org.springframework.util.StringUtils"
/>
<tns:import
name=
"cn.ibizlab.util.helper.RuleUtils"
/>
</extensionElements>
<startEvent
id=
"begin"
isInterrupting=
"true"
/>
<endEvent
id=
"prepareparam1_end"
name=
"end"
/>
<callActivity
activiti:exclusive=
"true"
calledElement=
"
{{
packageName
}}
.core.
{{
lowerCase
entityAction
.
entity
.
module
}}
service.logic.
{{
lowerCase
entityAction
.
entity
.
codeName
}}{{
lowerCase
entityAction
.
pSDELogic
.
codeName
}}
"
id=
"
{{
entityAction
.
pSDELogic
.
codeName
}}
"
name=
"
{{
entityAction
.
entity
.
codeName
}}
/
{{
entityAction
.
pSDELogic
.
codeName
}}
RuleFlow.bpmn"
/>
<sequenceFlow
id=
"begin_
{{
entityAction
.
pSDELogic
.
codeName
}}
"
sourceRef=
"begin"
targetRef=
"
{{
entityAction
.
pSDELogic
.
codeName
}}
"
/>
<sequenceFlow
id=
"
{{
entityAction
.
pSDELogic
.
codeName
}}
_prepareparam1_end"
sourceRef=
"
{{
entityAction
.
pSDELogic
.
codeName
}}
"
targetRef=
"prepareparam1_end"
/>
</process>
</definitions>
{{/if}}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录