Signal Event with variables

cancel
Showing results for 
Search instead for 
Did you mean: 
mdtabrezmca
Established Member II

Signal Event with variables

Jump to solution

Hi,

I have two process definations "SignalEvent1" and "SignalEvent2" from "SignalEvent1" I am Trying to throws intermediate throwing signal event with signal "SubIncidentAdd" and calling this rest api call with following payload

runtime/signals

{
  "signalName": "SubIncidentAdd",
  "tenantId" : "1",
  "async": false,
  "variables": [
      {"name": "test", "value": "catch the event "}

  ]
}

And in porcess defination "SignalEvent2" i have intermedetiate catching signal event which will catch this event and continue the execution with script task which will just print the variable "test" value.

Please note that i have started both the process definations before using rest api call

I am getting 204 status while trying the above rest api using postman

Please find the attchment of App where i have included both the process definations

1 Solution

Accepted Solutions
mdtabrezmca
Established Member II

Re: Signal Event with variables

Jump to solution

Another Alternate method to use is we can write a listener and directly call the following runtime service method

/**
   * Notifies the process engine that a signal event of name 'signalName' has been received. This method delivers the signal to a single execution, being the execution referenced by 'executionId'. The
   * waiting execution is notified synchronously.
   *
   * @param signalName
   *          the name of the signal event
   * @param executionId
   *          the id of the execution to deliver the signal to
   * @param processVariables
   *          a map of variables added to the execution(s)
   * @throws ActivitiObjectNotFoundException
   *           if no such execution exists.
   * @throws ActivitiException
   *           if the execution has not subscribed to the signal
   */
  void signalEventReceived(String signalName, String executionId, Map<String, Object> processVariables);

View solution in original post

2 Replies
mdtabrezmca
Established Member II

Re: Signal Event with variables

Jump to solution

Just an update as i am unable to get the response but the functionality is working fine with the /runtime/Signals Api.

mdtabrezmca
Established Member II

Re: Signal Event with variables

Jump to solution

Another Alternate method to use is we can write a listener and directly call the following runtime service method

/**
   * Notifies the process engine that a signal event of name 'signalName' has been received. This method delivers the signal to a single execution, being the execution referenced by 'executionId'. The
   * waiting execution is notified synchronously.
   *
   * @param signalName
   *          the name of the signal event
   * @param executionId
   *          the id of the execution to deliver the signal to
   * @param processVariables
   *          a map of variables added to the execution(s)
   * @throws ActivitiObjectNotFoundException
   *           if no such execution exists.
   * @throws ActivitiException
   *           if the execution has not subscribed to the signal
   */
  void signalEventReceived(String signalName, String executionId, Map<String, Object> processVariables);