“JSON来自Oracle查询”的答案 https://knowledge.亚搏在线safe.com/questions/82580/json-from-oracle-query.html 关于“来自Oracle查询的JSON”问题的最新答案 答案由bcrowley10 https://knowledge.亚搏在线safe.com/answers/82612/view.html

谢谢@takashi -这工作得很完美。采样变压器不是我所能想到的东西 2018年11月15日星期四11:52:58 GMT bcrowley10 答案由隆 https://knowledge.亚搏在线safe.com/answers/82591/view.html < div class = " fr-view clearfix " > < p >如果所有的属性除了地址有相同的值在所有行这样的简化示例中,< / p > <表风格=“宽度:100% > < tbody > < tr > < td风格=“宽度:23.0357% > projectId < / td > < td风格=“宽度:23.0357% > projectName < / td > < td风格=“宽度:23.0357% >街< / td > < td风格=“宽度:30.8929% > cagisid < / td > < / tr > < tr > < td风格=“宽度:23.0357% > 100 < / td > < td风格=“宽度:23.0357% > ProjectA < / td > < td风格=“宽度:23.0357% > foo < / td > < td风格= "宽度:30.8929% " > 1 < / td > < / tr > < tr > < td风格=“宽度:23.0357% > 100 < / td > < td风格=“宽度:23.0357% > ProjectA < / td > < td风格=“宽度:23.0357% >栏< / td > < td风格=“宽度:30.8929% > 2 < / td > < / tr > < tr > < td风格=“宽度:23.0357% > 100 < / td > < td风格=“宽度:23.0357% > ProjectA < / td > < td风格=“宽度:23.0357% > foobar < / td > < td风格=“宽度:30.8929% > 3 < / td > < / tr > < / tbody > < /表> < p >一个可能的方法是选择和发送一行到根端口和发送所有行JSONTempleter子端口,然后将子表达式生成的JSON对象聚合为根表达式中的JSON数组。< / p > < p >根表达式:< / p > < pre > {“projectId"fme: get-attribute (“projectId"),“projectName"fme: get-attribute (“projectName"),“propertyAddresses": [fme:process-features(& " sub&")]}

< / p > < p >结果:< / p > < pre > {“projectId":“100“,“projectName":“ProjectA",“propertyAddresses" : [ { "street" : "foo", "cagisid" : "1" }, { "street" : "bar", "cagisid" : "2" }, { "street" : "foobar", "cagisid" : "3" } ] }

If there were two or more projects in the source dataset, set project ID attribute to both the Group By parameter in the Sampler and the Group Sub-Features By parameter in the JSONTemplater.

Hope this helps.

2018年11月14日星期三21:59:40 GMT