SbloodyS commented on code in PR #17956:
URL: 
https://github.com/apache/dolphinscheduler/pull/17956#discussion_r2785375442


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/validator/workflow/TriggerWorkflowRequestTransformer.java:
##########
@@ -64,4 +76,30 @@ public TriggerWorkflowDTO transform(WorkflowTriggerRequest 
workflowTriggerReques
         triggerWorkflowDTO.setWorkflowDefinition(workflowDefinition);
         return triggerWorkflowDTO;
     }
+
+    private void validateStartParamList(List<Property> startParamList) {
+        if (startParamList == null || startParamList.isEmpty()) {
+            return;
+        }
+
+        Set<String> keys = new HashSet<>();
+        for (Property param : startParamList) {
+            // null key
+            if (StringUtils.isEmpty(param.getProp())) {
+                throw new ServiceException("Parameter key cannot be empty");
+            }
+
+            String key = param.getProp().trim();
+            // duplicate keys
+            if (keys.contains(key)) {
+                throw new ServiceException("Duplicate parameter key: " + key);
+            }
+            keys.add(key);
+
+            // IN-type params require a non-empty value
+            if (Direct.IN.equals(param.getDirect()) && 
StringUtils.isEmpty(param.getValue())) {
+                throw new ServiceException("IN parameter value cannot be empty 
for key: " + key);
+            }

Review Comment:
   ```suggestion
               if (StringUtils.isEmpty(param.getProp())) {
                   throw new ServiceException("Parameter key cannot be empty");
               }
   
               String key = param.getProp().trim();
               if (keys.contains(key)) {
                   throw new ServiceException("Duplicate parameter key: " + 
key);
               }
   
               if (Direct.IN.equals(param.getDirect()) && 
StringUtils.isEmpty(param.getValue())) {
                   throw new ServiceException("IN parameter value cannot be 
empty for key: " + key);
               }
               
               keys.add(key);
   ```



##########
dolphinscheduler-ui/src/views/projects/workflow/definition/components/start-modal.tsx:
##########
@@ -290,6 +290,13 @@ export default defineComponent({
       }
     )
 
+    const formModel = computed(() => ({
+      // UI configuration state from form management hook
+      ...startState.startForm,
+       // Business data injected from modal operations hook
+      startParamsList: variables.startParamsList

Review Comment:
   ```suggestion
         ...startState.startForm,
         startParamsList: variables.startParamsList
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to