[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2333) Support <scoreDsl> besides <scoreDrl> for XmlSolverConfigurer in LocalSearchSolverConfig to allow to use DSL's instead of DRL's for score rules

marco caminiti (JIRA) jira-events at lists.jboss.org
Tue Nov 24 09:00:31 EST 2009


    [ https://jira.jboss.org/jira/browse/JBRULES-2333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12496286#action_12496286 ] 

marco caminiti commented on JBRULES-2333:
-----------------------------------------

Hi Geoffrey,
my name is Marco Caminiti, you have right not is a good idea add the drl and dsl file with the same tag, but it was the easiest...
I
'he again modified the class LocalSearchSolverConfig (into the function buildRuleBase() ) to allow to accept the drl file directly by the WEB for example to accept the drl file produced by Guvnor at the URL "http://<your server>/drools-guvnor/org.drools.guvnor.Guvnor/package/<your package>/<your version>.drl"
regards,
Marco 

{code}
if(scoreDrlList!=null)
	for (String scoreDrl : scoreDrlList) {
       		InputStream scoreDrlIn =null;
       		if(scoreDrl.contains("http")){
       			try {
				URL drlUrl=new URL(scoreDrl);
					scoreDrlIn=drlUrl.openStream();
				} catch (MalformedURLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
       		}
       		else
       			scoreDrlIn = getClass().getResourceAsStream(scoreDrl);
       		if (scoreDrlIn == null) {
       			throw new IllegalArgumentException("scoreDrl (" + scoreDrl + ") does not exist as a classpath resource.");
       		}
       		try {
       			packageBuilder.addPackageFromDrl(new InputStreamReader(scoreDrlIn, "utf-8"));
       		} catch (DroolsParserException e) {
       			throw new IllegalArgumentException("scoreDrl (" + scoreDrl + ") could not be loaded.", e);
       		} catch (IOException e) {
       			throw new IllegalArgumentException("scoreDrl (" + scoreDrl + ") could not be loaded.", e);
       		} finally {
       			IOUtils.closeQuietly(scoreDrlIn);
       		}
       	}
{code}

> Support <scoreDsl> besides <scoreDrl> for XmlSolverConfigurer in LocalSearchSolverConfig to allow to use DSL's instead of DRL's for score rules
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-2333
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2333
>             Project: Drools
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: drools-solver
>    Affects Versions: 5.1.0.M1
>            Reporter: Geoffrey De Smet
>            Assignee: Geoffrey De Smet
>             Fix For: 5.1.0.M2
>
>
> shouldn't be to hard, simply adjust LocalSearchSolverConfig class as needed

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list