Skip to content

Commit

Permalink
Ensure minimal configuration is present to avoid "unexpected global
Browse files Browse the repository at this point in the history
error" when verifying new patterns added in the Guided Rule Editor.
  • Loading branch information
manstis committed Mar 28, 2012
1 parent 93083e0 commit 1839b69
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2010 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.drools.verifier;

import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;

public class EmptyVerifierConfiguration extends VerifierConfigurationImpl {

public EmptyVerifierConfiguration() {
//Ensure mandatory bootstrap items have been setup
verifyingResources.put( ResourceFactory.newClassPathResource( "bootstrap-essentials.drl",
getClass() ),
ResourceType.DRL );
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2012 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.drools.verifier

//list any import classes here.
import org.drools.verifier.data.VerifierReport;

//declare any global variables here
global VerifierReport result;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd' >
<add>
<resource source='classpath:org/drools/verifier/bootstrap-essentials.drl'
type='DRL' />
<resource source='classpath:org/drools/verifier/Consequence.drl'
type='DRL' />
<!-- Always false -->
Expand Down

0 comments on commit 1839b69

Please sign in to comment.