-
Bug
-
Resolution: Done
-
Critical
-
fuse-7.9-GA
I have an integration with DataMapper which maps one array to another. For filling target field ("surname") which missing in the source array, I wanted to use constant. So I create a constant and map it to that target field with "Repeat" transformation and without any Count.
However, when I run integration, I see following error in the activity log:
io.atlasmap.api.AtlasException: Errors: [Failed to apply field action: Error processing action Repeat: Document='null(ID:DOC.Constants.26216)', path='/testName'], at org.apache.camel.component.atlasmap.AtlasEndpoint.onExchange(AtlasEndpoint.java:239) at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71) ...
When I fill the count number, the error is gone. But, during the creating of mapping, I don't know how many objects will arrive from the source connection. I would expected that the count is not necessary in this case because the number of target objects is determined by the number of source objects in the array.
Is this a limitation of DataMapper (that the Count param need to be set when the source field is not a part of the array, or this affects only constant?) or a bug?
I would expected that when I am mapping only contant to a field of an array, the count must be set. But when another field from the source array is mapped to the target array, the count doesn't need to be set.
--------
The default postrgesql connection is used as a source (select * from todo)
AMQ step is used as a target with JSON instance
e.g.
{
"officeNumber": 1,
"arr": [
{
"name":"test1",
"surname":"surname1",
"addresses":[
{
"street":"street1"
},
{
"street":"street2"
}
]
}
]
}