use of org.camunda.bpm.engine.runtime.SignalEventReceivedBuilder in project camunda-bpm-platform by camunda.
the class SignalRestServiceImpl method throwSignal.
@Override
public void throwSignal(SignalDto dto) {
String name = dto.getName();
if (name == null) {
throw new InvalidRequestException(Status.BAD_REQUEST, "No signal name given");
}
SignalEventReceivedBuilder signalEvent = createSignalEventReceivedBuilder(dto);
signalEvent.send();
}
use of org.camunda.bpm.engine.runtime.SignalEventReceivedBuilder in project camunda-bpm-platform by camunda.
the class SignalRestServiceImpl method createSignalEventReceivedBuilder.
protected SignalEventReceivedBuilder createSignalEventReceivedBuilder(SignalDto dto) {
RuntimeService runtimeService = processEngine.getRuntimeService();
String name = dto.getName();
SignalEventReceivedBuilder signalEvent = runtimeService.createSignalEvent(name);
String executionId = dto.getExecutionId();
if (executionId != null) {
signalEvent.executionId(executionId);
}
Map<String, VariableValueDto> variablesDto = dto.getVariables();
if (variablesDto != null) {
Map<String, Object> variables = VariableValueDto.toMap(variablesDto, processEngine, objectMapper);
signalEvent.setVariables(variables);
}
String tenantId = dto.getTenantId();
if (tenantId != null) {
signalEvent.tenantId(tenantId);
}
boolean isWithoutTenantId = dto.isWithoutTenantId();
if (isWithoutTenantId) {
signalEvent.withoutTenantId();
}
return signalEvent;
}
Aggregations