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 :
- in Connector defination : no input , no output
- 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();
}
}