cancel
Showing results for 
Search instead for 
Did you mean: 

Rest API Signal execution with variables

ybrukau
Champ in-the-making
Champ in-the-making
Hello,

It looks like there is no analog of
RuntimeService.signal(String executionId, Map<String,Object> processVariables)
provided by Rest API.
I checked the source code and there is next implementation of
ExecutionResource.performExecutionAction
(line 48)

    if(ExecutionActionRequest.ACTION_SIGNAL.equals(actionRequest.getAction())) {
      ActivitiUtil.getRuntimeService().signal(execution.getId());
    } else if



So there is no check if variables presented or no.
It is an easy fix. Should I create a jira about it and if yes than where? I could submit patch for the issue if needed.

Thanks a lot,
Yury
2 REPLIES 2

ybrukau
Champ in-the-making
Champ in-the-making
One more thing. In the meantime I am trying to use old rest API and to do POST to <i>process-instance/${processInstanceId}/signal</i> with request body like this:
<java>
{
  "activityId":"receivetask1",
  "variable1":"value",
  "variable2":"value"
}
</java>

And the response is <blockcode>{"errorMessage":"Forbidden","statusCode":403}</blockcode>
And even GET to <i>process-instance/${processInstanceId}</i> returns the same. But GET to <i>process-instance/${processInstanceId}/diagram</i> returns expected diagram.

Do you have any idea for this behavior? Do any of old API not available any more?

Any help appreciated,
Yury

frederikherema1
Star Contributor
Star Contributor
Thanks for pointing that out. Indeed, the variables are only used in the signalEventReceived, not the plain old signal. Current workaround is to either use the OLD API or do 2 rest-calls: first set variables and signal in the second call, although this is not an"atomic" operation anymore. I've fixed this on master.

About your second question:


protected Status getAuthenticationFailureStatus() {
    return Status.CLIENT_ERROR_FORBIDDEN;
  }

It seems that you're request does not contain valid login-credentials authenticated… What client are you using? The diagram is returned because this requires NO authentication (to be able to embed in HTML, where an img cannot do BASIC authentication).