use of org.wso2.carbon.bpmn.rest.common.exception.BPMNRestException in project carbon-business-process by wso2.
the class ProcessInstanceService method createExecutionVariable.
@POST
@Path("/{processInstanceId}/variables")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response createExecutionVariable(@PathParam("processInstanceId") String processInstanceId, @Context HttpServletRequest httpServletRequest) {
Execution execution = getExecutionInstanceFromRequest(processInstanceId);
Response response;
try {
response = createExecutionVariable(execution, false, RestResponseFactory.VARIABLE_PROCESS, httpServletRequest);
} catch (IOException | ServletException e) {
throw new BPMNRestException("Exception occured during creating execution variable", e);
}
return response;
}
use of org.wso2.carbon.bpmn.rest.common.exception.BPMNRestException in project carbon-business-process by wso2.
the class ProcessInstanceService method updateBinaryVariable.
@PUT
@Path("/{processInstanceId}/variables/{variableName}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response updateBinaryVariable(@PathParam("processInstanceId") String processInstanceId, @PathParam("variableName") String variableName, MultipartBody multipartBody) {
Execution execution = getExecutionInstanceFromRequest(processInstanceId);
RestVariable result;
try {
result = setBinaryVariable(multipartBody, execution, RestResponseFactory.VARIABLE_PROCESS, false);
} catch (IOException | ServletException e) {
throw new BPMNRestException("Exception occured during creating binary execution variable", e);
}
return Response.ok().entity(result).build();
}
Aggregations