Skip to content
Snippets Groups Projects
Commit 74530279 authored by Helena Jank's avatar Helena Jank
Browse files

+ added translations to unsatisfied attributes in order to extend search for relevant components

parent 9f5d860a
No related branches found
No related tags found
No related merge requests found
......@@ -618,7 +618,16 @@ define(['easejs', 'MathUuid','widget',
* @param {Array} _componentTypes An array of components classes that should be searched for (e.g. Widget, Interpreter and Aggregator).
*/
'private getComponentsForUnsatisfiedAttributeTypes': function(_unsatisfiedAttributes, _all, _componentTypes) {
// ask the discoverer for components that satisfy the requested components
var attrs = _unsatisfiedAttributes.getItems();
var translations = this.discoverer.getTranslations();
for (attribute in attrs) {
for (translation in translations) {
_unsatisfiedAttributes.put(translations[translation].getSynonym(attrs[attribute]));
}
}
// ask the discoverer for components that satisfy the requested components
var relevantComponents = this.discoverer.getComponentsByAttributes(_unsatisfiedAttributes, _all, _componentTypes);
console.log("I found "+relevantComponents.length+" component(s) of type "+_componentTypes+" that might satisfy the requested attributes.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment