0 Replies Latest reply on Apr 16, 2007 1:28 AM by Hung Phan

    Workflow process example

    Hung Phan Newbie

      I've tried to define a simple workflow process. I have Spring, Hibernate and jbpm 3.1.5. While doing some prototypes, I've encountered 2 problems that I am not sure what are wrong. Any help is really appreciated.

      Thanks.

      1) Using Hsqldb as a datasource, I can see some insert statements to the database when executing a statement like:
      ProcessInstance processInstance = new ProcessInstance(processDefinition);
      If I switch to Oracle 9.2.0 (by changing some xml file config), I don't see any update/insert statements. I can see some select statements for something like:
      ProcessDefinition processDefinition = context.getGraphSession().loadProcessDefinition(processDefintionId);

      2) If I use Hsqldb so that I can do some insert/update to the database, but I get an exception if I do something like this:
      TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
      taskInstance.setActorId(actorId);
      // Save the process instance along with the task instance
      jbpmTemplate.saveProcessInstance(processInstance);

      The stack trace is:
      0:117 PDT] 00000023 SystemOut O Hibernate: call identity()
      [4/15/07 10:02:10:117 PDT] 00000023 SystemOut O 2007-04-15 10:02:10,117 ERROR org.jbpm.db.GraphSession - org.hibernate.HibernateException: instance not of expected entity type: org.jbpm.context.exe.VariableInstance
      [4/15/07 10:02:10:117 PDT] 00000023 SystemErr R org.hibernate.HibernateException: instance not of expected entity type: org.jbpm.context.exe.VariableInstance
      at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassEntityPersister(AbstractEntityPersister.java:3301)
      at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1311)
      at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:180)
      at org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:460)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:84)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:502)
      at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)
      at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:134)
      at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:213)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:157)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:108)
      at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:290)
      at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:185)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:160)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:108)
      at org.hibernate.engine.Cascade.cascade(Cascade.java:248)
      at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:130)
      at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:121)
      at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
      at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
      at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:954)
      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1099)
      at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
      at org.jbpm.db.GraphSession.findLatestProcessDefinitions(GraphSession.java:184)
      at springweb.controller.IndexController.handleRequestInternal(IndexController.java)
      at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)