@Override
    public Object execute(ComplexEvent event) {
        try {
            Boolean condition = Boolean.TRUE.equals(attributeExpressionExecutors[0].execute(event));
            return execute(
                    new Object[]{
                            condition,
                            (condition) ? attributeExpressionExecutors[1].execute(event) : null,
                            (!condition) ? attributeExpressionExecutors[2].execute(event) : null
                    });
        } catch (Exception e) {
            throw new SiddhiAppRuntimeException(e.getMessage() + ". Exception on class '" + this.getClass().getName()
                    + "'", e);
        }
    }
Executor class for ifThenElse function. Function execution logic is implemented in execute here.
modules/siddhi-core/src/main/java/io/siddhi/core/executor/function/IfThenElseFunctionExecutor.java