AnsweredAssumed Answered

Creating a process-loop results in an error

Question asked by goekan-t on Feb 17, 2011
Latest reply on Feb 17, 2011 by frederikheremans1
Hey,

the creation of loops in processes was already argued. But i have difficulties in implementing it:
When i complete the user-task the first time in the loop everything is alright.
When i try to complete it the second time i get an error like this:

Caused by: org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:42)
   at org.activiti.engine.impl.db.DbSqlSession.selectOne(DbSqlSession.java:175)
   at org.activiti.engine.impl.db.DbHistorySession.findHistoricActivityInstance(DbHistorySession.java:76)
   at org.activiti.engine.impl.history.HistoricFormPropertyEntity.<init>(HistoricFormPropertyEntity.java:45)
   at org.activiti.engine.impl.cmd.SubmitTaskFormCmd.execute(SubmitTaskFormCmd.java:63)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:37)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.FormServiceImpl.submitTaskFormData(FormServiceImpl.java:64)

The problem is, that there are two entries for the same activityId and processInstanceId in the history-table.
But the activiti-engine expects one entry.

So how can i solve this problem?

Outcomes