Hi guys,

 

I am trying to create a very basic dsl which is giving me the following error stack:

 

The code to add the dsl is as follows:

 

InputStream ruleSource = RuleRunner.class.getClassLoader().getResourceAsStream("/Rule1.dslr");

InputStream dslSource = RuleRunner.class.getClassLoader().getResourceAsStream("/sample-dsl.dsl");

          

            //Load the rules , using DSL

            addRulesToThisPackage.addPackageFromDrl(

                        new InputStreamReader(ruleSource),

                        new InputStreamReader(dslSource));

 

I have both the sample-dsl .dsl and Rule1.dslr in my working directory.

 

Error encountered at adding the dsl to the package (last line)

 

Error stack:

Exception in thread "main" java.lang.NullPointerException

      at java.io.Reader.<init>(Unknown Source)

      at java.io.InputStreamReader.<init>(Unknown Source)

      at com.org.RuleRunner.loadRuleFile(RuleRunner.java:96)

      at com.org.RuleRunner.loadRules(RuleRunner.java:48)

      at com.org.RuleRunner.runStatelessRules(RuleRunner.java:109)

      at com.org.RulesTest.main(RulesTest.java:41)

 

my dsl file has basic mapping as per the online documentations.

 

The dsl rule I created is:

expander sample-dsl.dsl

 

rule "A status changes B status"

      when

            There is an A

-        has an address

There is a B

      - has name

      then

            - print updated A and Aaddress

End

 

 

I have created DSL in eclipse.

 

Is the code I added for it to be loaded to my package correct?? Or am I missing something????

 

 

Please help.

 

Thanks.

M

 




Please consider the environment before printing this email.

Visit our website at http://www.nyse.com
*****************************************************************************
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.