ExecutableFlow flow = curr.getExecutableFlow();
final String flowId = flow.getId();
if(flowId.equals(jobId)) {
final String flowName = flow.getName();
try {
if(flow.cancel()) {
addMessage(req, "Cancelled " + flowName);
logger.info("Job '" + flowName + "' cancelled from gui.");
} else {
logger.info("Couldn't cancel flow '" + flowName + "' for some reason.");
addError(req, "Failed to cancel flow " + flowName + ".");