Member since
08-18-2019
56
Posts
11
Kudos Received
18
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
641 | 11-15-2023 05:38 AM | |
2326 | 07-12-2023 05:38 AM | |
695 | 01-10-2023 01:50 AM | |
983 | 12-06-2022 12:08 AM | |
3813 | 12-02-2022 12:55 AM |
12-06-2022
04:10 AM
Thank you so much @Faerballert
... View more
12-06-2022
12:08 AM
Hello @Manimaran, to help you it would be good if you go a bit more specific into your question with some sample content and what you want to have as expected output. Greetings
... View more
11-28-2022
08:50 PM
Hi @Faerballert , Its working as expected. Thank you so much.
... View more
11-23-2022
02:51 AM
@Faerballert , It's working fine as expected. Thank you so much for the quick response.
... View more
11-09-2022
09:53 PM
@Faerballert , can you please reply if you have the solution for this or can you share the code to resize the attachment from the mailbox
... View more
11-08-2022
07:37 PM
Hi, Thank you for pointing that out. It has certaintly speed up my development. This is a short snippet to my solution: var StreamCallback = Java.type("org.apache.nifi.processor.io.StreamCallback");
var IOUtils = Java.type("org.apache.commons.io.IOUtils");
var StandardCharsets = Java.type("java.nio.charset.StandardCharsets");
var flowFile = session.get();
if(flowFile != null) {
try {
// Create a new StreamCallback, passing in a function to define the interface method
flowFile = session.write(flowFile,
new StreamCallback(function(inputStream, outputStream) {
var text = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
var obj = JSON.parse(text);
obj["gender"] = "Male";
outputStream.write(JSON.stringify(obj).getBytes(StandardCharsets.UTF_8));
}));
session.transfer(flowFile, REL_SUCCESS);
} catch (e) {
log.error(e.message)
session.transfer(flowFile, REL_FAILURE);
}
} Something to point out for those using javascript. If your using GenerateFlowFile processor to generate sample JSON content, the JSON content in Custom Text must use double quotes ( " ), not single quotes ( ' ). I spent an hour debugging why my JSON.parse(text) didn't work. Custom Text {'name':'myName'} It should be {"name":"myName"}
... View more
11-08-2022
11:43 AM
1 Kudo
@Bridewin I two things you may want to try.... 1. GetFile processor was deprecated in favor of the newer ListFile --> FetchFile processors. I'd recommend switching to these processors and see if you have the same observations. 2. I'd suggest enabling debug logging for the GetFile processor class to see what additional logging may show. To do this, you would modify the logback.xml file in NiFi's conf directory. Add the below line down in this file where you see similar lines already. <logger name="org.apache.nifi.processors.standard.GetFile" level="DEBUG"/> If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped. Thank you, Matt
... View more
11-03-2022
07:40 AM
Try that: [
{
"operation": "shift",
"spec": {
"*": {
"Ean": "[&1].gtin",
"ean": "[&1].gtin",
"EAN": "[&1].gtin",
"EanCode": "[&1].gtin",
"EAN-Code": "[&1].gtin",
"EANCode": "[&1].gtin",
"Ausdr1": "[&1].gtin",
"Bestand": "[&1].qty",
"Menge": "[&1].qty",
"Stock": "[&1].qty",
"stock": "[&1].qty",
"Verfügbare Menge (Kennzahl)": "[&1].qty",
"Verfügbare Menge": "[&1].qty"
}
}
}, {
"operation": "modify-default-beta",
"spec": {
"*": {
"update_date": "2022-11-03",
"supplier_name": "demo",
"file_name": "test"
}
}
}
] Greetings
... View more
11-02-2022
05:37 AM
1 Kudo
Agreed, you do not have access to the fields in either the incoming or outgoing JSON objects using Expression Language in the spec.
... View more
10-26-2022
08:13 AM
Hello, can you try it with: [
{
"operation": "shift",
"spec": {
"orderItems": {
"*": {
"id": "orderItems[&1].text01",
"typeId": "orderItems[&1].text02",
"itemVariationId": "orderItems[&1].text03",
"quantity": "orderItems[&1].text04",
"attributeValues": "orderItems[&1].text05",
"vatField": "orderItems[&1].text06",
"amounts": "orderItems[&1].amounts"
}
},
"*": "&"
}
}
] Let me know if there needs something to change. Greetings
... View more