String to PMMLCell


I would like to transform a pmml model retrieved as text from a database, to a PMMLCell. In principle I have prepared a Database Reader + JSnippet with the following code (dirty - no definitive):


DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder builder = factory.newDocumentBuilder();
out_pmml = builder.parse(new ByteArrayInputStream(c_pmml.getBytes()));
} catch (Exception e) {}

c_pmml is the output of the Database Reader (String)

out_pmml is a XML Cell type with the pmml model.


In this point I would like to attach the output of the Java Snippet to a node "Cell to PMML", but the following error is raised: No column spec compatible to "PMMLValue".

What am I doing wrong ? How can I get a PMML Cell from a String Cell ?

Thanks in advance.




"Cell to PMML" is not designed to cover this case. This is the bad news, the good news is that you can solve your problems with three simple nodes.

  1. A "String To XML" to create XML
  2. A "XML Writer" which creates a temporary file
  3. A PMML Reader to read the temporary file

I have attached a workflow with an example.

Thanks Hofer, your solution works fine.