public void process(Exchange exchange) throws Exception {
// get the id of the input
String id = exchange.getIn().getBody(InputReportIncident.class).getIncidentId();
// set reply including the id
OutputReportIncident output = new OutputReportIncident();
output.setCode("OK;" + id);
exchange.getOut().setBody(output);
}
})
.to("log:output");
// status incident
from("direct:statusIncident")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
// set reply
OutputStatusIncident output = new OutputStatusIncident();
output.setStatus("IN PROGRESS");
exchange.getOut().setBody(output);
}
})
.to("log:output");
}