Tasklist is empty

I am executing this message fine using
http://localhost:8080/rest/message

{
“messageName” : “AskShiva”,
“businessKey” : “aBusinessKey”,
“processVariables” : {
“question” : {“value” : “\n {\n "address": {\n "address1": "3388 Einstein Square",\n "address2": "Heinz Weigenzhul Lane",\n "city": "Pforzheim",\n "postalcode": 55555,\n "state": "Germany",\n "country":"Comal Germany",\n "id":2\n },\n "age": 6,\n "email": "marco@Bunte.com",\n "first_name": "Marco",\n "last_name": "Bunte",\n "phone": "333-222-8888",\n "person_id": 199\n }\n”,
“type”: “String”,
“valueInfo” : { “transient” : true } },
“anotherVariable” : {“value” : true, “type”: “Boolean”}
}
}

MY Tasklist is empty. In otherwords, I am not able to do anything that I see in the tutorial h

7 Tutorial: Process Communication

Also, in my view a human task must wait for user input before proceeding. Where is this happening in your tutorial ?

{
“type”: “RestException”,
“message”: “org.camunda.bpm.engine.MismatchingMessageCorrelationException: ENGINE-13031 Cannot correlate a message with name ‘ShivaKnows’ to a single execution. 2 executions match the correlation keys: CorrelationSet [businessKey=22, processInstanceId=null, processDefinitionId=null, correlationKeys=null, localCorrelationKeys=null, tenantId=null, isTenantIdSet=false]”
}

What do you see in cockpit exactly?

Hi @shkrish,

Please have a look at below post

I see 19 processes. The blue Icon is on the gateway. I am trying to call the message called Shivaknows. It is telling me the following

{
“type”: “RestException”,
“message”: “org.camunda.bpm.engine.MismatchingMessageCorrelationException: ENGINE-13031 Cannot correlate a message with name ‘ShivaKnows’ to a single execution. 2 executions match the correlation keys: CorrelationSet [businessKey=22, processInstanceId=null, processDefinitionId=null, correlationKeys=null, localCorrelationKeys=null, tenantId=null, isTenantIdSet=false]”
}

This means that you have 2 instances that match the message so the sending fails.
You can add all = true to your rest call and it will trigger everything.

The reason you don’t see anything in tasklist is because you don’t have any Human Tasks.

I am trying to understand what an instance means. I am firing these commands from postman as you saw. I have a User task that says answer the question. In your tutorial, I saw that you were seeing a whole bunch of tasks. I have somewhat replicated your tutorial with some very minor modifications. thats all.

If there is an instance waiting on the event based gateway - only a message can move the token further.
If you saw a token waiting at the user task, it would mean that the user task has been activated and it would be visible in tasklist.
At the moment - from what you’ve said you haven’t been able to successfully send a message and so the process has not moved on to the user task and therefore is has not been activated.

From the documentation


all - A Boolean value that indicates whether the message should be correlated to exactly one entity or multiple entities.
What is an entity ?

In this context it is any token waiting for a message.
Can you upload your model here?

MessageEvent.bpmn (5.2 KB)
payment.bpmn (6.6 KB)

http://localhost:8080/rest/process-definition/key/retrievePerson/start

payload

{
“variables”:{
“person” : {
“value” : “\n {\n “address”: {\n “address1”: “3388 Einstein Square”,\n “address2”: “Heinz Weigenzhul Lane”,\n “city”: “Pforzheim”,\n “postalcode”: 55555,\n “state”: “Germany”,\n “country”:“Comal Germany”,\n “id”:2\n },\n “age”: 6,\n “email”: "marco@Bunte.com”,\n “first_name”: “Marco”,\n “last_name”: “Bunte”,\n “phone”: “333-222-8888”,\n “person_id”: 199\n }\n",
“type”: “json”

}

},
“businessKey” : “myBusinessKey”,
“withVariablesInReturn”: true
}

http://localhost:8080/rest/message

payload

{
“messageName” : “ShivaKnows”,
“businessKey” : “22”,
“processVariables” : {
“question” : {“value” : “\n {\n “address”: {\n “address1”: “3388 Einstein Square”,\n “address2”: “Heinz Weigenzhul Lane”,\n “city”: “Pforzheim”,\n “postalcode”: 55555,\n “state”: “Germany”,\n “country”:“Comal Germany”,\n “id”:2\n },\n “age”: 6,\n “email”: "marco@Bunte.com”,\n “first_name”: “Marco”,\n “last_name”: “Bunte”,\n “phone”: “333-222-8888”,\n “person_id”: 199\n }\n",
“type”: “String”,
“valueInfo” : { “transient” : true } },
“anotherVariable” : {“value” : true, “type”: “Boolean”}
}
}

both of them work. However, the message one does not anymore as you saw the error above.

package SpringBootDemo;

import java.util.logging.Logger;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;

public class AskShivaDelegate implements JavaDelegate {

private final static Logger LOGGER = Logger.getLogger("LOAN-REQUESTS");

public void execute(DelegateExecution execution) throws Exception 
{
	execution.removeVariable("isOld");
	String message = execution.getVariables().values().toString();
	
	LOGGER.info("AskShivaDelegate 1" + execution.getVariables());
	LOGGER.info("AskShivaDelegate 2: " + execution.getVariables().values());
	
	execution.getProcessEngineServices().getRuntimeService()
	.createMessageCorrelation("AskShiva")
	.setVariable("question", message).correlate();
}

}

package SpringBootDemo;

import java.util.logging.Logger;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;

public class AskQuestion implements JavaDelegate {

private final static Logger LOGGER = Logger.getLogger("LOAN-REQUESTS");

public void execute(DelegateExecution execution) throws Exception 
{
	LOGGER.info("AskQuestion 1" + execution.getVariables());
	LOGGER.info("AskQuestion 2: " + execution.getVariables().values());
}

}

The issue was with this code

public class AskShivaDelegate implements JavaDelegate {

private final static Logger LOGGER = Logger.getLogger("LOAN-REQUESTS");

public void execute(DelegateExecution execution) throws Exception 
{
	execution.removeVariable("isOld");
	String message = execution.getVariables().values().toString();
	LOGGER.info("Processing request by 1: " + execution.getBusinessKey());
	LOGGER.info("AskShivaDelegate 1" + execution.getVariables());
	LOGGER.info("AskShivaDelegate 2: " + execution.getVariables().values());
	
	execution.getProcessEngineServices().getRuntimeService()
	.createMessageCorrelation("AskShiva")
	.setVariable("question", message).correlateAll();
}

}

There is no business key being given to the message. How I can I attach a business key to this message like I do from post man.
Keep in mind that MessageEvent process calls the payment process by send a message shown above.