Deploy process about duplicate via restful api

Hi, i am new man to flowable engine, i want to deploy process via restful api, i found that if i redeploy the same bpmn xml file with same deploymentName,a new version process definition is still created.

I want to keep the current version if process xml file is not changed.

I know it can be done via java sdk, it restful way can not, so it is not support or any wrong when i call the restful api?

The new deployment is created even after throwing a ConstraintViolation:

21-07-29 Thu 09:46:55.941 ERROR 4132 [http-nio-8090-exec-5] --- [12d2f88e106d8938,12d2f88e106d8938] CommandContext                           : Error while closing command context
org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (ICEPOEODEV.SYS_C00826250) violated

### The error may exist in org/flowable/db/mapping/entity/Deployment.xml
### The error may involve org.flowable.engine.impl.persistence.entity.DeploymentEntityImpl.insertDeployment-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RE_DEPLOYMENT(ID_, NAME_, CATEGORY_, KEY_, TENANT_ID_, DEPLOY_TIME_, DERIVED_FROM_, DERIVED_FROM_ROOT_, PARENT_DEPLOYMENT_ID_, ENGINE_VERSION_)     values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
### Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (ICEPOEODEV.SYS_C00826250) violated

	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
	at org.flowable.common.engine.impl.db.DbSqlSession.flushRegularInsert(DbSqlSession.java:514)
	at org.flowable.common.engine.impl.db.DbSqlSession.flushInsertEntities(DbSqlSession.java:495)
	at org.flowable.common.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:478)
	at org.flowable.common.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:363)
	at org.flowable.common.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:211)
	at org.flowable.common.engine.impl.interceptor.CommandContext.close(CommandContext.java:69)
	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:92)
	at org.flowable.common.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:57)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
	at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57)
	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:35)
	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
	at org.flowable.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:99)
	at org.flowable.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:206)
	at org.flowable.rest.service.api.repository.DeploymentCollectionResource.uploadDeployment(DeploymentCollectionResource.java:222)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1060)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:962)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)

But to help you out, you can use the hook provided through the BpmnRestApiInterceptor.

public void enhanceDeployment(DeploymentBuilder deploymentBuilder) {

Where you have controll over the deployment through the DeploymentBuilder.

deploymentBuilder.enableDuplicateFiltering()