AToMPM / atompm

A Tool for Multi-Paradigm Modeling
https://atompm.github.io/
GNU Lesser General Public License v3.0
22 stars 15 forks source link

getAllNodes Should Return Subclass Nodes #91

Open BentleyJOakes opened 3 years ago

BentleyJOakes commented 3 years ago
  1. Create metamodel with A and B, B inherits from A
  2. Create a model with A's and B's
  3. Write a rule and have getAllNodes('A') in the LHS condition
  4. Observe that the B nodes are not returned.

Reason: In mmmk.js, lines 692-705, the '$type' of the node is directly matched against.

Proposal: getAllNodes should be extended with an extra boolean parameter 'includeSubclasses' which then instructs the function to include the sub class nodes.