@Override
    public Object getAttribute(int[] position) {
        if (position[STREAM_ATTRIBUTE_TYPE_INDEX] == STATE_OUTPUT_DATA_INDEX) {
            return outputData[position[STREAM_ATTRIBUTE_INDEX_IN_TYPE]];
        } else {
            StreamEvent streamEvent = getStreamEvent(position);
            if (streamEvent == null) {
                return null;
            }
            switch (position[STREAM_ATTRIBUTE_TYPE_INDEX]) {
                case BEFORE_WINDOW_DATA_INDEX:
                    return streamEvent.getBeforeWindowData()[position[STREAM_ATTRIBUTE_INDEX_IN_TYPE]];
                case OUTPUT_DATA_INDEX:
                    return streamEvent.getOutputData()[position[STREAM_ATTRIBUTE_INDEX_IN_TYPE]];
                case ON_AFTER_WINDOW_DATA_INDEX:
                    return streamEvent.getOnAfterWindowData()[position[STREAM_ATTRIBUTE_INDEX_IN_TYPE]];
                default:
                    throw new IllegalStateException("STREAM_ATTRIBUTE_TYPE_INDEX cannot be " +
                            position[STREAM_ATTRIBUTE_TYPE_INDEX]);
            }
        }
    }
@param position int array of 3 or 4 elements
                int array of 3 : position[0]-which element of the streamEventSize array,
                position[1]-BeforeWindowData or OutputData or AfterWindowData,
                position[2]- which attribute
                int array of 4 : position[0]-which element of the streamEventSize array, position[1]-which
                event of the event chain,
                position[3]- BeforeWindowData or OutputData or AfterWindowData, position[4]- which attribute
@return Attribute
modules/siddhi-core/src/main/java/io/siddhi/core/event/state/StateEvent.java