cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti signaling

vilmos_nagy
Champ in-the-making
Champ in-the-making
Hi!

I'm trying to use Activiti signals in my process, but without any success.

I've a process, where I'd like to use signals.


<signal id="processSignal" name="processSignal"></signal>
  <message id="processMsg" name="processMsg"></message>
  <process id="process" isExecutable="true">
  …
  <startEvent id="sid-ED86F819-9388-4FA7-99AD-BEDF84E3C014">
      <messageEventDefinition messageRef="processMsg"></messageEventDefinition>
    </startEvent>
   <intermediateCatchEvent id="sid-27EFF415-93A6-4787-AD24-D4D5112D74C1">
      <signalEventDefinition signalRef="processSignal"></signalEventDefinition>
    </intermediateCatchEvent>
  </process>


I start this process from my Java code, and would like to trigger the signal:

ProcessInstance processInstance = runtimeService.startProcessInstanceByMessage(processName);
runtimeService.signalEventReceived(signalName, processInstance.getId());


Then the following exception is throwed:
org.activiti.engine.ActivitiException: Execution '22556' has not subscribed to a signal event with name 'processSignal'.


What am I doing wrong? Thanks!
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Vilmos,

There is no need to start process instance at the beginning. Use

    // using startProcessInstanceByMessage triggers the message start event
   
    ProcessInstance processInstance = runtimeService.startProcessInstanceByMessage("newInvoiceMessage");
org.activiti.engine.test.bpmn.event.message.MessageStartEventTest#testSingleMessageStartEvent
Regards
Martin