@Override
    protected FieldValue doGet(String fieldName, EventWithContext eventWithContext) {
        final ImmutableMap.Builder<String, Object> dataModelBuilder = ImmutableMap.builder();

        if (eventWithContext.messageContext().isPresent()) {
            dataModelBuilder.put("source", eventWithContext.messageContext().get().getFields());
        } else if (eventWithContext.eventContext().isPresent()) {
            dataModelBuilder.put("source", eventWithContext.eventContext().get().toDto().fields());
        }

        final ImmutableMap<String, Object> dataModel = dataModelBuilder.build();

        if (!isValidTemplate(config.template(), dataModel)) {
            return FieldValue.error();
        }

        try {
            return FieldValue.string(templateEngine.transform(config.template(), dataModel));
        } catch (Exception e) {
            LOG.error("Couldn't render field template \"{}\"", config.template(), e);
            return FieldValue.error();
        }
    }
@Test
    @Ignore("template engine doesn't support expressions")
    public void templateCalculation() {
        final TestEvent event = new TestEvent();
        final EventWithContext eventWithContext = EventWithContext.create(event, newMessage(ImmutableMap.of("bytes", 1024)));

        final FieldValue fieldValue = newTemplate("${source.bytes / 1024}").doGet("test", eventWithContext);

        assertThat(fieldValue.value()).isEqualTo("1");
    }