I am creating a josn using the json Templater. In my setting i have a subtemplate that must to be an "object" and contain a lot off nested attributes that are "list".
In the situation where only 1 attribute is populated, the final result is good (Topology1record.jpg screenshot) but when I have more attributes populated the result is an array and not an object (Topology2records.jpg screenshot). I also attached the templater to show what I did.
probably I resolved. The solution is to aggregate all record and attributes under the "topologycharactheristic" session. After that I used a Json templater and a json formatter to create the json as an object. at the end, i can connect these steps to the main Json templater to create the full json. My problem, now, is that using the aggregator the templater is not able to convert the string values in boolean or float in case are number and I have this message: JSONTemplater_5 (XMLTemplaterFactory): "xs:string": invalid value for cast/constructor: can not cast to "xs:float"
If I use the same json templater setting without the aggregator it works!
When I will resolve this error, I will post the right workflow.
In the dataset you sent, the attributes required for the subtemplate is on separate features with the same id. As you have found, using an Aggregator is a one way to create one feature with the required attributes.
It is possible that the invalid value for cast/constructor error is related to null values in the attributes. If you use a NullAttributeMapper to map these values to <missing>, the error should be resolved.
I have attached an example of this workflow to this email and I hope it helps.
I tried to reproduce the issue using some dummy features but was unable to. Note that I did remove all sub templates except for TOPOLOGYCHARACTERISTIC and INTERSECTIONCATEGORY in the JSONTemplater. This produced the result as shown in Topology1record.jpg, which should be the result you require.
Are you able to share a small sample of your input data?
I tried to reproduce the issue using some dummy features but was unable to. Note that I did remove all sub templates except for TOPOLOGYCHARACTERISTIC and INTERSECTIONCATEGORY in the JSONTemplater. This produced the result as shown in Topology1record.jpg, which should be the result you require.
Are you able to share a small sample of your input data?
probably I resolved. The solution is to aggregate all record and attributes under the "topologycharactheristic" session. After that I used a Json templater and a json formatter to create the json as an object. at the end, i can connect these steps to the main Json templater to create the full json. My problem, now, is that using the aggregator the templater is not able to convert the string values in boolean or float in case are number and I have this message: JSONTemplater_5 (XMLTemplaterFactory): "xs:string": invalid value for cast/constructor: can not cast to "xs:float"
If I use the same json templater setting without the aggregator it works!
When I will resolve this error, I will post the right workflow.
probably I resolved. The solution is to aggregate all record and attributes under the "topologycharactheristic" session. After that I used a Json templater and a json formatter to create the json as an object. at the end, i can connect these steps to the main Json templater to create the full json. My problem, now, is that using the aggregator the templater is not able to convert the string values in boolean or float in case are number and I have this message: JSONTemplater_5 (XMLTemplaterFactory): "xs:string": invalid value for cast/constructor: can not cast to "xs:float"
If I use the same json templater setting without the aggregator it works!
When I will resolve this error, I will post the right workflow.
In the dataset you sent, the attributes required for the subtemplate is on separate features with the same id. As you have found, using an Aggregator is a one way to create one feature with the required attributes.
It is possible that the invalid value for cast/constructor error is related to null values in the attributes. If you use a NullAttributeMapper to map these values to <missing>, the error should be resolved.
I have attached an example of this workflow to this email and I hope it helps.
probably I resolved. The solution is to aggregate all record and attributes under the "topologycharactheristic" session. After that I used a Json templater and a json formatter to create the json as an object. at the end, i can connect these steps to the main Json templater to create the full json. My problem, now, is that using the aggregator the templater is not able to convert the string values in boolean or float in case are number and I have this message: JSONTemplater_5 (XMLTemplaterFactory): "xs:string": invalid value for cast/constructor: can not cast to "xs:float"
If I use the same json templater setting without the aggregator it works!
When I will resolve this error, I will post the right workflow.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.