Member since
04-23-2018
4
Posts
0
Kudos Received
0
Solutions
04-30-2018
10:12 PM
Jolt Transformation did it for me, I didn't know how to use it and what it's meant to do, my document had more objects that I masked for public use, edited your transformation and things turned out pretty well. What's the use of & in Jolt syntax? I noticed that it could bring up an object to a higher level based on the number you insert, is there a good reference or examples on the transformations?
... View more
04-30-2018
06:36 PM
Thanks, that was fast, yes, the arrays are parallel. Will check this out and let you know
... View more
04-30-2018
05:54 PM
@Matt Burgess I am new here and not sure what's the best way to get a response, saw you're answering many questions, thought you might be able to help
... View more
04-23-2018
11:54 PM
I have a json object in the following format {
"Objects": [
{
"Item": {
"LastUpdateTime": "2018-03-23T02:36:09.000Z",
"Identification": {
"id": "123"
},
"Inventory": {
"Elements": {
"Element": [
{
"Height": 10,
"Weight": 56,
"Features": {
"Feature": {
"FeatureId": "456",
"Color": "white"
}
}
},
{
"Height": 14,
"Weight": 46,
"Features": {
"Feature": {
"FeatureId": "789",
"Color": "orange"
}
}
},
{
"Height": 40,
"Weight": 68,
"Features": {
"Feature": {
"FeatureId": "343",
"Color": "yellow"
}
}
}
]
}
},
"Status": {
"Id": "123",
"ElementsStatus": {
"ElementStatus": [
{
"FeatureId": "456",
"Status": "In-Stock"
},
{
"FeatureId": "789",
"Status": "Out Of Stock"
},
{
"FeatureId": "343",
"Status": "Out Of Stock"
}
]
}
}
}
}
]
}
, would like to create another object out of it in the current format [{'Id': 123,
'FeatureId': '456',
'Color': 'White',
'Height': 10,
'Weight': 56,
'Status': 'In-Stock'},
{'Id': 123,
'FeatureId': '789',
'Color': 'orange',
'Height': 14,
'Weight': 46,
'Status': 'Out Of Stock'},
{'Id': 123,
'FeatureId': '343',
'Color': 'yellow',
'Height': 40,
'Weight': 68,
'Status': 'Out Of Stock'}]
The "Objects" object is an array of multiple items and their statuses, each item in the Inventory>Elements>Element should have an entry in Status>ElementsStatus>ElementStatus with the same "FeatureId" My current process includes a SplitJson processor that splits each element in the "Objects" Array into a flowfile, then I have two EvaluateJsonPath processors to extract $.Objects.Item.Inventory.Elements.Element and $.Objects.Status.ElementsStatus.ElementStatus from each flow file. In the case above, each EvaluateJsonPath will output 3 flowfiles The Challenge is to piece that data back together and output a similar format to what I showed above. Any ideas?
... View more
Labels:
- Labels:
-
Apache NiFi