title: How to put attributes of FlowFile into its JSON content?
body: <p>I use <code>ExecuteScript</code> processor and Python language to write a script.</p>
  
  <p>I want to pass two attributes (<code>eventid</code> and <code>reason</code>) of FlowFile into its JSON content as the parameter:value pair. The value of <code>eventid</code> is string, while the value of <code>reason</code> is integer. I tried to use <code>flowFile.getAttribute('eventid')</code>, but it fails.</p>
  
  <p>What is the correct way?</p>
  
  <pre><code>def process(self, inputStream, outputStream):
          text = IOUtils.toString(inputStream, StandardCharsets.UTF_8)
          obj = json.loads(text)
          dt = datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%f')
  
          newObj = {
              "EventId": str(parse(flowFile.getAttribute('eventid'))),
              "EventType": self.getEventType(dt,obj),
              "EventReason": flowFile.getAttribute('reason')
          }
          outputStream.write(bytearray(json.dumps(newObj, indent=4).encode('utf-8')))
  
  flowFile = session.get()
  if (flowFile != None):
      flowFile = session.write(flowFile, ModJSON())
  session.transfer(flowFile, REL_SUCCESS)
  session.commit()
  </code></pre>