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

    // R9600
    Query_c relInst39590 =
        (Query_c) baseRoot.getInstanceList(Query_c.class).get(new Object[] {m_id});
    // if there was no local element, check for any global elements
    // failing that proceed to check other model roots
    if (relInst39590 == null) {
      relInst39590 =
          (Query_c)
              Ooaofooa.getDefaultInstance().getInstanceList(Query_c.class).get(new Object[] {m_id});
    }
    if (relInst39590 == null && searchAllRoots && !baseRoot.isCompareRoot()) {
      Ooaofooa[] roots = Ooaofooa.getInstances();
      for (int i = 0; i < roots.length; i++) {
        if (roots[i].isCompareRoot()) {
          // never use elements from any compare root
          continue;
        }
        relInst39590 = (Query_c) roots[i].getInstanceList(Query_c.class).get(new Object[] {m_id});
        if (relInst39590 != null) break;
      }
    }
    // synchronized
    if (relInst39590 != null) {
      if (relateProxies || !isProxy() || (inSameComponent(this, relInst39590) && !isProxy())) {
        relInst39590.relateAcrossR9600To(this, notifyChanges);
      }
    }
  }
  private void COMM_COMM_NewClassParticipant(IStructuredSelection selection) {
    // Assign the context selection variables with the action context
    // Assign the context selection variable with the action context
    Object context = selection.iterator().next();
    Communication_c v_comm = (Communication_c) context;
    PersistableModelComponent.ensureCoreDataTypesAvailable(v_comm.getModelRoot());

    TransactionUtil.TransactionGroup transactionGroup =
        TransactionUtil.startTransactionsOnSelectedModelRoots("New Class Participant");
    try {
      // Ensure that actions take place between Verifier Activity executions
      Ooaofooa.beginSaveOperation();
      if (((v_comm != null))) {

        if (v_comm != null) {
          v_comm.Newclassparticipant();
        } else {
          Throwable t = new Throwable();
          t.fillInStackTrace();
          CorePlugin.logError("Attempted to call an operation on a null instance.", t);
        }
      }

      // end critical section
      Ooaofooa.endSaveOperation();
      // catch all exceptions and cancel the transactions
    } catch (Exception e) {
      Ooaofooa.endSaveOperation();
      TransactionUtil.cancelTransactions(transactionGroup, e);
      CorePlugin.logError("Transaction: New Class Participant failed", e); // $NON-NLS-1$
    }
    TransactionUtil.endTransactions(transactionGroup);
  }
  // declare transform functions
  public void Dispose() {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Component Result Set",
        " Operation entered: ComponentResultSet::Dispose");
    final ModelRoot modelRoot = getModelRoot();
    Component_c v_component = Component_c.getOneC_COnR8007(this);

    ComponentVisibility_c[] v_elemVis = ComponentVisibility_c.getManyPE_CVSsOnR8008(this);

    ComponentVisibility_c v_elemV = null;
    for (int i37247 = 0; i37247 < v_elemVis.length; i37247++) {
      v_elemV = v_elemVis[i37247];

      PackageableElement_c v_pe = PackageableElement_c.getOnePE_PEOnR8004(v_elemV);

      if (v_elemV != null) {
        v_elemV.unrelateAcrossR8004From(v_component);
        v_elemV.unrelateAcrossR8004From(v_pe);
      } else {
        Throwable t = new Throwable();
        t.fillInStackTrace();
        CorePlugin.logError("Unrelate using attempted on null link class instance.", t);
      }

      this.unrelateAcrossR8008From(v_elemV);

      if (v_elemV != null) {
        // get the location of this element in the instance list
        // before deleting
        if (v_elemV.delete()) {
          Ooaofooa.getDefaultInstance()
              .fireModelElementDeleted(
                  new BaseModelDelta(Modeleventnotification_c.DELTA_DELETE, v_elemV));
        }
      } else {
        Throwable t = new Throwable();
        t.fillInStackTrace();
        CorePlugin.logError("Delete attempted on null instance.", t);
      }
    }

    this.unrelateAcrossR8007From(v_component);

    if (delete()) {
      Ooaofooa.getDefaultInstance()
          .fireModelElementDeleted(new BaseModelDelta(Modeleventnotification_c.DELTA_DELETE, this));
    }
  } // End dispose
  public void unrelateAcrossR518From(ModelClass_c target, boolean notifyChanges) {
    if (target == null) return;

    if (ModelClass == null) return; // already unrelated

    if (target != ModelClass) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CorePlugin.logError("Tried to unrelate from non-related instance across R518", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR518To(this);
    }

    if (ModelClass != null) {

      m_obj_id = ModelClass.getObj_id();
      if (IdAssigner.NULL_UUID.equals(m_obj_id)) {
        m_obj_id = ModelClass.getObj_idCachedValue();
      }
      ModelClass = null;
      target.removeRef();
      UmlProblem.removeXtUMLProblem(this, target);
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "518", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  public void unrelateAcrossR39From(DataType_c target, boolean notifyChanges) {
    if (target == null) return;

    if (ContainsDataType == null) return; // already unrelated

    if (target != ContainsDataType) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CorePlugin.logError("Tried to unrelate from non-related instance across R39", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR39To(this);
    }

    if (ContainsDataType != null) {

      m_dt_id = ContainsDataType.getDt_id();
      if (IdAssigner.NULL_UUID.equals(m_dt_id)) {
        m_dt_id = ContainsDataType.getDt_idCachedValue();
      }
      ContainsDataType = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "39", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  public void batchRelate(
      ModelRoot modelRoot, boolean relateProxies, boolean notifyChanges, boolean searchAllRoots) {
    InstanceList instances = null;
    ModelRoot baseRoot = modelRoot;

    // R301
    Graphelement_c relInst21771 =
        (Graphelement_c)
            baseRoot.getInstanceList(Graphelement_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 (relInst21771 == null) {
      relInst21771 =
          (Graphelement_c)
              Ooaofooa.getDefaultInstance()
                  .getInstanceList(Graphelement_c.class)
                  .get(new Object[] {m_elementid});
    }
    // synchronized
    if (relInst21771 != null) {
      if (relateProxies || !isProxy() || (inSameComponent(this, relInst21771) && !isProxy())) {
        relInst21771.relateAcrossR301To(this, notifyChanges);
      }
    }
  }
  public void relateAcrossR1013To(MessageArgument_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == IsSupertypeMessageArgument) return; // already related

    if (IsSupertypeMessageArgument != target) {

      Object oldKey = getInstanceKey();

      if (IsSupertypeMessageArgument != null) {

        IsSupertypeMessageArgument.clearBackPointerR1013To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "InformalArgument_c.relateAcrossR1013To(MessageArgument_c target)",
              "Relate performed across R1013 from Informal Argument to Message Argument without unrelate of prior instance.");
        }
      }

      IsSupertypeMessageArgument = target;
      m_arg_id = target.getArg_id();
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR1013To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "1013", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  public void unrelateAcrossR1013From(MessageArgument_c target, boolean notifyChanges) {
    if (target == null) return;

    if (IsSupertypeMessageArgument == null) return; // already unrelated

    if (target != IsSupertypeMessageArgument) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CorePlugin.logError("Tried to unrelate from non-related instance across R1013", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR1013To(this);
    }

    if (IsSupertypeMessageArgument != null) {

      m_arg_id = IsSupertypeMessageArgument.getArg_id();
      IsSupertypeMessageArgument = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "1013", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Example #9
0
  public static Ooaofooa getInstance(String id, boolean forceLoad) {
    Ooaofooa modelRoot = Ooaofooa.getInstance(id);

    if (forceLoad && isFileBasedID(id) && !modelRoot.isLoaded()) {
      String projectName = getProjectNameFromModelRootId(id);
      String fileName = getDomainFileNameFromModelRootId(id);
      IProject[] project_set = CorePlugin.getWorkspace().getRoot().getProjects();
      IFile content = null;
      for (int i = 0; i < project_set.length; ++i) {
        if (XtUMLNature.hasNature(project_set[i])) {
          if (project_set[i].getName().equals(projectName)) {
            IResource mdl_folder = project_set[i].findMember(MODELS_DIRNAME);
            IResource[] mdl_content = null;
            try {
              mdl_content = ((IFolder) mdl_folder).members();
            } catch (Exception e) {
              CorePlugin.logError("Problem accessing workspace ", e);
            }
            if (mdl_content != null) {
              for (int j = 0; j < mdl_content.length; ++j) {
                if (mdl_content[j] instanceof IFile) {
                  IFile selected = (IFile) mdl_content[j];
                  if (selected.getName().equals(fileName)) {
                    content = selected;
                    break;
                  }
                }
              }
            }
          }
        }
      }
      if (content != null) {
        modelRoot = getInstance(content, true);
        if (!modelRoot.loadedOk()) {
          modelRoot.delete();
          modelRoot = null;
        }
      }
    }

    return modelRoot;
  }
Example #10
0
  /** Returns the model-root associated with the content of the given file. */
  public static Ooaofooa getInstance(IFile file, boolean forceLoad) {
    boolean addExtension = false;
    String domainName = file.getName();
    IPath filePath = file.getFullPath();
    if (filePath.segmentCount() > 5) {
      domainName = filePath.removeLastSegments(filePath.segmentCount() - 4).lastSegment();
      addExtension = true;
    }

    final String id = createModelRootId(file.getProject(), domainName, addExtension);
    Ooaofooa modelRoot = (Ooaofooa) rootInstanceMap.get(id);
    if (modelRoot == null) {
      modelRoot = getInstance(id, false);
    }

    if (forceLoad && !modelRoot.isLoaded()) {
      modelRoot = loadInstanceFromFile(file);
    }
    return modelRoot;
  }
  /* (non-Javadoc)
   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
   */
  public void setPropertyValue(Object id, Object value) {
    boolean value_changed = false;
    String trans_name = "";
    Transaction tr = null;
    Ooaofooa modelRoot = (Ooaofooa) m_inst.getModelRoot();
    TransactionManager tm = TransactionManager.getSingleton();
    try {
      if (id.equals("Descrip")) {
        if (!value.toString().equals(m_inst.getDescrip())) {
          trans_name = "Change in property: 'Descrip' of Fork Join Node"; // $NON-NLS-1$
          tr = tm.startTransaction(trans_name, Ooaofooa.getDefaultInstance());
          value_changed = true;
          m_inst.setDescrip(value.toString());
        }
      } else if (id.equals("GuardCondition")) {
        if (!value.toString().equals(m_inst.getGuardcondition())) {
          trans_name = "Change in property: 'GuardCondition' of Fork Join Node"; // $NON-NLS-1$
          tr = tm.startTransaction(trans_name, Ooaofooa.getDefaultInstance());
          value_changed = true;
          m_inst.setGuardcondition(value.toString());
        }
      }

      // catch all exceptions and cancel the transaction
    } catch (Exception e) {
      // this can be null if there was
      // an exception starting the
      // transaction
      if (tr != null) {
        tm.cancelTransaction(tr, e);
        tr = null;
      }
      CorePlugin.logError("Transaction: " + trans_name + " could not complete", e);
    }
    if (tr != null) {
      if (value_changed) tm.endTransaction(tr);
      else tm.cancelTransaction(tr);
    }
  }
Example #12
0
  public static IPath getResourcePathFromModelRootId(String id) {
    if (!isFileBasedID(id)) {
      Ooaofooa modelRoot = (Ooaofooa) rootInstanceMap.get(id);
      if (modelRoot != null) {
        return modelRoot.getResourcePath();
      }
      return null;
    }

    String projectName = getProjectNameFromModelRootId(id);

    IPath path = new Path(projectName + "/" + MODELS_DIRNAME); // $$NON-NLS-1$$
    File file = path.toFile();

    try {
      path = new Path(file.getCanonicalPath());
    } catch (IOException e) {
      path = null;
    }

    return path;
  }
  public void setType(int newValue) {
    if (m_type == newValue) {
      return;
    }
    AttributeChangeModelDelta change =
        new AttributeChangeModelDelta(
            Modeleventnotification_c.DELTA_ATTRIBUTE_CHANGE,
            this,
            "Type",
            new Integer(m_type),
            new Integer(newValue),
            false);

    m_type = newValue;
    Ooaofooa.getDefaultInstance().fireModelElementAttributeChanged(change);
  }
  // declare transform functions
  public String Get_name() {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Instance State Machine",
        " Operation entered: InstanceStateMachine::Get_name");
    final ModelRoot modelRoot = getModelRoot();
    ModelClass_c v_obj = ModelClass_c.getOneO_OBJOnR518(this);

    if (((v_obj != null))) {

      return v_obj.getName();

    } else {

      return Ooaofooa.Getorphanedelementname(modelRoot);
    }
  } // End get_name
 public void setId(java.util.UUID newValue) {
   if (newValue != null) {
     if (newValue.equals(m_id)) {
       return;
     }
   } else if (m_id != null) {
     if (m_id.equals(newValue)) {
       return;
     }
   } else {
     return;
   }
   AttributeChangeModelDelta change =
       new AttributeChangeModelDelta(
           Modeleventnotification_c.DELTA_ATTRIBUTE_CHANGE, this, "Id", m_id, newValue, true);
   m_id = IdAssigner.preprocessUUID(newValue);
   Ooaofooa.getDefaultInstance().fireModelElementAttributeChanged(change);
 }
 public void setName(String newValue) {
   if (newValue != null) {
     if (newValue.equals(m_name)) {
       return;
     }
   } else if (m_name != null) {
     if (m_name.equals(newValue)) {
       return;
     }
   } else {
     return;
   }
   AttributeChangeModelDelta change =
       new AttributeChangeModelDelta(
           Modeleventnotification_c.DELTA_ATTRIBUTE_CHANGE, this, "Name", m_name, newValue, false);
   m_name = newValue;
   Ooaofooa.getDefaultInstance().fireModelElementAttributeChanged(change);
 }
  public void relateAcrossR518To(ModelClass_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == ModelClass) return; // already related

    if (ModelClass != target) {

      Object oldKey = getInstanceKey();

      if (ModelClass != null) {
        UmlProblem.removeXtUMLProblem(this, ModelClass);

        ModelClass.clearBackPointerR518To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "InstanceStateMachine_c.relateAcrossR518To(ModelClass_c target)",
              "Relate performed across R518 from Instance State Machine to Model Class without unrelate of prior instance.");
        }
      }

      ModelClass = target;
      if (IdAssigner.NULL_UUID.equals(target.getObj_id())) {
        // do not update cached value
      } else {
        // update cached value
        m_obj_id = target.getObj_idCachedValue();
      }
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR518To(this);
      target.addRef();
      UmlProblem.handleDanglingReference(this, target);
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "518", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  public void relateAcrossR39To(DataType_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == ContainsDataType) return; // already related

    if (ContainsDataType != target) {

      Object oldKey = getInstanceKey();

      if (ContainsDataType != null) {

        ContainsDataType.clearBackPointerR39To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "DataTypeInPackage_c.relateAcrossR39To(DataType_c target)",
              "Relate performed across R39 from Data Type in Package to Data Type without unrelate of prior instance.");
        }
      }

      ContainsDataType = target;
      if (IdAssigner.NULL_UUID.equals(target.getDt_id())) {
        // do not update cached value
      } else {
        // update cached value
        m_dt_id = target.getDt_idCachedValue();
      }
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR39To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "39", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  public void relateAcrossR4202To(Component_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == CanBeNestedInComponent) return; // already related

    if (CanBeNestedInComponent != target) {

      Object oldKey = getInstanceKey();

      if (CanBeNestedInComponent != null) {

        CanBeNestedInComponent.clearBackPointerR4202To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "ComponentInComponent_c.relateAcrossR4202To(Component_c target)",
              "Relate performed across R4202 from Component in Component to Component without unrelate of prior instance.");
        }
      }

      CanBeNestedInComponent = target;
      if (IdAssigner.NULL_UUID.equals(target.getId())) {
        // do not update cached value
      } else {
        // update cached value
        m_parent_id = target.getIdCachedValue();
      }
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR4202To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "4202", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  public void batchRelate(
      ModelRoot modelRoot, boolean relateProxies, boolean notifyChanges, boolean searchAllRoots) {
    InstanceList instances = null;
    ModelRoot baseRoot = modelRoot;

    // R603
    Statement_c relInst40372 =
        (Statement_c)
            baseRoot.getInstanceList(Statement_c.class).get(new Object[] {m_statement_id});
    // if there was no local element, check for any global elements
    // failing that proceed to check other model roots
    if (relInst40372 == null) {
      relInst40372 =
          (Statement_c)
              Ooaofooa.getDefaultInstance()
                  .getInstanceList(Statement_c.class)
                  .get(new Object[] {m_statement_id});
    }
    if (relInst40372 == null && searchAllRoots && !baseRoot.isCompareRoot()) {
      Ooaofooa[] roots = Ooaofooa.getInstances();
      for (int i = 0; i < roots.length; i++) {
        if (roots[i].isCompareRoot()) {
          // never use elements from any compare root
          continue;
        }
        relInst40372 =
            (Statement_c)
                roots[i].getInstanceList(Statement_c.class).get(new Object[] {m_statement_id});
        if (relInst40372 != null) break;
      }
    }
    // synchronized
    if (relInst40372 != null) {
      if (relateProxies || !isProxy() || (inSameComponent(this, relInst40372) && !isProxy())) {
        relInst40372.relateAcrossR603To(this, notifyChanges);
      }
    }

    if (IsAnInvocationOfBridge == null) {
      // R674
      Bridge_c relInst40373 =
          (Bridge_c) baseRoot.getInstanceList(Bridge_c.class).get(new Object[] {m_brg_id});
      // if there was no local element, check for any global elements
      // failing that proceed to check other model roots
      if (relInst40373 == null) {
        relInst40373 =
            (Bridge_c)
                Ooaofooa.getDefaultInstance()
                    .getInstanceList(Bridge_c.class)
                    .get(new Object[] {m_brg_id});
      }
      if (relInst40373 == null && searchAllRoots && !baseRoot.isCompareRoot()) {
        Ooaofooa[] roots = Ooaofooa.getInstances();
        for (int i = 0; i < roots.length; i++) {
          if (roots[i].isCompareRoot()) {
            // never use elements from any compare root
            continue;
          }
          relInst40373 =
              (Bridge_c) roots[i].getInstanceList(Bridge_c.class).get(new Object[] {m_brg_id});
          if (relInst40373 != null) break;
        }
      }
      // synchronized
      if (relInst40373 != null) {
        if (relateProxies || !isProxy() || (inSameComponent(this, relInst40373) && !isProxy())) {
          relInst40373.relateAcrossR674To(this, notifyChanges);
        }
      }
    }
  }
Example #21
0
  public void clearDatabase(IProgressMonitor pm) {
    // clear the corresponding graphics-root's database
    OoaofgraphicsUtil.clearGraphicsDatabase(rootId, pm);

    Ooaofooa.getDefaultInstance().fireModelElementUnloaded(this);
  }
Example #22
0
  /**
   * Loads (and returns) the instance of this class from the given file to which it previously had
   * been persisted.
   */
  private static Ooaofooa loadInstanceFromFile(IFile file) {
    // find the system-model that corresponds to the project
    // containing the given file
    final String projectName = file.getProject().getName();
    final SystemModel_c system =
        SystemModel_c.SystemModelInstances(
            Ooaofooa.getDefaultInstance(),
            new ClassQueryInterface_c() {
              public boolean evaluate(Object candidate) {
                SystemModel_c selected = (SystemModel_c) candidate;
                return selected.getName().equals(projectName);
              }
            })[0];

    // open an input-stream on the given file
    InputStream inStream = null;
    try {
      inStream = new FileInputStream(file.getLocation().toString());
    } catch (FileNotFoundException e) {
      CorePlugin.logError(
          "Internal error: failed to open " + file.getLocation().toString(), e); // $$NON-NLS-1$$
      return null;
    }

    // detm the instance's ID from the file's path
    final String id = createModelRootId(file.getProject(), file.getName(), false);

    // the enclosed could take a bit of time, so put up a busy indicator
    final InputStream finalInStream = inStream;
    BusyIndicator.showWhile(
        Display.getCurrent(),
        new Runnable() {
          public void run() {
            // load the instance from the stream and have it be associated
            // with the system-model found above
            String result =
                CorePlugin.getDefault()
                    .doLoad(system, id, finalInStream, new NullProgressMonitor(), false, false);
            if (!result.equals("")) {
              Ooaofooa modelRoot = getInstance(id, false);
              modelRoot.loadErrorMessage = result;
            }
          }
        });

    // close the input-stream from which the model was loaded
    try {
      inStream.close();
    } catch (IOException e) {
      CorePlugin.logError("Error closing stream after import", e);
    }

    // make sure the domain and file name are in sync
    Ooaofooa modelRoot = getInstance(id, false);
    if (modelRoot.loadedOk()) {
      Domain_c dom = Domain_c.DomainInstance(modelRoot);
      String fn = file.getName();
      String domName = fn.substring(0, fn.length() - MODELS_EXT.length() - 1);

      ModelRoot.disableChangeNotification();
      try {
        dom.setName(domName);
      } finally {
        ModelRoot.enableChangeNotification();
      }
    }

    // return the loaded instance
    return modelRoot;
  }
  private void CNST_CSP_NewConstant(IStructuredSelection selection) {
    // Assign the context selection variables with the action context
    // Assign the context selection variable with the action context
    Object context = selection.iterator().next();
    ConstantSpecification_c v_csp = (ConstantSpecification_c) context;
    PersistableModelComponent.ensureCoreDataTypesAvailable(v_csp.getModelRoot());

    TransactionUtil.TransactionGroup transactionGroup =
        TransactionUtil.startTransactionsOnSelectedModelRoots("New Constant");
    boolean abortTransaction = false;
    try {
      // Ensure that actions take place between Verifier Activity executions
      Ooaofooa.beginSaveOperation();
      if (v_csp != null) {
        v_csp.Newliteralsymbolicconstant();
      } else {
        Throwable t = new Throwable();
        t.fillInStackTrace();
        CorePlugin.logError("Attempted to call an operation on a null instance.", t);
      }

      NonRootModelElement[] children =
          LiteralSymbolicConstant_c.getManyCNST_LSCsOnR1503(
              LeafSymbolicConstant_c.getManyCNST_LFSCsOnR1502(
                  SymbolicConstant_c.getManyCNST_SYCsOnR1504(v_csp)));

      NonRootModelElement newElement = children[children.length - 1];
      IPreferenceStore store = CorePlugin.getDefault().getPreferenceStore();
      boolean option = store.getBoolean(BridgePointPreferencesStore.USE_DEFAULT_NAME_FOR_CREATION);
      if (!option) {
        String oldName = RenameActionUtil.getElementName(newElement);
        boolean performRename =
            UIUtil.inputDialog(
                null,
                "Element Creation",
                "Enter the name:",
                oldName,
                UIUtil.newRenameValidator(newElement));
        if (performRename) {
          String proposedName = UIUtil.inputDialogResult;
          RenameActionUtil.setElementName(newElement, proposedName);
          newElement.setComponent(null);
        } else {
          abortTransaction = true;
        }
      }
      // end critical section
      Ooaofooa.endSaveOperation();
      // catch all exceptions and cancel the transactions
    } catch (Exception e) {
      Ooaofooa.endSaveOperation();
      TransactionUtil.cancelTransactions(transactionGroup, e);
      CorePlugin.logError("Transaction: New Constant failed", e); // $NON-NLS-1$
    }
    if ((!CorePlugin.getDefault()
            .getPreferenceStore()
            .getBoolean(BridgePointPreferencesStore.USE_DEFAULT_NAME_FOR_CREATION))
        && abortTransaction) {
      TransactionUtil.cancelTransactions(transactionGroup);
    } else {
      TransactionUtil.endTransactions(transactionGroup);
    }
  }
  public void batchRelate(
      ModelRoot modelRoot, boolean relateProxies, boolean notifyChanges, boolean searchAllRoots) {
    InstanceList instances = null;
    ModelRoot baseRoot = modelRoot;

    if (ReadsValue == null) {
      // R609
      Value_c relInst40728 =
          (Value_c) baseRoot.getInstanceList(Value_c.class).get(new Object[] {m_r_value_id});
      // if there was no local element, check for any global elements
      // failing that proceed to check other model roots
      if (relInst40728 == null) {
        relInst40728 =
            (Value_c)
                Ooaofooa.getDefaultInstance()
                    .getInstanceList(Value_c.class)
                    .get(new Object[] {m_r_value_id});
      }
      if (relInst40728 == null && searchAllRoots && !baseRoot.isCompareRoot()) {
        Ooaofooa[] roots = Ooaofooa.getInstances();
        for (int i = 0; i < roots.length; i++) {
          if (roots[i].isCompareRoot()) {
            // never use elements from any compare root
            continue;
          }
          relInst40728 =
              (Value_c) roots[i].getInstanceList(Value_c.class).get(new Object[] {m_r_value_id});
          if (relInst40728 != null) break;
        }
      }
      // synchronized
      if (relInst40728 != null) {
        if (relateProxies || !isProxy() || (inSameComponent(this, relInst40728) && !isProxy())) {
          relInst40728.relateAcrossR609To(this, notifyChanges);
        }
      }
    }

    if (WritesValue == null) {
      // R689
      Value_c relInst40729 =
          (Value_c) baseRoot.getInstanceList(Value_c.class).get(new Object[] {m_l_value_id});
      // if there was no local element, check for any global elements
      // failing that proceed to check other model roots
      if (relInst40729 == null) {
        relInst40729 =
            (Value_c)
                Ooaofooa.getDefaultInstance()
                    .getInstanceList(Value_c.class)
                    .get(new Object[] {m_l_value_id});
      }
      if (relInst40729 == null && searchAllRoots && !baseRoot.isCompareRoot()) {
        Ooaofooa[] roots = Ooaofooa.getInstances();
        for (int i = 0; i < roots.length; i++) {
          if (roots[i].isCompareRoot()) {
            // never use elements from any compare root
            continue;
          }
          relInst40729 =
              (Value_c) roots[i].getInstanceList(Value_c.class).get(new Object[] {m_l_value_id});
          if (relInst40729 != null) break;
        }
      }
      // synchronized
      if (relInst40729 != null) {
        if (relateProxies || !isProxy() || (inSameComponent(this, relInst40729) && !isProxy())) {
          relInst40729.relateAcrossR689To(this, notifyChanges);
        }
      }
    }

    // R603
    Statement_c relInst40730 =
        (Statement_c)
            baseRoot.getInstanceList(Statement_c.class).get(new Object[] {m_statement_id});
    // if there was no local element, check for any global elements
    // failing that proceed to check other model roots
    if (relInst40730 == null) {
      relInst40730 =
          (Statement_c)
              Ooaofooa.getDefaultInstance()
                  .getInstanceList(Statement_c.class)
                  .get(new Object[] {m_statement_id});
    }
    if (relInst40730 == null && searchAllRoots && !baseRoot.isCompareRoot()) {
      Ooaofooa[] roots = Ooaofooa.getInstances();
      for (int i = 0; i < roots.length; i++) {
        if (roots[i].isCompareRoot()) {
          // never use elements from any compare root
          continue;
        }
        relInst40730 =
            (Statement_c)
                roots[i].getInstanceList(Statement_c.class).get(new Object[] {m_statement_id});
        if (relInst40730 != null) break;
      }
    }
    // synchronized
    if (relInst40730 != null) {
      if (relateProxies || !isProxy() || (inSameComponent(this, relInst40730) && !isProxy())) {
        relInst40730.relateAcrossR603To(this, notifyChanges);
      }
    }
  }
  public void onPageEntry() {
    Ooaofooa modelRoot =
        Selection.getModelRoot(
            (StructuredSelection)
                ((CommunicationClassEventFormalizeOnMSG_AMWizard) getWizard()).getSelection());

    // cache for previous user selections
    StateMachineEvent_c v_Message =
        ((CommunicationClassEventFormalizeOnMSG_AMWizard) getWizard()).v_Message;

    // cache for context
    AsynchronousMessage_c v_asyncMessage =
        ((CommunicationClassEventFormalizeOnMSG_AMWizard) getWizard()).v_asyncMessage;
    ClassParticipant_c v_cp = ((CommunicationClassEventFormalizeOnMSG_AMWizard) getWizard()).v_cp;

    if (((v_asyncMessage != null))) {

      if (((v_cp != null))) {

        Message_c v_message = Message_c.getOneMSG_MOnR1018(v_asyncMessage);

        InteractionParticipant_c v_participant = InteractionParticipant_c.getOneSQ_POnR930(v_cp);

        ModelClass_c v_mclass = ModelClass_c.getOneO_OBJOnR939(v_cp);

        if (((v_mclass != null))) {

          StateMachine_c v_stateMachine =
              StateMachine_c.getOneSM_SMOnR517(ClassStateMachine_c.getOneSM_ASMOnR519(v_mclass));

          ClassStateMachine_c v_asm = ClassStateMachine_c.getOneSM_ASMOnR519(v_mclass);

          InstanceStateMachine_c v_ism = InstanceStateMachine_c.getOneSM_ISMOnR518(v_mclass);

          java.util.UUID v_asmId = Gd_c.Null_unique_id();

          java.util.UUID v_ismId = Gd_c.Null_unique_id();

          if (((v_asm != null))) {

            v_asmId = v_asm.getSm_id();
          }

          if (((v_ism != null))) {

            v_ismId = v_ism.getSm_id();
          }

          StateMachineEvent_c v_evt =
              StateMachineEvent_c.getOneSM_EVTOnR1009(
                  EventMessage_c.getOneMSG_EOnR1019(v_asyncMessage));

          java.util.UUID v_existingId = Gd_c.Null_unique_id();

          if (((v_evt != null))) {

            v_existingId = v_evt.getSmevt_id();
          }

          StateMachine_c v_machines1 =
              (StateMachine_c)
                  modelRoot.getInstanceList(StateMachine_c.class).getGlobal(null, v_asmId);
          List<StateMachine_c> v_machinesList = new ArrayList<StateMachine_c>();
          if (v_machines1 != null) {
            v_machinesList.add(v_machines1);
          }
          StateMachine_c[] v_machines =
              v_machinesList.toArray(new StateMachine_c[v_machinesList.size()]);
          StateMachine_c v_machines2 =
              (StateMachine_c)
                  modelRoot.getInstanceList(StateMachine_c.class).getGlobal(null, v_ismId);
          if (v_machines2 != null) {
            v_machinesList.add(v_machines2);
          }
          v_machines = v_machinesList.toArray(new StateMachine_c[v_machinesList.size()]);

          if (((v_Message != null))) {}
        }
      }
    }
  }
  public void Createparticipant(
      final String p_Classname,
      final Object p_Elementid,
      final String p_Modelrootid,
      final String p_Searchablevalue) {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Description Query",
        " Operation entered: DescriptionQuery::Createparticipant");
    final ModelRoot modelRoot = getModelRoot();
    SearchParticipant_c v_participant = new SearchParticipant_c(modelRoot);
    Ooaofooa.getDefaultInstance()
        .fireModelElementCreated(
            new BaseModelDelta(Modeleventnotification_c.DELTA_NEW, v_participant));

    SearchableElement_c v_searchable = new SearchableElement_c(modelRoot);
    Ooaofooa.getDefaultInstance()
        .fireModelElementCreated(
            new BaseModelDelta(Modeleventnotification_c.DELTA_NEW, v_searchable));

    DescriptionSearchable_c v_descriptionParticipant = new DescriptionSearchable_c(modelRoot);
    Ooaofooa.getDefaultInstance()
        .fireModelElementCreated(
            new BaseModelDelta(Modeleventnotification_c.DELTA_NEW, v_descriptionParticipant));

    if (v_searchable != null) {
      v_searchable.relateAcrossR9700To(v_participant);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Relate attempted on null left hand instance.", t);
    }

    if (v_searchable != null) {
      v_searchable.setModelrootid(p_Modelrootid);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Attribute write attempted on null instance.", t);
    }

    if (v_searchable != null) {
      v_searchable.setElementid(p_Elementid);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Attribute write attempted on null instance.", t);
    }

    if (v_searchable != null) {
      v_searchable.setClassname(p_Classname);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Attribute write attempted on null instance.", t);
    }

    if (v_descriptionParticipant != null) {
      v_descriptionParticipant.setSearchablevalue(p_Searchablevalue);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Attribute write attempted on null instance.", t);
    }

    if (v_descriptionParticipant != null) {
      v_descriptionParticipant.relateAcrossR9702To(v_searchable);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Relate attempted on null left hand instance.", t);
    }

    SearchEngine_c v_engine = SearchEngine_c.getOneSEN_EOnR9500(Query_c.getOneSQU_QOnR9600(this));

    if (v_engine != null) {
      v_engine.relateAcrossR9502To(v_participant);
    } else {
      Throwable t = new Throwable();
      t.fillInStackTrace();
      CorePlugin.logError("Relate attempted on null left hand instance.", t);
    }
  } // End createParticipant