fix(flow): 修复边缘操作服务空指针异常
- 在executeEdgeOperateAction方法中添加edgeOperateServices为空检查 - 添加回退逻辑以支持Spring容器外的手动构造调用者 - 添加cmvr-iot-grpc-lib依赖以支持grpc功能 - 移除TaskNodeExecuteMessage中resolvedDeviceBindings的初始化赋值
This commit is contained in:
parent
1eb1a88870
commit
54220ccaac
@ -34,6 +34,10 @@
|
|||||||
<groupId>com.cmvr</groupId>
|
<groupId>com.cmvr</groupId>
|
||||||
<artifactId>cmvr-iot-grpc-client</artifactId>
|
<artifactId>cmvr-iot-grpc-client</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-grpc-lib</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 设备服务,供工作流报警监听组件使用 -->
|
<!-- 设备服务,供工作流报警监听组件使用 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -99,7 +99,7 @@ public class TaskNodeExecuteMessage {
|
|||||||
private List<ResourceRuntimeAssignmentVO> runtimeAssignments = new ArrayList<>();
|
private List<ResourceRuntimeAssignmentVO> runtimeAssignments = new ArrayList<>();
|
||||||
|
|
||||||
/** 节点参数名到真实设备ID的解析结果。 */
|
/** 节点参数名到真实设备ID的解析结果。 */
|
||||||
private JSONObject resolvedDeviceBindings = new JSONObject();
|
private JSONObject resolvedDeviceBindings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 节点入参
|
* 节点入参
|
||||||
|
|||||||
@ -87,6 +87,10 @@ public class FlowActionExecutorService {
|
|||||||
|
|
||||||
private String executeEdgeOperateAction(ActionEnum action, FlowActionRequestVO req) {
|
private String executeEdgeOperateAction(ActionEnum action, FlowActionRequestVO req) {
|
||||||
TaskNodeExecuteMessage message = buildSingleNodeMessage(action, req.getPayload());
|
TaskNodeExecuteMessage message = buildSingleNodeMessage(action, req.getPayload());
|
||||||
|
if (edgeOperateServices == null) {
|
||||||
|
// Keep manually constructed legacy callers working outside the Spring container.
|
||||||
|
return executeEdgeAction(action, req);
|
||||||
|
}
|
||||||
for (EdgeOperateService service : edgeOperateServices) {
|
for (EdgeOperateService service : edgeOperateServices) {
|
||||||
if (service.supports(action)) {
|
if (service.supports(action)) {
|
||||||
return resultToString(service.execute(message));
|
return resultToString(service.execute(message));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user