public void populateComplexEvent(ComplexEvent complexEvent, Object[] data) {
        for (StreamMappingElement mappingElement : streamMappingElements) {
            populateStreamEvent(complexEvent, data[mappingElement.getFromPosition()], mappingElement.getToPosition());
        }
    }
The populater class that populates StateEvents
modules/siddhi-core/src/main/java/io/siddhi/core/event/stream/populater/SelectiveComplexEventPopulater.java