Drools-ant to the rescue!
This video shows an example on how to use a new drools-ant task to migrate from the default file-based Guvnor repository to one stored in MySQL. Same task can also be used to create back-ups of your existing repository.

All things Artificial Intelligence related: Rules, Processes, Events, Agents, Planning, Ontologies and more :)
Using drools-ant to migrate/back-up existing Jackrabbit repositories
This episode had some bad luck with respect to the audio recording and took a while to get edited down to listenable quality. The news are therefore a bit out of date but the interview with Kris Verlaenen about jBPM 5 is all filled with great and interesting content.
The interview part has good audio and you can skip to the 22m33s mark to hear about jBPM 5.
We are again sorry that Emmanuel Bernard messed up the recording, but we will back soon with a new interviewee and with better sound ;)
If you got comments/feedback send it via mail or on twitter.
JBoss Asylum on jBPM5
@Test
public void testNoneTypeSafeDeclarations() {
// same namespace
String str = "package org.drools\n" +
"global java.util.List list\n" +
"declare Person\n" +
" @typesafe(false)\n" +
"end\n" +
"rule testTypeSafe\n dialect \"mvel\" when\n" +
" $p : Person( object.street == 's1' )\n" +
"then\n" +
" list.add( $p );\n" +
"end\n";
executeTypeSafeDeclarations( str, true );
// different namespace with import
str = "package org.drools.test\n" +
"import org.drools.Person\n" +
"global java.util.List list\n" +
"declare Person\n" +
" @typesafe(false)\n" +
"end\n" +
"rule testTypeSafe\n dialect \"mvel\" when\n" +
" $p : Person( object.street == 's1' )\n" +
"then\n" +
" list.add( $p );\n" +
"end\n";
executeTypeSafeDeclarations( str, true );
// different namespace without import using qualified name
str = "package org.drools.test\n" +
"global java.util.List list\n" +
"declare org.drools.Person\n" +
" @typesafe(false)\n" +
"end\n" +
"rule testTypeSafe\n dialect \"mvel\" when\n" +
" $p : org.drools.Person( object.street == 's1' )\n" +
"then\n" +
" list.add( $p );\n" +
"end\n";
executeTypeSafeDeclarations( str, true );
// this should fail as it's not declared non typesafe
str = "package org.drools.test\n" +
"global java.util.List list\n" +
"declare org.drools.Person\n" +
" @typesafe(true)\n" +
"end\n" +
"rule testTypeSafe\n dialect \"mvel\" when\n" +
" $p : org.drools.Person( object.street == 's1' )\n" +
"then\n" +
" list.add( $p );\n" +
"end\n";
executeTypeSafeDeclarations( str, false );
}
private void executeTypeSafeDeclarations(String str, boolean mustSucceed) {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newByteArrayResource( str.getBytes() ),
ResourceType.DRL );
if ( kbuilder.hasErrors() ) {
if ( mustSucceed ) {
fail( kbuilder.getErrors().toString() );
} else {
return;
}
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
List list = new ArrayList();
ksession.setGlobal( "list",
list );
Address a = new Address("s1" );
Person p = new Person( "yoda" );
p.setObject( a );
ksession.insert( p );
ksession.fireAllRules();
assertEquals( p, list.get(0));
}
Dynamic (non type safe) Expressions in Rules
Methods can also have the property of "idempotence" in that (aside from error or expiration issues) the side-effects of N > 0 identical requests is the same as for a single request. The methods GET, HEAD, PUT and DELETE share this property. [RFC 2616, page 50]Idempotency in the Guvnor can only be guaranteed when working from a revision id perspective, not one based upon pure string based names, which is our current approach. As Guvnor front-ends a source control repository, queries to assets by name may only be IDEMPOTENT when said assets are addressed by their revision. Hence, although repetitive calls to GET, PUT, or DELETE are indempotent in context, actions by other users could update assets and packages so that calls will change over time.
AtomPub Interface for Guvnor
jBPM Oryx Integration - Gateway example
jBPM5 lightweight? Running on Android!
Vote Salaboy!!! Community Award!!!
Project | Git size | Locally (2th build): mvn install -DskipTests | Hudson (*): mvn install -Dfull |
---|---|---|---|
droolsjbpm-build-bootstrap | 1 MB | 3s | 55s |
droolsjbpm-knowledge | 35 MB | 6s | 1m 53s |
drools | 160 MB | 38s | ? (red) |
drools-planner | 142 MB | 9s | 4m 34s |
jbpm | 21 MB | 31s | 11m 7s |
droolsjbpm-integration | 38 MB | 23s | 11m 0s |
guvnor | 131 MB | 58s | 21m 40s |
droolsjbpm-tools | 24 MB | ?m ?s | ? (red) |
droolsjbpm-build-distribution | 10 MB | ? (todo) | ? (red) |
New total | 562 MB | 2m 48s (without tools, dist) | ? |
Old droolsjbpm | 1200 MB | 3m 18s in JAN 2011 5m 29s in DEC 2010 (without jbpm, tools, dist) | 2h 41m 57s (without jbpm) |
Splitting up into smaller git repositories and smaller builds