<?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: Transfer relationship not specified and failed to create session in nifi in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180939#M75330</link>
    <description>&lt;P&gt;I think I have not used Failure Relationship, that's why is showing Error. Because when I create another processor and take only SUCCESS now it is solved.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 14:16:20 GMT</pubDate>
    <dc:creator>shreyanshu_pare</dc:creator>
    <dc:date>2018-03-06T14:16:20Z</dc:date>
    <item>
      <title>Transfer relationship not specified and failed to create session in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180936#M75327</link>
      <description>&lt;PRE&gt;
	@Tags({"json mapping with entitymaker"})
@CapabilityDescription("Provide a description")
public class MyProcessor extends AbstractProcessor {
    public static final Relationship SUCCESS = new Relationship.Builder()
            .name("SUCCESS")
            .description("Successfully converted incoming json file to EntitymakerJSON")
            .build();
    public static final Relationship FALIURE = new Relationship.Builder()
            .name("FALIURE")
            .description("Successfully converted incoming json file to EntitymakerJSON")
            .build();
    private Set&amp;lt;Relationship&amp;gt; relationships;
    @Override
    protected void init(final ProcessorInitializationContext context) {
        
    	final Set&amp;lt;Relationship&amp;gt; relationships = new HashSet&amp;lt;Relationship&amp;gt;();
        relationships.add(SUCCESS);
        relationships.add(FALIURE);
        this.relationships = Collections.unmodifiableSet(relationships);
    }
    @Override
    public Set&amp;lt;Relationship&amp;gt; getRelationships() {
        return relationships;
    }
    
   /* public final List&amp;lt;PropertyDescriptor&amp;gt; getSupportedPropertyDescriptors() {
		return null ;
     
    }
    @OnScheduled
    public void onScheduled(final ProcessContext context) {
    }*/
	@Override
    public void onTrigger(final ProcessContext context, final ProcessSession session) 
    		throws ProcessException,FlowFileHandlingException {
       
        final AtomicReference&amp;lt;String&amp;gt; value = new AtomicReference&amp;lt;&amp;gt;();
        FlowFile flowFile = session.get();
        
        if ( flowFile == null ) {
            return;
        }
        session.read(flowFile, new InputStreamCallback() {
            @Override
            public void process(InputStream in) throws IOException {
                try{
                	JSONParser parser = new JSONParser();
                    JSONArray inputdata;
                    
                    String json = IOUtils.toString(in);
                    inputdata = (JSONArray) parser.parse(json);
                
                    Jsonmapping jsm = new Jsonmapping();
        	        for (Object o : inputdata) 
        			{
        	        	JSONObject person = (JSONObject) o;
        	            JSONObject jo = jsm.finaljson(person);
        	            value.set(jo.toString());
        			} 
                }catch(Exception ex){
                    ex.printStackTrace();
                    getLogger().error("Failed to read json string.");
                }
            }
        });
        flowFile = session.write(flowFile, new OutputStreamCallback() {
            @Override
            public void process(OutputStream out) throws IOException {
            	out.write(value.get().getBytes());
            }
        });
        session.transfer(flowFile, SUCCESS);
        
        
    }
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Mar 2018 17:56:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180936#M75327</guid>
      <dc:creator>shreyanshu_pare</dc:creator>
      <dc:date>2018-03-05T17:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer relationship not specified and failed to create session in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180937#M75328</link>
      <description>&lt;P&gt;Please format the code so that it is readable.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 22:30:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180937#M75328</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2018-03-05T22:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer relationship not specified and failed to create session in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180938#M75329</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/363/bbende.html" nodeid="363"&gt;@Bryan Bende&lt;/A&gt;, I have formatted the code please check.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 12:45:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180938#M75329</guid>
      <dc:creator>shreyanshu_pare</dc:creator>
      <dc:date>2018-03-06T12:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer relationship not specified and failed to create session in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180939#M75330</link>
      <description>&lt;P&gt;I think I have not used Failure Relationship, that's why is showing Error. Because when I create another processor and take only SUCCESS now it is solved.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 14:16:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180939#M75330</guid>
      <dc:creator>shreyanshu_pare</dc:creator>
      <dc:date>2018-03-06T14:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer relationship not specified and failed to create session in nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180940#M75331</link>
      <description>&lt;P&gt;It's because you have a typo in your code: .name("FALIURE")&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 05:09:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Transfer-relationship-not-specified-and-failed-to-create/m-p/180940#M75331</guid>
      <dc:creator>asabatino</dc:creator>
      <dc:date>2019-06-24T05:09:12Z</dc:date>
    </item>
  </channel>
</rss>

