Hi,
I am using camunda rest service call to delete a particular process definition. It takes care of it’s deployments as well. If there are deployments it’ll delete those too. But while trying to do so it’s running into following error :
org.camunda.bpm.engine.context - ENGINE-16004 Exception while closing command context: Expected one result (or null) to be returned by selectOne(), but found: 3
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 3
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:81)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectOne(DbSqlSession.java:117)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectOne(DbEntityManager.java:188)
at org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionManager.findLatestProcessDefinitionByKeyAndTenantId(ProcessDefinitionManager.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionManager.findLatestDefinitionByKeyAndTenantId(ProcessDefinitionManager.java:408)
at org.camunda.bpm.engine.impl.cmd.DeleteProcessDefinitionsByIdsCmd.isLatestProcessDefinition(DeleteProcessDefinitionsByIdsCmd.java:166)
at org.camunda.bpm.engine.impl.cmd.DeleteProcessDefinitionsByIdsCmd.findNewLatestProcessDefinition(DeleteProcessDefinitionsByIdsCmd.java:147)
at org.camunda.bpm.engine.impl.cmd.DeleteProcessDefinitionsByIdsCmd.deleteProcessDefinitions(DeleteProcessDefinitionsByIdsCmd.java:181)
at org.camunda.bpm.engine.impl.cmd.DeleteProcessDefinitionsByIdsCmd.execute(DeleteProcessDefinitionsByIdsCmd.java:100)
at org.camunda.bpm.engine.impl.persistence.entity.DeploymentManager$1.call(DeploymentManager.java:119)
at org.camunda.bpm.engine.impl.persistence.entity.DeploymentManager$1.call(DeploymentManager.java:111)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:477)
at org.camunda.bpm.engine.impl.persistence.entity.DeploymentManager.deleteDeployment(DeploymentManager.java:111)
at org.camunda.bpm.engine.impl.cmd.DeleteDeploymentCmd.execute(DeleteDeploymentCmd.java:75)
at org.camunda.bpm.engine.impl.cmd.DeleteDeploymentCmd.execute(DeleteDeploymentCmd.java:43)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:27)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:106)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:45)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:43)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:69)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.RepositoryServiceImpl.deleteDeployment(RepositoryServiceImpl.java:122)
at org.camunda.bpm.engine.rest.sub.repository.impl.DeploymentResourceImpl.deleteDeployment(DeploymentResourceImpl.java:151)
This call works fine if it has only one published version. Can anybody help me in this ??