public void batchRelate(
      ModelRoot modelRoot, boolean relateProxies, boolean notifyChanges, boolean searchAllRoots) {
    InstanceList instances = null;
    ModelRoot baseRoot = modelRoot;

    // R25
    Model_c relInst22327 =
        (Model_c) baseRoot.getInstanceList(Model_c.class).get(new Object[] {m_diagramid});
    // if there was no local element, check for any global elements
    // failing that proceed to check other model roots
    if (relInst22327 == null) {
      relInst22327 =
          (Model_c)
              Ooaofooa.getDefaultInstance()
                  .getInstanceList(Model_c.class)
                  .get(new Object[] {m_diagramid});
    }
    // synchronized
    if (relInst22327 != null) {
      if (relateProxies || !isProxy() || (inSameComponent(this, relInst22327) && !isProxy())) {
        relInst22327.relateAcrossR25To(this, notifyChanges);
      }
    }

    GraphicalElement_c relInst22328 =
        (GraphicalElement_c)
            baseRoot.getInstanceList(GraphicalElement_c.class).get(new Object[] {m_elementid});
    // if there was no local element, check for any global elements
    // failing that proceed to check other model roots
    if (relInst22328 == null) {
      relInst22328 =
          (GraphicalElement_c)
              Ooaofooa.getDefaultInstance()
                  .getInstanceList(GraphicalElement_c.class)
                  .get(new Object[] {m_elementid});
    }
    // synchronized
    if (relInst22328 != null) {
      if (relateProxies || !isProxy() || (inSameComponent(this, relInst22328) && !isProxy())) {
        relInst22328.relateAcrossR25To(this, notifyChanges);
      }
    }
  }