Interesting to know that. How would it be possible to get source from
Guvnor 6.x as UrlResource does not allow (like changeset.xml) to define
admin/password + basic authentication to connect to the server ?
On Thu, Apr 25, 2013 at 4:16 PM, Mark Proctor <mproctor(a)codehaus.org> wrote:
That change set.xml is not longer supported in 6.
Our unit of deployment is the jar, built using the maven plugin.
Mark
On 25 Apr 2013, at 08:40, Charles Moulliard <ch007m(a)gmail.com> wrote:
Hi,
I have some difficulties to figure out How I could achieve the same as we
did in the past using "changeset.xml" & Knowledge API classes but now with
Kie :
Code is here :
https://gist.github.com/cmoulliard/797426c106a53028ebdd
Help is welcome :
OLD WHICH IS WORKING
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("changeset.xml",
getClass()),
ResourceType.CHANGE_SET);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
StatefulKnowledgeSession kSession =
createKnowledgeSession(kbase);
NEW CODE (DOES NOT WORK - packages = null)
KieServices ks = KieServices.Factory.get();
KieFileSystem kfs = ks.newKieFileSystem();
Resource res =
ResourceFactory.newClassPathResource("changeset.xml",getClass())
.setResourceType(ResourceType.CHANGE_SET);
kfs.write(res);
KieBuilder kbi = ks.newKieBuilder(kfs).buildAll();
// Create Session
KieSession kse =
ks.newKieContainer(ks.getRepository().getDefaultReleaseId()).newKieSession();
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
-Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/IntelliJ
IDEA 12.app/bin" -Dfile.encoding=UTF-8 -classpath
"/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/dt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/javaws.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jconsole.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management-agent.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/sa-jdi.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/apple_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/dnsns.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/localedata.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunjce_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunpkcs11.jar:/Users/chmoulli/wks-client-projects/astrium/guvnor-rest/target/classes:/Users/chmoulli/.m2/repository/org/kie/kie-api/6.0.0-SNAPSHOT/kie-api-6.0.0-SNAPSHOT.jar:/Users/chmoulli/.m2/repository/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.jar:/Users/chmoulli/.m2/repository/org/kie/kie-internal/6.0.0-SNAPSHOT/kie-internal-6.0.0-SNAPSHOT.jar:/Users/chmoulli/.m2/repository/org/drools/drools-core/6.0.0-SNAPSHOT/drools-core-6.0.0-SNAPSHOT.jar:/Users/chmoulli/.m2/repository/org/mvel/mvel2/2.1.4.Final/mvel2-2.1.4.Final.jar:/Users/chmoulli/.m2/repository/org/drools/drools-compiler/6.0.0-SNAPSHOT/drools-compiler-6.0.0-SNAPSHOT.jar:/Users/chmoulli/.m2/repository/org/antlr/antlr-runtime/3.3/antlr-runtime-3.3.jar:/Users/chmoulli/.m2/repository/org/antlr/antlr/3.3/antlr-3.3.jar:/Users/chmoulli/.m2/repository/org/antlr/stringtemplate/3.2.1/stringtemplate-3.2.1.jar:/Users/chmoulli/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/Users/chmoulli/.m2/repository/org/eclipse/jdt/core/compiler/ecj/3.5.1/ecj-3.5.1.jar:/Users/chmoulli/.m2/repository/com/thoughtworks/xstream/xstream/1.4.3/xstream-1.4.3.jar:/Users/chmoulli/.m2/repository/xmlpull/xmlpull/
1.1.3.1/xmlpull-1.1.3.1.jar:/Users/chmoulli/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:/Users/chmoulli/.m2/repository/org/drools/drools-spring/6.0.0-SNAPSHOT/drools-spring-6.0.0-SNAPSHOT.jar:/Users/chmoulli/.m2/repository/org/drools/drools-decisiontables/6.0.0-SNAPSHOT/drools-decisiontables-6.0.0-SNAPSHOT.jar:/Users/chmoulli/.m2/repository/org/drools/drools-templates/6.0.0-SNAPSHOT/drools-templates-6.0.0-SNAPSHOT.jar:/Users/chmoulli/.m2/repository/org/apache/poi/poi-ooxml/3.9/poi-ooxml-3.9.jar:/Users/chmoulli/.m2/repository/org/apache/poi/poi/3.9/poi-3.9.jar:/Users/chmoulli/.m2/repository/commons-codec/commons-codec/1.5/commons-codec-1.5.jar:/Users/chmoulli/.m2/repository/org/apache/poi/poi-ooxml-schemas/3.9/poi-ooxml-schemas-3.9.jar:/Users/chmoulli/.m2/repository/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar:/Users/chmoulli/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar:/Users/chmoulli/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/chmoulli/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/Users/chmoulli/.m2/repository/org/springframework/spring-core/3.0.6.RELEASE/spring-core-3.0.6.RELEASE.jar:/Users/chmoulli/.m2/repository/org/springframework/spring-asm/3.0.6.RELEASE/spring-asm-3.0.6.RELEASE.jar:/Users/chmoulli/.m2/repository/org/springframework/spring-beans/3.0.6.RELEASE/spring-beans-3.0.6.RELEASE.jar:/Users/chmoulli/.m2/repository/org/springframework/spring-context/3.0.6.RELEASE/spring-context-3.0.6.RELEASE.jar:/Users/chmoulli/.m2/repository/org/springframework/spring-aop/3.0.6.RELEASE/spring-aop-3.0.6.RELEASE.jar:/Users/chmoulli/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/chmoulli/.m2/repository/org/springframework/spring-expression/3.0.6.RELEASE/spring-expression-3.0.6.RELEASE.jar:/Users/chmoulli/.m2/repository/javax/javaee-api/6.0/javaee-api-6.0.jar:/Users/chmoulli/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/Users/chmoulli/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/chmoulli/.m2/repository/org/osgi/org.osgi.core/4.3.0/org.osgi.core-4.3.0.jar:/Users/chmoulli/.m2/repository/junit/junit/4.9/junit-4.9.jar:/Users/chmoulli/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar:/Users/chmoulli/.m2/repository/org/slf4j/slf4j-log4j12/1.7.2/slf4j-log4j12-1.7.2.jar:/Users/chmoulli/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/Applications/IntelliJIDEA
12.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain
org.fusesource.demo.main.MainApp4
2013-04-25 09:33:41 WARN AbstractKieModule:182 - No files found for
KieBase defaultKieBase
2013-04-25 09:33:41 INFO KieRepositoryImpl:62 - KieModule was
added:MemoryKieModule[ ReleaseId=org.default:artifact:1.0.0-SNAPSHOT]
Exception in thread "main" java.lang.NullPointerException
2013-04-25 09:33:42 INFO MainApp4:59 - >> FactTypes created for
LoanApplication, Applicant, IncomeSource
at org.fusesource.demo.main.MainApp4$Knowledge.build(MainApp4.java:61)
at org.fusesource.demo.main.MainApp4.main(MainApp4.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Regards,
--
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog :
http://cmoulliard.blogspot.com
_______________________________________________
rules-dev mailing list
rules-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
_______________________________________________
rules-dev mailing list
rules-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev