/** @see IModelClassInspector#getChildRelations(Object) Returns the children of this node */
  public ObjectElement[] getChildRelations(Object arg) {
    int resultSize = 0;
    Lifespan_c[] v_lifespans =
        Lifespan_c.getManySQ_LSsOnR940(
            InteractionParticipant_c.getManySQ_PsOnR930((FunctionPackageParticipant_c) arg));

    sort(v_lifespans);
    SynchronousMessage_c[] v_synchronousmessages =
        SynchronousMessage_c.getManyMSG_SMsOnR1018(
            Message_c.getManyMSG_MsOnR1007(
                InteractionParticipant_c.getManySQ_PsOnR930((FunctionPackageParticipant_c) arg)));

    sort(v_synchronousmessages);
    ReturnMessage_c[] v_returnmessages =
        ReturnMessage_c.getManyMSG_RsOnR1018(
            Message_c.getManyMSG_MsOnR1007(
                InteractionParticipant_c.getManySQ_PsOnR930((FunctionPackageParticipant_c) arg)));

    sort(v_returnmessages);
    List<ObjectElement> result = new ArrayList<ObjectElement>();
    for (int i = 0; i < v_lifespans.length; i++) {
      result.add(
          new ObjectElement(
              "v_lifespans", ObjectElement.RELATION_ROLE_ELEMENT, v_lifespans[i], arg, false));
    }
    for (int i = 0; i < v_synchronousmessages.length; i++) {
      result.add(
          new ObjectElement(
              "v_synchronousmessages",
              ObjectElement.RELATION_ROLE_ELEMENT,
              v_synchronousmessages[i],
              arg,
              false));
    }
    for (int i = 0; i < v_returnmessages.length; i++) {
      result.add(
          new ObjectElement(
              "v_returnmessages",
              ObjectElement.RELATION_ROLE_ELEMENT,
              v_returnmessages[i],
              arg,
              false));
    }
    return result.toArray(new ObjectElement[result.size()]);
  }
  /** @see IModelClassInspector#hasChildren(Object) Returns true if this node has any children */
  public boolean hasChildRelations(Object arg) {
    Lifespan_c[] v_lifespans =
        Lifespan_c.getManySQ_LSsOnR940(
            InteractionParticipant_c.getManySQ_PsOnR930((FunctionPackageParticipant_c) arg));

    if (v_lifespans.length > 0) return true;
    SynchronousMessage_c[] v_synchronousmessages =
        SynchronousMessage_c.getManyMSG_SMsOnR1018(
            Message_c.getManyMSG_MsOnR1007(
                InteractionParticipant_c.getManySQ_PsOnR930((FunctionPackageParticipant_c) arg)));

    if (v_synchronousmessages.length > 0) return true;
    ReturnMessage_c[] v_returnmessages =
        ReturnMessage_c.getManyMSG_RsOnR1018(
            Message_c.getManyMSG_MsOnR1007(
                InteractionParticipant_c.getManySQ_PsOnR930((FunctionPackageParticipant_c) arg)));

    if (v_returnmessages.length > 0) return true;
    return false;
  }
コード例 #3
0
  public boolean performFinish() {
    TransactionUtil.TransactionGroup transactionGroup = null;
    ModelRoot modelRoot = v_syncMessage.getModelRoot();
    try {
      transactionGroup =
          TransactionUtil.startTransactionsOnSelectedModelRoots(
              "Interface Operation Formalize"); //$NON-NLS-1$
      Message_c v_message = Message_c.getOneMSG_MOnR1018(v_syncMessage);

      InteractionParticipant_c v_participant =
          InteractionParticipant_c.getOneSQ_POnR1007(v_message);

      ComponentParticipant_c v_cop = ComponentParticipant_c.getOneSQ_COPOnR930(v_participant);

      if (((v_cop == null))) {

        v_cop =
            ComponentParticipant_c.getOneSQ_COPOnR930(
                InteractionParticipant_c.getOneSQ_POnR940(
                    Lifespan_c.getOneSQ_LSOnR930(v_participant)));
      }

      Component_c v_component =
          (Component_c)
              modelRoot.getInstanceList(Component_c.class).getGlobal(null, Gd_c.Null_unique_id());

      if (((v_cop != null))) {

        v_component = Component_c.getOneC_COnR955(v_cop);
      }

      if (((v_component != null))) {

        if (((v_Operation != null))) {

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

      // catch all exceptions and cancel the transaction
    } catch (Exception e) {
      if (transactionGroup != null) TransactionUtil.cancelTransactions(transactionGroup, e);
      CorePlugin.logError("Transaction: Interface Operation Formalize failed", e); // $NON-NLS-1$
      // return true so that the wizard will
      // close
      return true;
    }
    if (transactionGroup != null) TransactionUtil.endTransactions(transactionGroup);
    if (m_viewer != null) {
      if (m_viewer instanceof StructuredViewer) {
        ((StructuredViewer) m_viewer).refresh(v_syncMessage);
      } else {
        m_viewer.refresh();
      }
    }
    return true;
  }