/
Find Usages

Find Usages

  1. Motivation

    1. We can raise questions such as “How many ACCs are used this given ACC as a based ACC?”, “How many ASCCPs are related with ACCs through ASCCs? or vice versa?”, and so on.

      1. If CC developers can see the relationships (or paths), especially reverse ordered ones (i.e., acc_id->basd_acc_id or asccp_id->ascc_id->acc_id), for the given component, it may prevent to create unnecessary component that already exists.

  2. Proposal

    1. Find Usages menu on the CC tree.

      1. For ACC

        1. Find all based ACCs

          1. function List<ACC> findAllBasedACCs(ACC sourceACC) { List<ACC> results = new ArrayList(); ACC currentACC = sourceACC.basedACC; while (currentACC != null) { results.add(currentACC); currentACC = currentACC.basedACC; } return results; }
        2. Find all ASCCPs whose role_of_acc_id value equals to the given ACC ID

          1. function List<ASCCP> findAllASCCPsByRoleOfACC(ACC roleOfACC) { return query(ASCCP).where(ASCCP.roleOfAccId == roleOfACC.accId); }
      2. For ASCCP

        1. Find all ACCs that have a relationship with the given ASCCP through ASCCs.

          1. function List<ACC> findAllACCsByToASCCP(ASCCP toASCCP) { return query(ACC).join(ACC.accId == ASCC.fromAccId) .where(ASCC.toAsccpId == toASCCP.asccpId); }
      3. For BCCP

        1. Find all ACCs that have a relationship with the given BCCP through BCCs.