String portName = castPort.getName();
Iterator entities = entityList().iterator();
if (entities.hasNext()) {
Entity insideEntity = (Entity) entities.next();
Port insidePort = insideEntity.getPort(portName);
if (insidePort == null) {
insidePort = insideEntity.newPort(portName);
if (insidePort instanceof IOPort) {
IOPort castInsidePort = (IOPort) insidePort;
castInsidePort.setInput(castPort.isInput());
castInsidePort.setOutput(castPort