lib/AdaptationEngine.js
function (element) {
		if (element) {
			if (element.metaClassName() === 'org.kevoree.ComponentInstance') {
				// if parent is this node platform: it's ok
				return (element.eContainer().name === this.node.getName());

			} else if (element.metaClassName() === 'org.kevoree.Channel') {
				// if this channel has bindings with components hosted in this node platform: it's ok
				var bindings = element.bindings.iterator();
				while (bindings.hasNext()) {
					var binding = bindings.next();
					if (binding.port && binding.port.eContainer()) {
						if (this.isRelatedToPlatform(binding.port.eContainer())) {
							return true;
						}
					}
				}

			} else if (element.metaClassName() === 'org.kevoree.Group') {
				return element.subNodes.array.some(function (node) {
					return this.isRelatedToPlatform(node);
				}.bind(this));

			} else if (element.metaClassName() === 'org.kevoree.ContainerNode') {
				return ((element.name === this.node.getName()) || (element.host && element.host.name === this.node.getName()));

			} else if (element.metaClassName() === 'org.kevoree.MBinding') {
				if (element.port && element.port.eContainer()) {
					if (this.isRelatedToPlatform(element.port.eContainer())) {
						return true;
					}
				}
				if (element.hub) {
					return this.isRelatedToPlatform(element.hub);
				}

			} else if (element.metaClassName() === 'org.kevoree.Value') {
				if (element.eContainer().metaClassName() === 'org.kevoree.FragmentDictionary') {
					return (element.eContainer().name === this.node.getName());
				} else {
					return this.isRelatedToPlatform(element.eContainer().eContainer());
				}

			} else if (element.metaClassName() === 'org.kevoree.Port') {
				return this.isRelatedToPlatform(element.eContainer());
			}
		}
		return false;
	}
function (element) {
		if (element) {
			if (element.metaClassName() === 'org.kevoree.ComponentInstance') {
				// if parent is this node platform: it's ok
				return (element.eContainer().name === this.node.getName());

			} else if (element.metaClassName() === 'org.kevoree.Channel') {
				// if this channel has bindings with components hosted in this node platform: it's ok
				var bindings = element.bindings.iterator();
				while (bindings.hasNext()) {
					var binding = bindings.next();
					if (binding.port && binding.port.eContainer()) {
						if (this.isRelatedToPlatform(binding.port.eContainer())) {
							return true;
						}
					}
				}

			} else if (element.metaClassName() === 'org.kevoree.Group') {
				return element.subNodes.array.some(function (node) {
					return this.isRelatedToPlatform(node);
				}.bind(this));

			} else if (element.metaClassName() === 'org.kevoree.ContainerNode') {
				return ((element.name === this.node.getName()) || (element.host && element.host.name === this.node.getName()));

			} else if (element.metaClassName() === 'org.kevoree.MBinding') {
				if (element.port && element.port.eContainer()) {
					if (this.isRelatedToPlatform(element.port.eContainer())) {
						return true;
					}
				}
				if (element.hub) {
					return this.isRelatedToPlatform(element.hub);
				}

			} else if (element.metaClassName() === 'org.kevoree.Value') {
				if (element.eContainer().metaClassName() === 'org.kevoree.FragmentDictionary') {
					return (element.eContainer().name === this.node.getName());
				} else {
					return this.isRelatedToPlatform(element.eContainer().eContainer());
				}

			} else if (element.metaClassName() === 'org.kevoree.Port') {
				return this.isRelatedToPlatform(element.eContainer());
			}
		}
		return false;
	}
function ( element ) { if ( element ) { if ( element . metaClassName ( ) === 'org.kevoree.ComponentInstance' ) { // if parent is this node platform: it's ok return ( element . eContainer ( ) . name === this . node . getName ( ) ) ; } else if ( element . metaClassName ( ) === 'org.kevoree.Channel' ) { // if this channel has bindings with components hosted in this node platform: it's ok var bindings = element . bindings . iterator ( ) ; while ( bindings . hasNext ( ) ) { var binding = bindings . next ( ) ; if ( binding . port && binding . port . eContainer ( ) ) { if ( this . isRelatedToPlatform ( binding . port . eContainer ( ) ) ) { return true ; } } } } else if ( element . metaClassName ( ) === 'org.kevoree.Group' ) { return element . subNodes . array . some ( function ( node ) { return this . isRelatedToPlatform ( node ) ; } . bind ( this ) ) ; } else if ( element . metaClassName ( ) === 'org.kevoree.ContainerNode' ) { return ( ( element . name === this . node . getName ( ) ) || ( element . host && element . host . name === this . node . getName ( ) ) ) ; } else if ( element . metaClassName ( ) === 'org.kevoree.MBinding' ) { if ( element . port && element . port . eContainer ( ) ) { if ( this . isRelatedToPlatform ( element . port . eContainer ( ) ) ) { return true ; } } if ( element . hub ) { return this . isRelatedToPlatform ( element . hub ) ; } } else if ( element . metaClassName ( ) === 'org.kevoree.Value' ) { if ( element . eContainer ( ) . metaClassName ( ) === 'org.kevoree.FragmentDictionary' ) { return ( element . eContainer ( ) . name === this . node . getName ( ) ) ; } else { return this . isRelatedToPlatform ( element . eContainer ( ) . eContainer ( ) ) ; } } else if ( element . metaClassName ( ) === 'org.kevoree.Port' ) { return this . isRelatedToPlatform ( element . eContainer ( ) ) ; } } return false ; }
know if an modelElement is related to the current plarform node
@param element
@returns {boolean}
know if an modelElement is related to the current plarform node