[jboss-user] [jBPM] - jBPM-console delete all persistence data in database on first startup

Davor Stanic do-not-reply at jboss.com
Wed Jan 4 11:04:06 EST 2012


Davor Stanic [http://community.jboss.org/people/dstanic] created the discussion

"jBPM-console delete all persistence data in database on first startup"

To view the discussion, visit: http://community.jboss.org/message/644638#644638

--------------------------------------------------------------
Hi,


*Scenario:*

Enviroment is configured for jBPM persistence , and we use H2 database.

We create two process instance from the Main method of the Java class, and If we look in database
for data in tables (PROCESSINSTANCEINFO,PROCESSINSTANCELOG,WORKITEMINFO ...) all data is properly recorded.
On jbpm-console in process instance view all data is visible.  

When we access jbpm-console for the first time after application server restart all data in database is erased.




*environment:*
-jboss-as-7.0.2.Final
-jbpm-5.2.0.Final-bin
-jbpm-5.2.0.Final-gwt-console
-birt-runtime-3_7_0
-designer-2.0-jboss7
-guvnor-distribution-wars-5.3.1.Final
-org.drools.updatesite-5.3.1.Final-assembly

*java code in main method:*

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newUrlResource("http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST"),ResourceType.PKG);
KnowledgeBase kbase = kbuilder.newKnowledgeBase();

JBPMHelper.setupDataSource();

EntityManagerFactory emf =   Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );

StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);
int sessionId = ksession.getId();
System.out.println(sessionId);

ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new CommandBasedWSHumanTaskHandler(ksession));

ksession.startProcess( "com.sample.bpmn.hello" );

ksession.dispose();
logger.dispose();


Thanks
Davor
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/644638#644638]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120104/ace18b63/attachment-0001.html 


More information about the jboss-user mailing list