Member since
09-27-2018
138
Posts
23
Kudos Received
10
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
9457 | 02-28-2021 10:23 PM | |
1892 | 02-08-2021 11:53 PM | |
31187 | 12-16-2020 11:31 PM | |
7445 | 12-14-2020 11:02 PM | |
4753 | 12-14-2020 12:18 AM |
01-29-2020
12:53 AM
@janapati10 Oh, too bad, this options for manipulating JSON with Expression Language are - as far as I know - not available before 1.10.0. When the JSON-format is really stabil maybe this will work for you. UpdateAttribute ==> ${FF_CONTENT:substringBefore('['):append('["'):append(${callid}):append('"]'):append(${FF_CONTENT:substringAfter(']')})} It is not "elegant" but I haven't got another idea, sorry.
... View more
01-29-2020
12:01 AM
NiFi 2.11 ? I must have missed something... Let's assume it is 1.11.0 then the used function should be available. I think there is a typo in your Expression Language. ${FF_CONTENT:jsonPathAdd('$.linkedData', ${callid})} There has to be a dot between $ and linkedData.
... View more
01-28-2020
11:11 AM
Maybe you want to try this way. Worked on 1.10.0
... View more
01-28-2020
03:52 AM
@janapati10 For me your question is to abstract, sorry. Could you show some of your data? Are we talking about JSON-array? If so and you are already using NiFi 1.10.0 there are some new options in expression language to manipulate JSON.
... View more
01-28-2020
02:49 AM
1 Kudo
@mburgess Matt, thank you so much for your quick response and help. It took me some time to figure out what you meant... but it works like a charm! If anyone can use the solution, here it is: //======================================================================================================
// TEST java LocalDate.parse with groovy max-function
// FF-Attribute RESPONSE contains [{"id":"(1208)", "datbis":"20180219" }, { "id":"(1210)", "datbis":"20191231" }, { "id":"(1212)", "datbis":"20200128" }]
// FF-Atribute MAX_datbis returns 20200128
//======================================================================================================
import java.time.LocalDate
def flowFile = session.get()
if(!flowFile) return
try {
def objList = new groovy.json.JsonSlurper().parseText(flowFile.getAttribute('RESPONSE'))
def max = objList.max {LocalDate.parse(it.datbis,"yyyyMMdd")}
flowFile = session.putAttribute(flowFile, 'MAX_datbis', max.datbis.toString())
session.transfer(flowFile, REL_SUCCESS)
} catch(e) {
log.error("Error while determining max", e)
session.transfer(flowFile, REL_FAILURE)
}
... View more
01-27-2020
06:29 AM
@mburgess Hi Matt, your help is needed urgently. The script that reads a JSON structure from an attribute and determines the maximum value of the date worked fine. I haven't worked on the flow for a while and now it doesn't work anymore. In the meantime there was only an update from 1.9.2 to 1.10.0. Otherwise everything is as before. Since I still have no idea about Groovy, I can't fix the error. Please, could you help me again? Thanks. This is content of attribute RESPONSE [ {"id":"(1208)", "datbis":"20190630" }, { "id":"(1210)", "datbis":"20191231" } ] ERROR ExecuteScript[id=e70ffcf5-016f-1000-0000-000063865879]
Error while determining max: groovy.lang.MissingMethodException: No signature of method: static java.util.Date.parse() is applicable for argument types: (String, String) values: [yyyyMMdd, 20190630]
Possible solutions: parse(java.lang.String), wait(), clone(), any(), grep(), use(java.lang.Class, groovy.lang.Closure)
... View more
01-20-2020
01:17 AM
@MattWho Thanks for this information. I haven't yet updated the registry because I can't do this myself. As soon as the update will be made sometime I will have a look on this an give you a reply.
... View more
01-11-2020
10:06 AM
@MattWho refering to nifi-registry-bootstrap.log we use v0.3.0 But I'm pretty sure that I didn't watch this behaviour before using NiFi 1.10.0 (former version 1.9.2). Can you confirm this connection with the NiFi version? Thanks!
... View more
01-09-2020
11:09 PM
Hi all,
there are process groups in my NiFi (1.10.0) which contain disabled processors. These process groups are versioned and all changes are committed.
As soon as the NiFi instance is restarted these process groups are marked as changed and "show local changes" here:
I would like to know if this behaviour of NiFi is "normal". So far I have not noticed this fact. It is misleading when uncommitted changes are shown and it is not possible to avoid that disabled processors are included.
Does anyone know the phenomenon described above? Is there a solution for it?
Thanks for any advice.
... View more
Labels:
- Labels:
-
Apache NiFi
01-08-2020
05:34 AM
@stevenmatison Thanks for this information. Haven't found a hint to this problem. 1.10 is not ready for “production”... In terms of parameter handling or what does this mean?
... View more