Deployment having same version, hence getting 2 process definitions match the correlations keys

No error while deployment. but when invoking process definition getting below error,

Caused by: org.camunda.bpm.engine.MismatchingMessageCorrelationException: ENGINE-13030 Cannot correlate a message with name ‘traxDealEvalInitEvent’ to a single process definition. 2 process definitions match the correlations keys: CorrelationSet [businessKey=46182, processInstanceId=null, processDefinitionId=null, correlationKeys=null, localCorrelationKeys=null, tenantId=null, isTenantIdSet=false]
at org.camunda.bpm.engine.impl.cmd.CommandLogger.exceptionCorrelateMessageToSingleProcessDefinition(CommandLogger.java:193) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.runtime.DefaultCorrelationHandler.correlateMessage(DefaultCorrelationHandler.java:62) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd$2.call(CorrelateMessageCmd.java:83) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd$2.call(CorrelateMessageCmd.java:81) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:537) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:81) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:42) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:46) ~[camunda-engine-spring-7.12.0.jar!/:7.12.0]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44) ~[camunda-engine-spring-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.execute(MessageCorrelationBuilderImpl.java:313) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.correlateWithResult(MessageCorrelationBuilderImpl.java:224) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.correlate(MessageCorrelationBuilderImpl.java:212) ~[camunda-engine-7.12.0.jar!/:7.12.0]

Suspecting this error is because of duplicate Deployment version (Seeing same version of the deployment)

image

Please specify the call you’re making to trigger the message.

Can you pls give a sample. More info on the error message

org.camunda.bpm.engine.MismatchingMessageCorrelationException: ENGINE-13030 Cannot correlate a message with name ‘traxDealEvalInitEvent’ to a single process definition. 2 process definitions match the correlations keys: CorrelationSet [businessKey=46188, processInstanceId=null, processDefinitionId=null, correlationKeys=null, localCorrelationKeys=null, tenantId=null, isTenantIdSet=false]
at org.camunda.bpm.engine.impl.cmd.CommandLogger.exceptionCorrelateMessageToSingleProcessDefinition(CommandLogger.java:193) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.runtime.DefaultCorrelationHandler.correlateMessage(DefaultCorrelationHandler.java:62) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd$2.call(CorrelateMessageCmd.java:83) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd$2.call(CorrelateMessageCmd.java:81) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:537) [camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:81) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:42) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28) ~[camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110) [camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:46) [camunda-engine-spring-7.12.0.jar!/:7.12.0]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) [spring-tx-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44) [camunda-engine-spring-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70) [camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) [camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.execute(MessageCorrelationBuilderImpl.java:313) [camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.correlateWithResult(MessageCorrelationBuilderImpl.java:224) [camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.correlate(MessageCorrelationBuilderImpl.java:212) [camunda-engine-7.12.0.jar!/:7.12.0]
at org.camunda.bpm.engine.impl.RuntimeServiceImpl.correlateMessage(RuntimeServiceImpl.java:662) [camunda-engine-7.12.0.jar!/:7.12.0]
at com.dbs.opal.eval.workflow.CamundaWorkflowManagerImpl.init(CamundaWorkflowManagerImpl.java:69) [classes!/:?]
at com.dbs.opal.eval.processor.OpalInboundDealProcessor.process(OpalInboundDealProcessor.java:46) [classes!/:?]
at org.apache.camel.component.bean.AbstractBeanProcessor.process(AbstractBeanProcessor.java:119) [camel-core-2.24.3.jar!/:2.24.3]
at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:53) [camel-core-2.24.3.jar!/:2.24.3]
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) [camel-core-2.24.3.jar!/:2.24.3]

Even unable to delete the duplicate deployment by id. Getting “ProcessEngineException” while trying to delete.

I think you’re sending the message incorrectly by not correlating based on the correct variables.

Can you please bit elaborate on this. As we have been deploying 10 versions in 3 months. And following same kind of correlation so far with no issues. but suddenly this started occurring.

processVarMap.put(“CMDA_WORKFLOW_PARAM”, paramBean);
runtimeService.correlateMessage(workflowProcessId, String.valueOf(appDao.getCmdaTaskSequence()), processVarMap);

What exactly is that variable? and where is it coming form?

You should avoid using the processes instance id for correlating messages - you should instead being using a business key.

Actually, i am using
correlateMessage(String messageName, String businessKey, Map<String, Object> processVariables)

In my code,
String.valueOf(appDao.getCmdaTaskSequence()) -> supplies unique “businesskey” sequence from DB
messageName -> “Message name” of Message start event
processVariables -> Process variables

Please let me know if anything wrong in this implementation

OK - what version of camunda are you using?
The method you should be using is:

          ProcessEngine()
                .getRuntimeService()
                .createMessageCorrelation("MessageName")
                .processInstanceBusinessKey("BusKey")
                .setVariables(VariableMap);

Yes. exactly. I am using the same method mentioned by you.
Please find version detail below,
BPM Platform : 7.12
camunda.spring.boot.starter.version - 3.4.0

Have you queried the engine to check who many instance with the same business key are running?

No. I haven’y tried. But I tried to delete duplicate deployment created by deployment id. But, was getting internal server error. After i noticed the duplicate version (in the image shown above), i was only focused on that.
Is it possible, to merge latest deployment with existing deployed instead of creating new version by not losing data.

You should be able to re-deploy the older version - which would create a 12th version and all new instances should start on and then migrate the running instances from the old version to the new one.

Sorry to bother. Is it possible to provide any steps/guide for this. Also, we are using Camunda-SpringBoot embedded and do not find option to migrate the running instances from the old version in the cockpit.[In one of your video tutorial i saw that option. However, i am unable to find it]

You can follow this guide and if you like you can use the REST API instead of the java api

Thanks for your prompt reply, to migrate i used below REST body,

{
“migrationPlan”: {
“sourceProcessDefinitionId”: “Process_1xq8ufk:1:bc6cec82-6db3-11ea-bdce-c85b76de96a9”,
“targetProcessDefinitionId”: “Process_1xq8ufk:2:1d992975-6f38-11ea-9b36-c85b76de96a9”
},
“processInstanceIds”: [
“Process_1xq8ufk”,
“Process_1xq8ufk”
],
“skipCustomListeners”: true
}

For, “processInstanceIds” what should we mention. I guess it’s pending user task instances. If it is we have more than 100 pending user tasks in the previous deployment version

{
“links”: [],
“id”: “1d506099-6f38-11ea-9b36-c85b76de96a9”,
“name”: “OPALEvalAppMain”,
“source”: “process application”,
“deploymentTime”: “2020-03-26T16:02:18.812+0800”,
“tenantId”: null
}

Hi Niall,

Migration doesnt work for me as we have more pending user tasks.
Is there a way (settings) automatically perform migration while deployment?
When we end up a situation where we get duplicate deployment version as shown below, what will be mitigation plan?
image

Kindly assist.