[rules-dev] Missing Artifact: JPAKnowledgeProviderLocalClient

tolitius webakaunt at gmail.com
Wed Apr 21 16:28:12 EDT 2010


Thanks for working on it!

I apologize if I posted on the wrong list ( I made my own judgment, that
things "about" the code go on the dev-list :)  )

In any case I have not done extensive testing, but I was able to
successfully integrate Drools (JPA Persistable ) with Spring. Needed to
built several jars here and there, added missing component as I described
here:
http://n3.nabble.com/Missing-Artifact-JPAKnowledgeFactoryServiceImpl-tp740835p740974.html
+ some config tweaks.

So now I can get this running successfully:

public class WorkflowSpringConfigurationTest {

	@Resource
	JPAKnowledgeServiceBean jpaKnowledgeProvider;

	@Test
	public void shouldCreateApplicationContextAndInjectKnowledgeProvider() {
		// should Create Application Context And Inject KnowledgeProvider
	}
	
	@Test
	public void shouldStartTheFlow() {
		StatefulKnowledgeSession session = 
			jpaKnowledgeProvider.newStatefulKnowledgeSession();
		
		session.startProcess( "ultra-simple-flow" );
	}

	@Test
	public void shouldSuspendTheFlow() {
		StatefulKnowledgeSession session = 
			jpaKnowledgeProvider.newStatefulKnowledgeSession();
		
		session.getWorkItemManager().registerWorkItemHandler(
				"WaitToBeCompleted", new DoNothingWorkItemHandler() );
		
		session.startProcess( "suspendable-flow" );
	}		
	
	@Test
	public void shouldResumeTheFlow() {
		StatefulKnowledgeSession session = 
			jpaKnowledgeProvider.loadStatefulKnowledgeSession( 2 );
		
		session.getWorkItemManager().completeWorkItem( 1, null );
	}	
}

hard coded IDs here are used due to the fact that in a test config I have
"<prop key="hibernate.hbm2ddl.auto">create</prop>" as a JPA property, so
they are always the same.

/Anatoly
-- 
View this message in context: http://n3.nabble.com/Missing-Artifact-JPAKnowledgeProviderLocalClient-tp740387p741171.html
Sent from the Drools - Dev mailing list archive at Nabble.com.


More information about the rules-dev mailing list