I have generated flowfile with attribute date and then I want to make some changes on my date:
import java.nio.charset.StandardCharsets
import org.apache.commons.io.IOUtils
import org.apache.nifi.processor.io.StreamCallback
def flowfile = session.get()
def date=flowfile.getAttribute('date')
def yourDate= new GregorianCalendar(date)
def newdate= yourDate.getTimeInMillis()+621355968000000000
if(!flowfile) return
flowfile = session.putAttribute(flowfile, '12321312'+'_'+newdate)
session.transfer(flowfile, REL_SUCCESS)
but executescript posecor gives me exception:Cannot invoke getAtribute on null object , what should i do?
dateattribute? what means this magic number -621355968000000000(19M years)? in your code you have to putif(!flowfile) returnjust after the line withsession.get()- daggett