- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to access the updateattributes inside groovy script
- Labels:
-
Apache NiFi
Created ‎08-09-2020 11:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a custom variable in Updatedate processor( state = success), now i want to access those variable in my groovy script which is in invokescriptor processor.
def status= flowFile.getAttribute('status')
i tried below mentioned both syntax as well
Attemp1:
if( status.equals("success")){
//
}
Attemp 2:
if(status == "success"){
}
the above 2 attempts flowFile.getAttribute('status') returnning null value.
Please correct my mistake!
Created ‎08-20-2020 02:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to provide more information here...Is Updatedate processor an Updateattribute processor? What does invokescriptor processor do? Are you storing an attribute called state or are you using the processor's state?
Assuming its just a variable in flowfile, your attempt 2 should work.
Hope this helps. If the comment helps you to find a solution or move forward, please accept it as a solution for other community members.
Created ‎08-20-2020 02:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to provide more information here...Is Updatedate processor an Updateattribute processor? What does invokescriptor processor do? Are you storing an attribute called state or are you using the processor's state?
Assuming its just a variable in flowfile, your attempt 2 should work.
Hope this helps. If the comment helps you to find a solution or move forward, please accept it as a solution for other community members.
