private static List<StateMappingElement> getMappingElements(MetaStateEvent metaStateEvent) {

        List<StateMappingElement> stateMappingElements = new ArrayList<StateMappingElement>(
                metaStateEvent.getOutputDataAttributes().size());

        List<MetaStateEventAttribute> currentDataList = metaStateEvent.getOutputDataAttributes();
        if (currentDataList != null) {
            int i = 0;
            for (MetaStateEventAttribute metaStateEventAttribute : currentDataList) {           //Only variable slots
                // will be filled.
                if (metaStateEventAttribute == null) {
                    i++;
                } else {
                    StateMappingElement stateMappingElement = new StateMappingElement();
                    stateMappingElement.setFromPosition(metaStateEventAttribute.getPosition());
                    int toPosition = i;
                    stateMappingElement.setToPosition(toPosition);
                    stateMappingElements.add(stateMappingElement);
                    i++;
                }
            }
        }
        return stateMappingElements;
    }
Constructs StateEventPopulator according to MetaStateEvent

@param metaComplexEvent info for populating the StateEvents
@return StateEventPopulator
modules/siddhi-core/src/main/java/io/siddhi/core/event/state/populater/StateEventPopulatorFactory.java