File Generator Connector

1
0
-1

hello , I create one custom connector for generate PDFs file after task completed . for initial test i dnt take any input for this when i execute process connector not executed pro pare it goes to failed stage . how can i recover and how can i show error .

Pl see following detail :

  1. in Connector defination : no input , no output
  2. Connector implementation : following code which just create simple pdf file .
/**
 *
 */

package org.mycompany.connector;

import org.bonitasoft.engine.connector.ConnectorException;
import com.itextpdf.text.Document;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
import java.io.FileOutputStream;


public class GeneratePDFImpl extends AbstractGeneratePDFImpl {
       
       
       
        Document document = new Document();

        @Override
        protected void executeBusinessLogic() throws ConnectorException{
                try{
            PdfWriter.getInstance(document, new FileOutputStream("ThisisTest.pdf"));
            document.add(new Paragraph("A Hello World PDF document."));
                }
                catch(Exception e)
                {
                        throw new ConnectorException(e);
                }
         }

        @Override
        public void connect() throws ConnectorException{
                document.open();
       
        }

        @Override
        public void disconnect() throws ConnectorException{
                document.close();
        }

}

Comments

Submitted by matthieu.chaffotte on Tue, 04/22/2014 - 11:31

Do you get a stacktrace in the engine logs?

Submitted by kppatel on Tue, 04/22/2014 - 11:35

I don't know how to get , severlogs .

1 answer

1
0
-1

Hi,

for error recovering of a connector execution, you need to use the Subscription version.

Are you sure that the "ThisisTest.pdf" file is the jar of the connector? Are yoiu sure that you can call .open() on a Document that created without parameter?

The logs are available in engine logs: Help--> SHow engine logs.

Regards,

Notifications