2 Replies Latest reply on Jun 17, 2010 6:18 AM by danny_fh

    Problem with stopping subProcesses (jbpm 4.3)

    danny_fh

      Hi all,

       

      i have a simple process including a subprocess. Now it might be necessary to stop the process using execution.end("stopped") when the subprocess is active. If i stop the subprocess first, the next activity after the subprocess-activity will be called. But i want to stop the process right where it is (means while executing the subprocess). So i tried to stop the main-process first. But in that case i retrieve the following error:

       

      2010-06-17 08:59:07,595|WARN  | JDBCExceptionReporter | SQL Error: 2292, SQLState: 23000

      2010-06-17 08:59:07,595|ERROR | JDBCExceptionReporter | ORA-02292: Integritäts-Constraint (JBPM.FK_EXEC_SUPEREXEC) verletzt - untergeordneter Datensatz gefunden ==> means: violation of constraint, found subordinated data <==

       

      2010-06-17 08:59:07,595|ERROR | AbstractFlushingEventListener | Could not synchronize database state with session

      org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#3860030]

          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)

          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

          at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)

          at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)

          at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)

          at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)

          at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

          at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)

          at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)

          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1141)

          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)

          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)

          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:212)

          at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:252)

          at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:382)

          at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)

          at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)

          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)

          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)

          at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)

          at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)

          at org.jbpm.pvm.internal.processengine.ProcessEngineImpl.execute(ProcessEngineImpl.java:300)

          at de.ingmbh.weblets.wm.service.services.ExecutionServiceImpl.endProcessInstance(ExecutionServiceImpl.java:202)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at junit.framework.TestCase.runTest(TestCase.java:154)

          at junit.framework.TestCase.runBare(TestCase.java:127)

          at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)

          at junit.framework.TestResult$1.protect(TestResult.java:106)

          at junit.framework.TestResult.runProtected(TestResult.java:124)

          at junit.framework.TestResult.run(TestResult.java:109)

          at junit.framework.TestCase.run(TestCase.java:118)

          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)

          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: java.sql.SQLException: ORA-02292: Integritäts-Constraint (JBPM.FK_EXEC_SUPEREXEC) verletzt - untergeordneter Datensatz gefunden

       

          at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)

          at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)

          at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)

          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)

          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)

          at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)

          at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)

          at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)

          at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)

          at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)

          at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3468)

          at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1062)

          at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2551)

          ... 41 more

       

      Any suggestions?

       

      Regards,

      Daniel

        • 1. Re: Problem with stopping subProcesses (jbpm 4.3)
          rebody

          Hi Daniel,

           

          Why do you want to end a sub process, and don't want to main process go on running?

           

          If you do that,  the main process will go to a dead wait state,  it won't go anywhere unless somebody execute signalExecutionById() on it.  It will be potential risk on this scenario.

           

          If you really want to achieve a feature like that, I suggest you using CustomActivity to implement your own activityhaviour.  Then you could do whatever you want to do.

           

          Regards.

          • 2. Re: Problem with stopping subProcesses (jbpm 4.3)
            danny_fh

            Hi HuiSheng Xu,

             

            thanks for your reply. The main reason for all the stuff are the requests of our customer.

            I don't want the main process to go on running, because in every activity there are operations executed in another system (i realised this with some customActivities already). Therefore, if the process is signaled to stop from outside, it has to stop right where it is, so that none of the remaining operations would be executed. Therefore i don't care, if the process is in a dead wait state. But i will change the state of the historyProcessInstance to "ended", so that it can be found as ended instance and will not be counted to the active ones.

            What would be your suggestion for using customActivity in this case?

            Anyway i'm afraid, that a further request would be, that this stop-function should work for any process. Not only those containing a special customActivity of me....

             

            Thanks in advance,

            Daniel