Thank you for your advice! <img class='smiley' src='http://www.nabble.com/images/smiley/anim_handshake.gif' /> I have done it, but I think not correct...
import org.apache.commons.io.*;
...
String         fileName          = "firstGuidedRule.brl";
File         file                  = new File(fileName);
String         fileAsString = FileUtils.readFileToString(file);
BRXMLPersistence read = (BRXMLPersistence) BRXMLPersistence.getInstance();
BRDRLPersistence write = (BRDRLPersistence) BRDRLPersistence.getInstance();
        
String outputDRL = write.marshal(read.unmarshal(fileAsString));
How can I pass it now to PackageBuilder?
(I am sorry for such simple questions..)
<blockquote class="quote light-black dark-border-color"><div class="quote light-border-color">
<div class="quote-author" style="font-weight: bold;">Geoffrey De Smet wrote:</div>
<div class="quote-message">
common-io's FileUtils is great for doing that:
http://commons.apache.org/io/api-release/org/apache/commons/io/FileUtils.html#readFileToString(java.io.File)
With kind regards,
Geoffrey De Smet
Michael schreef:
> I have found this:
>
> ....you can use the following snippet of code to convert the brl to a
> drl rule:
>
> BRXMLPersitence read = BRXMLPersitence.getInstance();
> BRDRLPersistence write = BRDRLPersistence.getInstance();
> String brl = ... read from the .brl file as needed...
> String outputDRL = write.marshall(read.unmarshal(brl));
> //then pass the outputDRL to the PackageBuilder as normal
>
> Can you explain please: "String brl = ... read from the .brl file as
> needed..."
> for example if I have "first.brl" and I want "first.drl"
>
> Thank you...
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-dev mailing list
> rules-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
</div>
</div></blockquote>
<br><hr align="left" width="300">
View this message in context: <a href="http://www.nabble.com/Convert-.brl-to-.drl-tp16188000p16198838.html">Re: Convert .brl to .drl</a><br>
Sent from the <a href="http://www.nabble.com/drools---dev-f11824.html">drools - dev mailing list archive</a> at Nabble.com.<br>