+ exclusions.add(join);
+ }
+ // This code excludes joins with flags to external
+ // diagrams that are not connected (have no
+ // configuration for the flag)
+ for (Resource flag2 : graph.getObjects(join, DIA.JoinsFlag)) {
+ Resource diagram2 = graph.getPossibleObject(flag2, L0.PartOf);
+ if (diagram2 != null) {
+ Resource comp = graph.getPossibleObject(diagram2, MOD.DiagramToComposite);
+ if (!resourceSet.contains(comp))
+ exclusions.add(join);
+ }
+ }
+ }
+ }
+
+ // Check all diagram monitor elements.
+ // Any components referenced that are external to the exported diagrams must be excluded from the export.
+ // This will leave the monitors without a monitored component but export and import will work anyway.
+ if (types.contains(DIA.Monitor)) {
+ for (Resource monitoredComponent : graph.getObjects(element, DIA.HasMonitorComponent)) {
+ Resource monitoredComponentComposite = graph.getPossibleObject(monitoredComponent, L0.PartOf);
+ if (monitoredComponentComposite != null && !resourceSet.contains(monitoredComponentComposite)) {
+ exclusions.add(monitoredComponent);