io.automatiko.engine.service.exception.VariableViolationExceptionMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of automatiko-service Show documentation
Show all versions of automatiko-service Show documentation
Workflow as a Service - processes and decisions with Automatiko Engine
The newest version!
package io.automatiko.engine.service.exception;
import java.util.HashMap;
import java.util.Map;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
import io.automatiko.engine.api.workflow.VariableViolationException;
@Provider
public class VariableViolationExceptionMapper extends BaseExceptionMapper
implements ExceptionMapper {
@Override
public Response toResponse(VariableViolationException ex) {
VariableViolationException exception = (VariableViolationException) ex;
Map response = new HashMap<>();
response.put(MESSAGE, exception.getMessage() + " : " + exception.getErrorMessage());
response.put(PROCESS_INSTANCE_ID, exception.getProcessInstanceId());
response.put(VARIABLE, exception.getVariableName());
return badRequest(response);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy