JBoss Community

jBPM Unit testing Guided Decision Table .gdst

created by Alistair Jarrett in jBPM - View the full discussion

Hi all,

 

I am trying to unit test a Guided Decision Table. I have plenty of unti tests successfully testing rules, human tasks etc.. however decision tables are causing me trouble. I have created my decision table using the guvnor interface and its stored in the repo. I then pull this file into JBDS and open the .gdst file which simply shows a structured XML file (beginning with <decision-table52>?) , which I guessed was a xml drl format and would be parsed into drl at runtime. However I am having trouble defining the resource type, and I cant find any documentation to help me!

 

I have tried defining the resource type like so:

 

kbuilder.add(ResourceFactory.newClassPathResource("testDecisionTable.gdst"),ResourceType.DTABLE);

 

however when I insert this into my session:

StatefulKnowledgeSession ksession = createKnowledgeSession(getKbase());

 

this throws an error on my stacktrace at

orgs.drools.decisiontable.parser.xls.ExcelParser.parseFile

 

obviously it's seeing the xml format and thinks its a excel file.

 

I have also tried using resource type XDRL, considering decision tables are essentially a drl file with a gui & its in xml format:

 

kbuilder.add(ResourceFactory.newClassPathResource("testDecisionTable.gdst"),ResourceType.DTABLE);

 

I thought this would parse the xml into drl and then I can use tyhe decision table as a rules file! However this throws an error:

 

 

(null: 1, 19): cvc-elt.1: Cannot find the declaration of element 'decision-table52'.

 

Could some1 provide me with some assitance to get these working or some examples of decision tables being used in a junit test would also be great. As I said I ha vent managed to find anything in the documentation, so I'v either overlooked something (probably) or its not in their!

 

Thanks for any help!

Reply to this message by going to Community

Start a new discussion in jBPM at Community