[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1028) importing .brxml into the application
Michael Neale (JIRA)
jira-events at lists.jboss.org
Tue Aug 21 21:53:34 EDT 2007
[ http://jira.jboss.com/jira/browse/JBRULES-1028?page=comments#action_12373246 ]
Michael Neale commented on JBRULES-1028:
----------------------------------------
For some more details on how to do this:
BRXMLPersistence.getInstance().unmarshal -- this gives a RuleModel from the XML
BRDRLPersistence.getinstance.marshal - this takes the RuleModel and dumps out the DRL
The name in the RuleModel SHOULD be the same as the file that it came from. If its not, it would be best to set it to the same as the file (minus the extension).
The DRL can then be added to the PackageBuilder - of course this will also need the imports added beforehand etc (and the package name).
In the BRMS this is all done with ContentpackageAssembler. In the IDE, the Guided editor will create some .package file that contains the imports etc... thats how the editor knows what to work with.
This code will need to cater for that. So we can either make people use package builder plus the above, OR we can enhance package builder, OR we create an ant task to automate it all.
If we have an ant task, it needs to cater for ALL asset types (like the BRMS does) - that includes decision tables, .dslr rules (loading up the dsl files) and ruleflows, adding it all to a package. Thus the ant task can be pointed at a folder and it will do the rest (of course it needs a classpath).
> importing .brxml into the application
> -------------------------------------
>
> Key: JBRULES-1028
> URL: http://jira.jboss.com/jira/browse/JBRULES-1028
> Project: JBoss Rules
> Issue Type: Task
> Security Level: Public(Everyone can see)
> Components: Eclipse IDE
> Affects Versions: 4.0.0.GA
> Environment: windows Xp Proffessional, Java/Eclipse IDE
> Reporter: sreeni sabapathy
> Assigned To: Fernando Meyer
> Fix For: 4.0.1
>
> Original Estimate: 3 days
> Remaining Estimate: 3 days
>
> The new feature in Jboss rule 4.0, the " New guided drl editor".
> This feature which works similar to the drools-jbrms in the Eclipse plugin.
> I am able to create the necessatry rules, but as the edited rules exist in "rule.brxml" and in "rule.package".
> How to Import this ".brxml" and ".package" into the package builder in order to get the package into the Rulebase and get working?
> I tried using the XmlPackageReader.read(reader) and then tried to build through the PackageBuilder . In other case also used the adddrlfomxml().
> It failed in both the case stating it as the
> "<rule> has an invalid parent element [null]
> at org.drools.xml.XmlPackageReader.validate(XmlPackageReader.java:486)
> at org.drools.xml.XmlPackageReader.startElement(XmlPackageReader.java:394)
> at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
> at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
> at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.drools.xml.XmlPackageReader.read(XmlPackageReader.java:321)
> at org.drools.xml.XmlPackageReader.read(XmlPackageReader.java:247)
> at com.sample.DroolsTest.readRule(DroolsTest.java:60)
> at com.sample.DroolsTest.main(DroolsTest.java:23)
> "
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list