feat(legacy-core): 移植 EIP3 服务流引擎到保真层(com.dsasp.* 原样)

P1-2 第一步:framework com.dsasp.server.core 17 文件移植 + 缺失 common 依赖回填。

引擎(core):FlowExcuteServiceImpl(534 行,服务流执行入口)+ FlowServiceImpl
(流定义加载/默认流生成)+ flow/model 8 个(Flow/Node/Field/Procedure/Script/
ServiceBean/Start/End/Transition + BaseFlowConvert/DefaultFlowHelper)+
service/script(ScriptingEnginesManager/FlowScriptBindings)+ origin(OriginServiceManagerImpl)。
OSGi Activator.java 不移植(纯 BundleActivator/sun.awt,JDK17 不可用;
等价能力已由 SpringBeanOsgiServices @Component + 组件扫描接管,见迁移手册 §3.1)。

缺失 common 依赖回填(framework 原样):core.ControlBean/FlowDefinition、
core.service.{FlowExcuteService,FlowService,OriginServiceManager}、
util.{AopTargetUtils,ExceptionUtil}、privilege.service.FlowPrivilegeService。

函数库回迁:GetValueFunction/GetDefaultValueFunction 以 framework 原版 Groovy
回迁(替换 PoC 空桩,依赖均已就位,gmavenplus 联合编译);GetServicesFunction
保包名/类名/签名,回迁引擎执行路径实际调用的 findCount/loadPOJO/listSelect
三方法(其余 @Function 依赖 P2/P3 横切服务,届时补全)。

FlowPrivilegeService:framework 原样移植(FlowPrivilegeServiceImpl + ServicePrivilege)
入保真层 com.dsasp.server.privilege.service。

API 断点修复(迁移手册 §2 同款):FlowServiceImpl 移除 JDK 内部 import
com.sun.xml.internal.*(原版未用)、queryForInt→queryForObject;Flow.java
dom4j 2.x selectNodes 返回 List<Node> 加 unchecked 转型(14 处)。
ScriptingEnginesManager 的 activiti JuelScriptEngineFactory 适配为 JSR-223 惰性
注册(架构纪律:activiti/Flowable 不进保真层;线性查询/报表流不走 juel)。

mvn compile/test 通过,ArchUnit(保真层禁依赖现代层)仍绿。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 11:49:01 +08:00
parent 41afc7ae4c
commit de72116502
34 changed files with 4342 additions and 19 deletions

View File

@@ -19,6 +19,10 @@
<dependency><groupId>org.apache.groovy</groupId><artifactId>groovy-jsr223</artifactId></dependency>
<dependency><groupId>joda-time</groupId><artifactId>joda-time</artifactId></dependency>
<dependency><groupId>org.json</groupId><artifactId>json</artifactId></dependency>
<!-- P1-4:CCache 内部实现换 Caffeine(接替极简 HashMap 版),语义=进程内本地缓存。
版本走 Spring Boot BOM(3.1.8)。公共签名不变,call site 零改动。架构第三节留口:
多实例横扩时走 Spring Cache 抽象换 Redis——见 P1加固实测报告对该条款的差距说明。 -->
<dependency><groupId>com.github.ben-manes.caffeine</groupId><artifactId>caffeine</artifactId></dependency>
<!-- C2 数据权限:DataFilterHelper 用 org.codehaus.jackson(Jackson 1.x)做 FILTERRULE JSON 互转,
与 framework 原版一致(原样移植,不改 Jackson 2);传递依赖 jackson-core-asl -->
<dependency><groupId>org.codehaus.jackson</groupId><artifactId>jackson-mapper-asl</artifactId></dependency>
@@ -26,4 +30,34 @@
<!-- C2 单测:DataFilterHelper JSON 互转 + getWhereClause 拼接(纯逻辑,假 POJOInfo) -->
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency>
</dependencies>
<build>
<plugins>
<!-- P1 服务流引擎:framework 函数库 GetValueFunction/GetDefaultValueFunction 与
SecureGroovyScriptEngineFactory/MethodCallExpressionChecker 为 .groovy 源码
(原样移植,见 src/main/groovy),需 Groovy 联合编译为字节码,运行时脚本方可按
FQN import。gmavenplus 在 compile 阶段编译 src/main/groovy,与 javac 联合。 -->
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<goals>
<!-- generateStubs 在 javac 前产出 Java 桩,使 com.dsasp.* 的 .java
可引用 .groovy 类(GetValueFunction 等);compile 再产出真实字节码。 -->
<goal>addSources</goal>
<goal>addTestSources</goal>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>compileTests</goal>
<goal>removeStubs</goal>
<goal>removeTestStubs</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>