5

I am using a send task to which the following Javadelegate class is attached.

public class SendTaskDelegate implements JavaDelegate {

  public void execute(DelegateExecution execution) throws Exception {

execution.getProcessEngineServices()
  .getRuntimeService()
  .createMessageCorrelation("someMessage")
  .processInstanceBusinessKey("someBusinessKey")
  .correlate();

  }

}

But I am getting this error::

An error happend while submitting the task form : Cannot submit task form c0e85bad-719f-11e5-94aa-d897baecf24a: Cannot correlate message someMessage: No process definition or execution matches the parameters

How can I debug it?

Siyual
  • 16,415
  • 8
  • 44
  • 58
pallavi
  • 95
  • 2
  • 9

1 Answers1

6

The error message says, that your JavaDelegate code just gets excuted correctly. The process engine tries to find a running process instance with 'someBusinessKey' as business key and currently waiting for a message 'someMessage', but does not find such an instance. Your code acts as if there were such an instance and you try to find it and tell it about a message. See the docs section about correlation methods - in principle the mechanism is used to 'route' a message to the correct instance targeting it.

As a sidenote: your JavaDelegate seems to get called in the same transaction with which you also try to complete a task. The "borders of transactions" in your process can be managed with 'async' attributes described in the docs section about transactions in processes.

Martin Schimak
  • 1,343
  • 7
  • 11
  • thank you ! your inputs helped me overcome that error. but in my workflow after the send task and receive task, I have certain user tasks. but after the send task starts the flow of control should go to the assignee of the user task which is not happening. that instance of task is not visible in cockpit after send task starts. Could you tell me why it is happening? – pallavi Oct 15 '15 at 05:13
  • I cannot tell you exactly what's happening without knowing the process or a new error message you see...I recommend that you start with a more simple process, e.g. just two User Tasks, one after the other, then step by step add more functionality. – Martin Schimak Oct 15 '15 at 20:46
  • 1
    In case you still see an exception in the send task, the process engine does not go to any subsequent task, but rolls back the transaction to the point were it was before! Could be that you just see this (expected, intended) effect... – Martin Schimak Oct 15 '15 at 20:47