In Xtend, is it possible to break the loop or check to end the loop?
«FOR e:d.entitys» «FOR a:e.attributes» «IF a.eClass.name.contentEquals('Something')» «e.name» "This output should be output one for each Entity e" «ENDIF» «ENDFOR» «ENDFOR»
My conclusion:
Entity 1 "This output should be output one for each Entity e" Entity 1 "This output should be output one for each Entity e" Entity 1 "This output should be output one for each Entity e" Entity 2 "This output should be output one for each Entity e" Entity 4 "This output should be output one for each Entity e" Entity 4 "This output should be output one for each Entity e"
But I want:
Entity 1 "This output should be output one for each Entity e" Entity 2 "This output should be output one for each Entity e" Entity 4 "This output should be output one for each Entity e"
How can my desired result be realized? I heard that you can call another method or something similar, but I don’t know how to do this, can someone show me some code for this problem? Thanks:)
source share