You can do this, but you have to use the Execute Script service -- at
this time there isn't a deployable component for it.
Use this sort of script in the Execute Script service to read the PDF
blob from the database and populate a Document variable.
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.sql.ResultSet;
import javax.sql.DataSource;
import javax.naming.InitialContext;
int processId = patExecContext.getProcessDataIntValue("/process_data/
@id");
InitialContext context = new InitialContext();
Connection connection = ((DataSource)context.lookup("java:/
IDP_DS")).getConnection();
String queryQuery = "select bigdocument, bigstring from
tb_pt_workwithxlobs where
process_instance_id = ?";
PreparedStatement queryStatement = connection.prepareStatement
(queryQuery);
try {
queryStatement.setInt(1, processId);
ResultSet results = queryStatement.executeQuery();
results.next();
java.sql.Blob documentBlob = results.getBlob(1);
com.adobe.idp.Document document = new
com.adobe.idp.Document(documentBlob.getBinaryStream());
patExecContext.setProcessDataValue("/process_data/@NewBigDocument",
document);
java.sql.Clob stringClob = results.getClob(2);
patExecContext.setProcessDataValue("/process_data/@NewBigString",
stringClob.getSubString(1L,
(int)stringClob.length()));
} catch(Exception ex) {
ex.printStackTrace();
}
queryStatement.close();
connection.close();
JYates
Avoka Technologies