【问题标题】:Groovy transformer was like ignoredGroovy 变压器就像被忽略了
【发布时间】:2016-12-01 16:27:29
【问题描述】:

同学们,大家好。 在我的项目中,我遇到了一些问题。 在其中一个流程中,我做了两个 http_requests,然后用 groovy 转换器解析了这些响应。

第一个 groovy 脚本:

第二个 groovy 脚本:

第一个 groovy 脚本运行良好。但是第二个脚本什么也不做。就像它被忽略了一样。

两个 http_responses 的结构是相似的。

为什么可以忽略第二个 groovy 脚本?

【问题讨论】:

  • 您的循环只运行一次。这是设计使然吗?
  • 是的。在 http_request hashmap 有集合之后,我只需要收到一个项目。
  • 您能发布您的 http 请求的示例结果吗?
  • 数组“结果”开始:gyazo.com/b7d007187d7985bb1a4635c158769dc3 数组“结果”结束:gyazo.com/be65d348f2a82936d256fc9d4720e8c5
  • {"NextPageExists":true,"Result":[{"SharedUsersExists":true,"Id":"c5cfce5c-7bc9-e511-80bd-e0cb4ef9c44d","Name":"! 文件夹WATER )"},{"SharedUsersExists":true,"Id":"bea6a1c1-72d4-e511-80be-e0cb4ef9c44d","Name":"! for type"},{"SharedUsersExists":true,"Id": "0318d19e-4647-e611-80c0-e0cb4ef9c44d","名称":"!kosmos"},{"SharedUsersExists":true,"Id":"58c​​0a03c-dd18-e611-80bf-e0cb4ef9c44d","名称":" !!!000newFolder"}],"Page":1,"PageSize":20,"Count":20,"Error":"","IsSuccess":true,"Errors":[],"ValidationErrors": [],"ValidationWarnings":[]}

标签: json groovy hashmap mule


【解决方案1】:

天哪!( 非常抱歉,这是我非常愚蠢的错误。 原因是 - 'break' 必须在 IF 范围内...... 在第一个 http_response 中寻求的值是集合中的第一项,这就是它起作用的原因。

附言惭愧……

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-25
    • 2021-10-28
    • 2016-09-30
    • 2020-07-07
    • 2020-04-18
    • 2012-03-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多