Charlie Kuharski [
https://community.jboss.org/people/ckuharski] created the discussion
"Confused about JBPM and knowledge agents"
To view the discussion, visit:
https://community.jboss.org/message/743791#743791
--------------------------------------------------------------
I'm new to this and I'm pretty much confused. I'm missing some basic
concepts.
I'm trying to interact with the JBPM server at the API level via a proxy. I don't
want the proxy to become the JBPM server.
1) The code below works:
// code snippet
@Test
public void simpleExecution() {
ProcessInstance processInstance = ksession.startProcess("org.jbpm.test");
long processInstance1Id = processInstance.getId();
Assert.assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
ksession.signalEvent("continueSignal", null, processInstance1Id);
Assert.assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
}
1) I'm trying to integrate with an existing application and the consultants ( I
believe them) have a project that does the same basic steps but needs persistence.xml
local to the project in addition to the persistence.xml on the server.
/*
* Create EntityManagerFactory and register it in the environment Create the
* knowledge session that uses JPA to persists runtime state
*/
public static StatefulKnowledgeSession createSession() throws Exception {
KnowledgeBase kbase =
readKnowledgeBase("SimpleHTForm.bpmn2");
emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa"
);
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
env.set( EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager() );
env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory",
"org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory",
"org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration config =
KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
return JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
}
What is this actually doing? Is this persisting around te JBPM server? Is the proxy
becoming its own JBPM server? An I really interacting with JBPM or just using the classes
locally and saving to the datasource? See the test example above. There is no server
running for the test.
I've played with the demos and that makes sense. Interacting with an existing JBPM is
very confusing.
Any direction would be greatly appreciated.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/743791#743791]
Start a new discussion in jBPM Development at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]