Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CorrelationMessage BusinessKey default value #70

Open
Sashiri opened this issue Jan 21, 2021 · 0 comments
Open

CorrelationMessage BusinessKey default value #70

Sashiri opened this issue Jan 21, 2021 · 0 comments

Comments

@Sashiri
Copy link

Sashiri commented Jan 21, 2021

Hi, the code snippet below won't work cause BusinessKey default value is set to "".
Camunda will try to look for processInstanceId with BusinessKey == "" and that will most likely fail

var camundaClient = CreateCamundaClient();
var processInstanceId = await GetProcessInstanceIdByUniqueVariable("uniqueVariable", uniqueVariableValue);
var message = new CorrelationMessage() { ProcessInstanceId = processInstanceId, MessageName = "messageName"};
await camundaClient.Messages.DeliverMessage(message);

Maybe you should consider deleting default value
Sending this JSON directly to camunda rest engine will succeed, executing (in my case interrupting) message in given process instance

{
  "messageName": "messageName",
  "processInstanceId": "processInstanceId"
}

Ofc. following will also work

{
  "messageName": "messageName",
  "processInstanceId": "processInstanceId",
  "businessKey": null
}

Setting BusinessKey to null in constructor will also work, but doing that is not obvious.

var camundaClient = CreateCamundaClient();
var processInstanceId = await GetProcessInstanceIdByUniqueVariable("uniqueVariable", uniqueVariableValue);
var message = new CorrelationMessage() { 
  ProcessInstanceId = processInstanceId, 
  MessageName = "messageName", 
  BuisnessKey = null
};
await camundaClient.Messages.DeliverMessage(message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant