title: Nifi: how to handle file attributes in groovy
body: <p>I  have   to  write several  attribute  in case  certain conditions   will  be  fullfiled, but  if    only  'else'  clause should   be  fullfiled (  in case  count  and  fault  both are  null  )  i can't  make   options  write  in  else   block ,  what  hsould  i  change  ,  here is  my  code  </p>
  
  <pre><code>import org.apache.commons.io.IOUtils
  import java.nio.charset.StandardCharsets
  def flowFile=session.get();
  String attr=flowFile.getAttribute("count");
  String fault=flowFile.getAttribute("error");
  if(attr=="0"){
  flowFile=session.putAttribute(flowFile,"empty","empty");
  }
  else  if(fault!=" "){
  log.error(fault.toString());
  }
  else {
  flowFile=session.putAttribute(flowFile,"good","good");
  }
  session.transfer(flowFile,REL_SUCCESS);
  </code></pre>