KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > db > PersistenceApiTest


1 package org.jbpm.db;
2
3 import junit.framework.*;
4
5 public class PersistenceApiTest extends TestCase {
6
7   static JbpmSessionFactory jbpmSessionFactory = JbpmSessionFactory.buildJbpmSessionFactory();
8
9   public void testStartProcessInstance() {
10     /*
11     // obtain a session
12     JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession();
13     try {
14       // start a user managed transaction
15       jbpmSession.beginTransaction();
16
17       // load information from the database
18       // (note that process definitions will be cached in memory
19       // in the second level cache of hibernate)
20       ProcessDefinition auctionProcess =
21         jbpmSession.getGraphSession().findLatestProcessDefinition("auction");
22
23       // perform a POJO workflow operation on the plain object model.
24       ProcessInstance auctionInstance = new ProcessInstance(auctionProcess);
25       auctionInstance.signal();
26       
27       // store the result in the database
28       jbpmSession.getGraphSession().saveProcessInstance(auctionInstance);
29       
30       // commit the user transaction
31       jbpmSession.commitTransaction();
32
33     } finally {
34       // close the session.
35       jbpmSession.close();
36     }
37     */

38   }
39 }
40
Popular Tags