[jboss-user] [jBPM] - jBPM Unit testing Guided Decision Table .gdst

Alistair Jarrett do-not-reply at jboss.com
Thu Sep 20 05:05:53 EDT 2012


Alistair Jarrett [https://community.jboss.org/people/gravityblast] created the discussion

"jBPM Unit testing Guided Decision Table .gdst"

To view the discussion, visit: https://community.jboss.org/message/760544#760544

--------------------------------------------------------------
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
[https://community.jboss.org/message/760544#760544]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120920/e82357cd/attachment.html 


More information about the jboss-user mailing list