title: Pass TupleTag to DoFn method
body: <p>I am trying to have two outputs from a DoFn method, following example of <a href="https://beam.apache.org/documentation/programming-guide/#additional-outputs" rel="nofollow noreferrer">Apache Beam programming guide</a></p>
  
  <p>Basically in the example you pass a TupleTag and then specify to where make the output, this works for me the problem is that I call an external method inside the ParDo, and don't know how to pass this TupleTag, this is my code:</p>
  
  <pre><code>PCollectionTuple processedData = pubEv
    .apply("Processing", ParDo.of(new HandleEv())
        .withOutputTags(mainData, TupleTagList.of(failedData)));
  </code></pre>
  
  <p>HandleEv method:</p>
  
  <pre><code>static class HandleEv extends DoFn&lt;String, String&gt; {
      @ProcessElement
      public void processElement(ProcessContext c) throws Exception {
        c.output("test")
        c.output(failedData,"failed")
      }
  }
  </code></pre>
  
  <p>The error I get is that <code>cannot find symbol</code> as failedData is not accesible from HandleEv, I tried to declare failedData at beginning of class but doesn't work neither.</p>
  
  <p>Thank you very much</p>