use of io.siddhi.core.util.error.handler.model.ErroneousEvent in project siddhi by wso2.
the class TestSourceOptionSourceMapper method mapAndProcess.
@Override
protected void mapAndProcess(Object eventObject, InputEventHandler inputEventHandler) throws MappingFailedException, InterruptedException {
if (eventObject != null) {
if (eventObject instanceof Event) {
Event event = ((Event) eventObject);
event.getData()[0] = sourceOptionHolder.validateAndGetOption("topic").getValue(event);
event.getData()[1] = sourceType;
inputEventHandler.sendEvent((Event) eventObject);
} else {
throw new MappingFailedException(Collections.singletonList(new ErroneousEvent(eventObject, "Event object must be Event " + "but found " + eventObject.getClass().getCanonicalName())));
}
}
}
Aggregations