First of all - thanks for this amazing tool. Finally together with sysmlv2 it made crafting all models less “clicky” and more sustainable via textual notation. Now about the problem I am facing (I am not sure either it’s syside issue, or the lack of sysmlv2 knowledge on my side, or in general current sysmlv2 limitation).
I have a model, that have nested parts. Some of these parts have ports, and ports are connected through specific interfaces. I want a view that shows only parts that have these specific ports and corresponding interfaces. Played with filter, but either I get full blown diagram, or I get empty diagram. Any ideas how to achieve it?
Find my model example below:
package ViewFilterDemo {
// ---- definitions -----------------------------------------------------
port def DataPort;
port def PowerPort;
interface def DataLink {
end a : DataPort;
end b : DataPort;
}
interface def PowerLink {
end supply : PowerPort;
end consumer : PowerPort;
}
part def Controller {
port data : DataPort;
port power : PowerPort;
}
part def Sensor {
port data : DataPort;
port power : PowerPort;
}
part def Battery {
port power : PowerPort;
}
// ---- system ----------------------------------------------------------
part system {
part controller : Controller;
part sensor : Sensor;
part battery : Battery;
interface : DataLink connect sensor.data to controller.data;
interface : PowerLink connect battery.power to controller.power;
interface : PowerLink connect battery.power to sensor.power;
}
// ---- goal: a stakeholder view showing ONLY the data architecture ----
// Controller and sensor connected over DataLink interface, no PowerLink
view dataViewInclude {
expose system::**;
filter ???????????????;
render Views::asInterconnectionDiagram;
}
}
Hi, filter conditions need to be model-level evaluable as they run during import resolution. A model-level evaluable expression can only refer to metadata, which user-defined types like DataLink are not.
To achieve more granular filtering, you can adopt metadata tags or SemanticMetadata. Here’s an example: