[rules-users] Inserting Facts from Json Format

ihabo01 ihabo01 at gmail.com
Mon Dec 12 08:04:53 EST 2011


Many thanks mark,

Actually in one of the emails in this thread I have mentioned that I have
found the BatchExecutionHelper but all my attempts to use it failed. If you
can point me to an example, I would appreciate it as I have looked all
around but to no avail (this part of drools does not seem that popular)

To be more specific, I have tried to do something such as:

Object insertCMD =
BatchExecutionHelper.newJSonMarshaller().fromXML(fileToString("batchCommands/batchCommandInsert.json"));

Where my Jason file contains something like:

{"batch-execution":{"lookup":"ksession1","commands":[{"insert":{"object":{"decision1.FlatData":{"name":"john","relatipshipType":"parent"}}}},{"fire-all-rules":""}]}}

Problem is how can the BatchExecutionHelper get the definition of my object?
(object definition is declared in the DRL file itself)

When you look at JAXB integration, this is achieved like this:

JAXBContext jaxbContext =
KnowledgeBuilderHelper.newJAXBContext(classesName.toArray(new
String[classesName.size()]), kbase);

But I don't see how this can be done with JSON.

Any indications will be much appreciated.

Best regards,

Ihab


--
View this message in context: http://drools.46999.n3.nabble.com/Inserting-Facts-from-Json-Format-tp3570810p3579358.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list