feature #I44FT8 支持脚本语言的组件,并支持动态刷新脚本(版本特性)

This commit is contained in:
bryan31
2021-08-10 00:27:14 +08:00
parent 64f7467503
commit 2d6cb55d1d
13 changed files with 178 additions and 28 deletions

View File

@@ -37,13 +37,13 @@ public class QLExpressScriptExecutor implements ScriptExecutor {
}
@Override
public void execute(String nodeId, int slotIndex) {
public Object execute(String nodeId, int slotIndex) {
List<String> errorList = new ArrayList<>();
try{
Slot slot = DataBus.getSlot(slotIndex);
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
context.put("slot", slot);
expressRunner.executeByExpressName(nodeId, context, errorList, true, false, null);
return expressRunner.executeByExpressName(nodeId, context, errorList, true, false, null);
}catch (Exception e){
for (String scriptErrorMsg : errorList){
log.error("\n{}", scriptErrorMsg);