HibernateException when calling ProcessInstance.getTaskMgmtI
nawad980 Aug 3, 2005 7:03 AMDear All,
I'm trying to create a small workflow example using the jBPM.
I created the ProcessDefinition, and the ProcessInstance, stored them in the hypersonic database:
factory = JbpmSessionFactory.buildJbpmSessionFactory(); factory.getJbpmSchema().createSchema(); JbpmSession session = factory.openJbpmSession(); session.getGraphSession().saveProcessDefinition(processDefinition); session.getGraphSession().saveProcessInstance(processInstance); session.close();
Now, the first node in my Process is a task node. So, when I call signal() on the processInstance, the AssignmentHandler is called and executed normally. The problem is when I try to load the ProcessInstance from the database, and call the getTaskMgmtInstance() method:
JbpmSession session = factory.openJbpmSession(); ProcessInstance processInstance = session.getGraphSession().loadProcessInstance(1); TaskMgmtInstance taskMgmt = processInstance.getTaskMgmtInstance();
I get the following exception:
org.hibernate.HibernateException: null index column for collection: org.jbpm.graph.exe.ProcessInstance.instances at org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:618) at org.hibernate.collection.PersistentMap.readFrom(PersistentMap.java:197) at org.hibernate.loader.Loader.readCollectionElement(Loader.java:674) at org.hibernate.loader.Loader.readCollectionElements(Loader.java:370) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:314) at org.hibernate.loader.Loader.doQuery(Loader.java:412) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218) at org.hibernate.loader.Loader.loadCollection(Loader.java:1434) at org.hibernate.loader.collection.OneToManyLoader.initialize(OneToManyLoader.java:111) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:488) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1430) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:176) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:48) at org.hibernate.collection.PersistentMap.get(PersistentMap.java:123) at org.jbpm.graph.exe.ProcessInstance.getInstance(ProcessInstance.java:136) at org.jbpm.graph.exe.ProcessInstance.getTaskMgmtInstance(ProcessInstance.java:170) at org.jbpm.nadeem.NadeemTaskAssignment.processTaskById(NadeemTaskAssignment.java:247)
NadeemTaskAssignment is my test class.
The thing is, when I try to do this without persistence, it works fine, I call the getTaskMgmtInstance() method and retrieve the list of tasks. I encounter this problem only when I store and load the ProcessInstance in the database.
Thank you.