-
1. Re: How to delete a process from the database
peterj Aug 9, 2005 2:02 PM (in response to isellakuria)I noticed the same issue, you have to delete things in the correct order to get the process out of the database. So I use some Java code (get the ProcessDefinition object and call deleteProcessDefinition) or the JbpmSchemaTask ant task (the ant task is in jBPM 3.0).
-
2. Re: How to delete a process from the database
isellakuria Aug 9, 2005 2:14 PM (in response to isellakuria)I can't find the deleteProcessDefinition method, do you refer to removeDefinition(ModuleDefinition moduleDefinition) method in class ProcessDefinition? Where is the ant task JbpmSchemaTask?
Thanks!
Igor. -
3. Re: How to delete a process from the database
aguizar Aug 9, 2005 2:51 PM (in response to isellakuria)Method deleteProcessDefinition() is in class org.jbpm.db.GraphSession, while class JbpmSchemaTask is in package org.jbpm.ant.
However, the ant task is for creating, dropping or cleaning the tables, not for dealing with individual process definitions, so your only choice is the method above. Note that this functionality has not been fully tested yet, and you will probably run into a constraint violation.
Peter, have you figured out the correct order to delete things? It would be of great help. -
4. Re: How to delete a process from the database
isellakuria Aug 9, 2005 5:04 PM (in response to isellakuria)Gracias Alejandro! I have used the method you have told me and i have successfully deleted the processes from my db...
Saludos,
Igor. -
5. Re: How to delete a process from the database
peterj Aug 9, 2005 5:08 PM (in response to isellakuria)Oops, that's right, the ant task drops the schema, not just deletes a process definition. I'm just starting to play with persisted processes and so far have only a single process in the database, so for me dropping and reloading the schema works just fine when I want to start from scratch.
-
6. Re: How to delete a process from the database
hannes Sep 6, 2005 10:49 AM (in response to isellakuria)I have problems with the definition deletion:
JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession(); jbpmSession.getGraphSession().deleteProcessDefinition(toDeleteId); jbpmSession.close();
The Code is located in a processAction method of a jBoss portlet.16:32:30,057 ERROR [GraphSession] org.hibernate.HibernateException: null index column for collection: org.jbpm.graph.def
.ProcessDefinition.nodes
16:32:30,167 ERROR [CoreServlet] An error occured during the action request : couldn't delete process definition '1'
java.lang.RuntimeException: couldn't delete process definition '1'
at org.jbpm.db.GraphSession.deleteProcessDefinition(GraphSession.java:191)
at org.jbpm.db.GraphSession.deleteProcessDefinition(GraphSession.java:170)
at ***********.DefinitionOverViewPortlet.processAction(DefinitionOverViewPortlet.java:133)
at org.jboss.portal.portlet.invocation.DispatcherInterceptor.invokeAction(DispatcherInterceptor.java:110)
at org.jboss.portal.portlet.invocation.DispatcherInterceptor.invoke(DispatcherInterceptor.java:191)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
at org.jboss.portal.portlet.invocation.PreferencesInterceptor.invoke(PreferencesInterceptor.java:93)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
at org.jboss.portal.server.invocation.component.ContextDispatcherInterceptor$InvokeNextCommand.execute(ContextDi
spatcherInterceptor.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.portal.server.servlet.CommandServlet.doGet(CommandServlet.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:539)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at org.jboss.portal.server.invocation.component.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor
.java:58)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
at org.jboss.portal.core.invocation.AccessControlInterceptor.invoke(AccessControlInterceptor.java:125)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
at org.jboss.portal.server.invocation.component.CacheInterceptor.invoke(CacheInterceptor.java:74)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:238)
at org.jboss.portal.server.Component.invoke(Component.java:130)
at org.jboss.portal.server.invocation.portal.TargetInterceptor.invokeWindow(TargetInterceptor.java:167)
at org.jboss.portal.server.invocation.portal.TargetInterceptor.invoke(TargetInterceptor.java:67)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
at org.jboss.portal.core.invocation.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:117)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
at org.jboss.portal.core.invocation.UserContextInterceptor.invoke(UserContextInterceptor.java:92)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:238)
at org.jboss.portal.server.PortalServer.invoke(PortalServer.java:186)
at org.jboss.portal.server.servlet.AbstractMainServlet.invoke(AbstractMainServlet.java:78)
at org.jboss.portal.server.servlet.AbstractMainServlet.doGet(AbstractMainServlet.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.portal.core.servlet.TransactionFilter.doFilter(TransactionFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.HibernateException: null index column for collection: org.jbpm.graph.def.ProcessDefinition.node
s
at org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:618
)
at org.hibernate.collection.PersistentList.readFrom(PersistentList.java:297)
at org.hibernate.loader.Loader.readCollectionElement(Loader.java:645)
at org.hibernate.loader.Loader.readCollectionElements(Loader.java:355)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:306)
at org.hibernate.loader.Loader.doQuery(Loader.java:395)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1400)
at org.hibernate.loader.collection.OneToManyLoader.initialize(OneToManyLoader.java:107)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:48
3)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeColl
ectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1412)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:171)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:48)
at org.hibernate.collection.PersistentList.iterator(PersistentList.java:105)
at org.hibernate.type.CollectionType.getElementsIterator(CollectionType.java:193)
at org.hibernate.type.CollectionType.getElementsIterator(CollectionType.java:185)
at org.hibernate.engine.Cascades.getAllElementsIterator(Cascades.java:939)
at org.hibernate.engine.Cascades.access$100(Cascades.java:32)
at org.hibernate.engine.Cascades$1.getCascadableChildrenIterator(Cascades.java:71)
at org.hibernate.engine.Cascades.cascadeCollection(Cascades.java:858)
at org.hibernate.engine.Cascades.cascade(Cascades.java:739)
at org.hibernate.engine.Cascades.cascade(Cascades.java:817)
at org.hibernate.engine.Cascades.cascade(Cascades.java:789)
at org.hibernate.event.def.DefaultDeleteEventListener.cascadeBeforeDelete(DefaultDeleteEventListener.java:248)
at org.hibernate.event.def.DefaultDeleteEventListener.deleteEntity(DefaultDeleteEventListener.java:201)
at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:109)
at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:565)
at org.jbpm.db.GraphSession.deleteProcessDefinition(GraphSession.java:186)
... 64 more
The process definition itself is a simple flow:<process-definition name='testflow'> <start-state> <transition to='phase one' /> </start-state> <state name='phase one'> <transition to='phase two' /> </state> <state name='phase two'> <transition to='phase three' /> </state> <state name='phase three'> <transition to='end' /> </state> <end-state name='end' /> </process-definition>
I am using JBoss AS 4.0.2, Portlet 2.0 & jBPM 3.0. -
7. Re: How to delete a process from the database
hannes Sep 9, 2005 4:55 AM (in response to isellakuria)ok, the error only appears when the processdefinition is loaded by bare .xml -file. If I it is loaded via .par file (websale.par) the following output could be regarded:
10:39:45,806 INFO [DefinitionOverViewPortlet] Process Definition deleted:1
10:39:45,856 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 1572 / 61 / 40
10:39:45,856 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 1573 / 61 / 40
10:39:45,856 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 1574 / 61 / 40
10:39:45,856 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 1575 / 61 / 40
10:39:45,856 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default' 1576 / 61 / 40
10:39:45,856 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files' 1577 / 61 / 40
10:39:45,856 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/' 1578 / 61 / 40
10:39:45,856 DEBUG [permission] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 459 / 19 / 19
10:39:45,856 DEBUG [permission] [B@1479df5 (0, 0) Cache Hit: '/files/default' 460 / 19 / 19
10:39:45,856 DEBUG [permission] [B@1479df5 (0, 0) Cache Hit: '/files' 461 / 19 / 19
10:39:45,856 DEBUG [permission] [B@1479df5 (0, 0) Cache Hit: '/' 462 / 19 / 19
10:39:45,856 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/users/root' 1579 / 61 / 40
10:39:45,856 DEBUG [descriptor] [B@1479df5 (0, 0) Cache Hit: '/roles/root-1.0' 165 / 0 / 40
10:39:45,866 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 1580 / 61 / 40
10:39:45,866 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 1581 / 61 / 40
10:39:45,866 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/users/root' 1582 / 61 / 40
10:39:45,866 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 1583 / 61 / 40
10:39:45,866 DEBUG [lock] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 319 / 13 / 13
10:39:45,866 DEBUG [lock] [B@1479df5 (0, 0) Cache Hit: '/files/default' 320 / 13 / 13
10:39:45,866 DEBUG [lock] [B@1479df5 (0, 0) Cache Hit: '/files' 321 / 13 / 13
10:39:45,866 DEBUG [lock] [B@1479df5 (0, 0) Cache Hit: '/' 322 / 13 / 13
10:39:45,866 DEBUG [descriptors] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 154 / 40 / 40
10:39:45,866 DEBUG [descriptors] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 155 / 40 / 40
10:39:45,866 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 1584 / 61 / 40
10:39:45,866 DEBUG [descriptor] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html-1.0' 166 / 0 / 40
10:39:45,866 DEBUG [object] [B@1479df5 (0, 0) Cache Hit: '/files/default/index.html' 1585 / 61 / 40
10:39:45,876 DEBUG [file-content-store] Thread Thread[http-0.0.0.0-8081-3,5,jboss] starts work on behalf of transaction branch [B@1479df5
10:39:45,876 DEBUG [Locking] [B@1479df5 trying to acquire lock for /files/default/index.html_1.0 at level 2 at 1126255185876
10:39:45,876 DEBUG [Locking] [B@1479df5 getting new lock for /files/default/index.html_1.0 at level 2 at 1126255185876
10:39:45,876 DEBUG [Locking] [B@1479df5 actually acquired lock for /files/default/index.html_1.0 at 1126255185876
10:39:45,876 DEBUG [file-content-store] Thread Thread[http-0.0.0.0-8081-3,5,jboss] suspends work on behalf of transaction branch [B@1479df5
10:39:45,876 DEBUG [file-content-store] Thread Thread[http-0.0.0.0-8081-3,5,jboss] prepares transaction branch [B@1479df5
10:39:45,876 DEBUG [file-content-store] Thread Thread[http-0.0.0.0-8081-3,5,jboss] commits transaction branch [B@1479df5
10:39:45,886 DEBUG [Locking] [B@1479df5 releasing lock for /files/default/index.html_1.0 at 1126255185886
10:39:45,936 DEBUG [object] [B@1479df5 committed 0 changes and 0 scheduled deletes
10:39:45,936 DEBUG [permission] [B@1479df5 committed 0 changes and 0 scheduled deletes
10:39:45,936 DEBUG [lock] [B@1479df5 committed 0 changes and 0 scheduled deletes
10:39:45,936 DEBUG [descriptors] [B@1479df5 committed 0 changes and 0 scheduled deletes
10:39:45,936 DEBUG [descriptor] [B@1479df5 committed 0 changes and 0 scheduled deletes
10:39:45,976 WARN [TxConnectionManager] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.
10:39:46,647 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 1586 / 61 / 40
10:39:46,657 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 1587 / 61 / 40
10:39:46,657 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 1588 / 61 / 40
10:39:46,657 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 1589 / 61 / 40
10:39:46,657 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images' 1590 / 61 / 40
10:39:46,657 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default' 1591 / 61 / 40
10:39:46,727 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files' 1592 / 61 / 40
10:39:46,727 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/' 1593 / 61 / 40
10:39:46,727 DEBUG [permission] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 463 / 19 / 19
10:39:46,727 DEBUG [permission] [B@18e2477 (0, 0) Cache Hit: '/files/default/images' 464 / 19 / 19
10:39:46,727 DEBUG [permission] [B@18e2477 (0, 0) Cache Hit: '/files/default' 465 / 19 / 19
10:39:46,727 DEBUG [permission] [B@18e2477 (0, 0) Cache Hit: '/files' 466 / 19 / 19
10:39:46,787 DEBUG [permission] [B@18e2477 (0, 0) Cache Hit: '/' 467 / 19 / 19
10:39:46,787 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/users/root' 1594 / 61 / 40
10:39:46,787 DEBUG [descriptor] [B@18e2477 (0, 0) Cache Hit: '/roles/root-1.0' 167 / 0 / 40
10:39:46,787 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 1595 / 61 / 40
10:39:46,807 DEBUG [SchedulerThread] checking for timers
10:39:46,827 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 1596 / 61 / 40
10:39:46,827 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/users/root' 1597 / 61 / 40
10:39:46,827 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 1598 / 61 / 40
10:39:46,827 DEBUG [lock] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 323 / 13 / 13
10:39:46,827 DEBUG [lock] [B@18e2477 (0, 0) Cache Hit: '/files/default/images' 324 / 13 / 13
10:39:46,827 DEBUG [lock] [B@18e2477 (0, 0) Cache Hit: '/files/default' 325 / 13 / 13
10:39:46,977 DEBUG [lock] [B@18e2477 (0, 0) Cache Hit: '/files' 326 / 13 / 13
10:39:46,977 DEBUG [lock] [B@18e2477 (0, 0) Cache Hit: '/' 327 / 13 / 13
10:39:46,977 DEBUG [descriptors] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 156 / 40 / 40
10:39:46,977 DEBUG [descriptors] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 157 / 40 / 40
10:39:46,977 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 1599 / 61 / 40
10:39:46,977 DEBUG [descriptor] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif-1.0' 168 / 0 / 40
10:39:47,037 DEBUG [object] [B@18e2477 (0, 0) Cache Hit: '/files/default/images/bookmark.gif' 1600 / 61 / 40
10:39:47,057 DEBUG [file-content-store] Thread Thread[http-0.0.0.0-8081-1,5,jboss] starts work on behalf of transaction branch [B@18e2477
10:39:47,108 DEBUG [Locking] [B@18e2477 trying to acquire lock for /files/default/images/bookmark.gif_1.0 at level 2 at 1126255187108
10:39:47,108 DEBUG [Locking] [B@18e2477 getting new lock for /files/default/images/bookmark.gif_1.0 at level 2 at 1126255187108
10:39:47,108 DEBUG [Locking] [B@18e2477 actually acquired lock for /files/default/images/bookmark.gif_1.0 at 1126255187108
10:39:47,108 DEBUG [file-content-store] Thread Thread[http-0.0.0.0-8081-1,5,jboss] suspends work on behalf of transaction branch [B@18e2477
10:39:47,108 DEBUG [file-content-store] Thread Thread[http-0.0.0.0-8081-1,5,jboss] prepares transaction branch [B@18e2477
10:39:47,238 DEBUG [file-content-store] Thread Thread[http-0.0.0.0-8081-1,5,jboss] commits transaction branch [B@18e2477
10:39:47,308 DEBUG [Locking] [B@18e2477 releasing lock for /files/default/images/bookmark.gif_1.0 at 1126255187308
10:39:47,488 DEBUG [object] [B@18e2477 committed 0 changes and 0 scheduled deletes
10:39:47,488 DEBUG [permission] [B@18e2477 committed 0 changes and 0 scheduled deletes
10:39:47,488 DEBUG [lock] [B@18e2477 committed 0 changes and 0 scheduled deletes
10:39:47,488 DEBUG [descriptors] [B@18e2477 committed 0 changes and 0 scheduled deletes
10:39:47,488 DEBUG [descriptor] [B@18e2477 committed 0 changes and 0 scheduled deletes
But the definition is still in the database. Surrounding begin+commitTransaction didn't help either.
btw, I am using now jbpm3.0.1 -
8. Re: How to delete a process from the database
tom.baeyens Sep 10, 2005 6:36 AM (in response to isellakuria)try 3.0.1. i a bug was fixed in those areas...
regards, tom.