|
|
@@ -102,6 +102,12 @@ public class RuleService {
|
|
|
if (StringUtils.hasText(input.getFixedValue())) {
|
|
|
propertyService.setEdgeProperty(edgeId, "fixed_value", input.getFixedValue());
|
|
|
}
|
|
|
+ if (StringUtils.hasText(input.getEntryPath())) {
|
|
|
+ propertyService.setEdgeProperty(edgeId, "entry_path", input.getEntryPath());
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(input.getSourceText())) {
|
|
|
+ propertyService.setEdgeProperty(edgeId, "source_text", input.getSourceText());
|
|
|
+ }
|
|
|
sortOrder++;
|
|
|
}
|
|
|
}
|
|
|
@@ -137,6 +143,40 @@ public class RuleService {
|
|
|
propertyService.setNodeProperty(ruleId, "description", dto.getDescription());
|
|
|
}
|
|
|
|
|
|
+ // Update inputs if provided
|
|
|
+ if (dto.getInputs() != null) {
|
|
|
+ // Delete existing INPUT_FROM edges
|
|
|
+ edgeService.deleteByTypeAndFrom(Constants.EDGE_INPUT_FROM, ruleId);
|
|
|
+
|
|
|
+ // Create new INPUT_FROM edges
|
|
|
+ int sortOrder = 0;
|
|
|
+ for (RuleCreateDTO.RuleInputDTO input : dto.getInputs()) {
|
|
|
+ if (input.getSourceNodeId() != null) {
|
|
|
+ Long edgeId = edgeService.createEdge(
|
|
|
+ Constants.EDGE_INPUT_FROM, ruleId, input.getSourceNodeId(), sortOrder);
|
|
|
+ if (StringUtils.hasText(input.getInputKey())) {
|
|
|
+ propertyService.setEdgeProperty(edgeId, "input_key", input.getInputKey());
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(input.getInputName())) {
|
|
|
+ propertyService.setEdgeProperty(edgeId, "input_name", input.getInputName());
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(input.getInputType())) {
|
|
|
+ propertyService.setEdgeProperty(edgeId, "input_type", input.getInputType());
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(input.getFixedValue())) {
|
|
|
+ propertyService.setEdgeProperty(edgeId, "fixed_value", input.getFixedValue());
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(input.getEntryPath())) {
|
|
|
+ propertyService.setEdgeProperty(edgeId, "entry_path", input.getEntryPath());
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(input.getSourceText())) {
|
|
|
+ propertyService.setEdgeProperty(edgeId, "source_text", input.getSourceText());
|
|
|
+ }
|
|
|
+ sortOrder++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
VRule vr = ruleViewMapper.selectById(ruleId);
|
|
|
return toRuleVO(vr);
|
|
|
}
|
|
|
@@ -227,6 +267,8 @@ public class RuleService {
|
|
|
vo.setInputName(vi.getInputName());
|
|
|
vo.setInputType(vi.getInputType());
|
|
|
vo.setFixedValue(vi.getFixedValue());
|
|
|
+ vo.setEntryPath(vi.getEntryPath());
|
|
|
+ vo.setSourceText(vi.getSourceText());
|
|
|
vo.setSourceType(vi.getSourceType());
|
|
|
vo.setSourceName(vi.getSourceName());
|
|
|
vo.setSortOrder(vi.getSortOrder());
|