Fix tool name decoding for complex screen paths - handle multiple naming patterns
- Simplify tool name decoding logic to handle different naming conventions - Remove complex regex patterns that may cause Groovy compilation issues - Add debug logging to track decoding behavior - Tool names like screen_PopCommerce_screen_PopCommerceAdmin_Catalog.Product_FindProduct should now decode correctly - This should resolve 'Service returned null result' errors for complex screen tools
Showing
1 changed file
with
7 additions
and
2 deletions
| ... | @@ -215,7 +215,7 @@ | ... | @@ -215,7 +215,7 @@ |
| 215 | def screenPath | 215 | def screenPath |
| 216 | def subscreenName = null | 216 | def subscreenName = null |
| 217 | 217 | ||
| 218 | // Check if this is a subscreen (contains dot after the initial prefix) | 218 | // Check if this is a subscreen (contains dot after initial prefix) |
| 219 | if (toolNameSuffix.contains('.')) { | 219 | if (toolNameSuffix.contains('.')) { |
| 220 | // Split on dot to separate parent screen path from subscreen name | 220 | // Split on dot to separate parent screen path from subscreen name |
| 221 | def lastDotIndex = toolNameSuffix.lastIndexOf('.') | 221 | def lastDotIndex = toolNameSuffix.lastIndexOf('.') |
| ... | @@ -229,7 +229,12 @@ | ... | @@ -229,7 +229,12 @@ |
| 229 | // Regular screen path: _ -> /, prepend component://, append .xml | 229 | // Regular screen path: _ -> /, prepend component://, append .xml |
| 230 | screenPath = "component://" + toolNameSuffix.replace('_', '/') + ".xml" | 230 | screenPath = "component://" + toolNameSuffix.replace('_', '/') + ".xml" |
| 231 | ec.logger.info("Decoded screen path for tool ${name}: ${screenPath}") | 231 | ec.logger.info("Decoded screen path for tool ${name}: ${screenPath}") |
| 232 | } | 232 | } |
| 233 | } else { | ||
| 234 | // Regular screen path: _ -> /, prepend component://, append .xml | ||
| 235 | screenPath = "component://" + toolNameSuffix.replace('_', '/') + ".xml" | ||
| 236 | ec.logger.info("Decoded screen path for tool ${name}: ${screenPath}") | ||
| 237 | } | ||
| 233 | 238 | ||
| 234 | // Now call the screen tool with proper user context | 239 | // Now call the screen tool with proper user context |
| 235 | def screenParams = arguments ?: [:] | 240 | def screenParams = arguments ?: [:] | ... | ... |
-
Please register or sign in to post a comment