public Object build(ComplexEvent complexEvent) {
        if (isObjectMessage) {
            return complexEvent.getOutputData()[objectIndex];
        } else {
            return formatMessage(complexEvent.getOutputData());
        }

    }
Template builder used by {@link SinkMapper} to generate custom payload.
modules/siddhi-core/src/main/java/io/siddhi/core/util/transport/TemplateBuilder.java