[rules-users] this is my requirement !!!!!!!!!!!
Sai Nadh
adisya.sai at gmail.com
Thu Oct 18 11:38:30 EDT 2012
good evening,
thank you for all, giving me good encouragement in drools...
I have created some rules in drools guvnor, which i want to access to my
java application
for that, i have created MODEL_CLASS, TEST_CLASS in eclipse.
In the test class i have written the below code to access the guvnor
rules.. please check this and suggest me if it has any mistakes
private static KnowledgeBase createKnowledgeBase() {
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent"
);
KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
kaconf.setProperty( "drools.agent.scanDirectories", "false" );
kagent.applyChangeSet( ResourceFactory.newUrlResource("
http://localhost:8080/guvnor/rest/packages/ProductPositionAlert/assets/
change-set.xml/source")
);
return kbase;
}
my change-set.xml is like below
<?xml version="1.0" encoding="UTF-8"?>
<change-set xmlns='http://drools.org/drools-5.4/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.4/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="
http://localhost:8080/guvnor/org.drools.guvnor.Guvnor/package/ProductPositionAlert/ProductPositionAlert_SNAPSHOT
"
type="PKG" />
</add>
</change-set>
i am providing here the snapshot of my drools guvnor rule package....
[image: Inline image 2]
thanks
--
*Regards*
*sainadh*
* *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20121018/39b8f5c2/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 135893 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20121018/39b8f5c2/attachment-0001.png
More information about the rules-users
mailing list