<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: javax.script.ScriptException: NameError: name 's' is not defined in in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/javax-script-ScriptException-NameError-name-s-is-not-defined/m-p/226769#M188629</link>
    <description>&lt;P&gt;So along the flow I have an attribute, which is called asin (aka product ID). The flow should fail when an ID already exists in a local csv file. With your help I changed my code to&lt;/P&gt;&lt;PRE&gt;#!/usr/bin/python
import os
import java.io

flowFile = session.get()
productFound = False

if (flowFile != None):
    if os.path.exists('/home/nifi/products.csv'):
        asin = flowFile.getAttribute('asin')
        with open('/home/nifi/products.csv') as csv:
            if asin in csv.read():
                productFound = True
    if productFound:
        session.transfer(flowFile, REL_FAILURE)
    else:
        session.transfer(flowFile, REL_SUCCESS)
&lt;/PRE&gt;&lt;P&gt;I falsely assumed that I could call REL_FAILURE/SUCCESS multiple times.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Nov 2018 15:23:41 GMT</pubDate>
    <dc:creator>artworkad</dc:creator>
    <dc:date>2018-11-06T15:23:41Z</dc:date>
  </channel>
</rss>

