Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to access the updateattributes inside groovy script

avatar
Explorer


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!

1 ACCEPTED SOLUTION

avatar
Contributor

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.

View solution in original post

1 REPLY 1

avatar
Contributor

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.