||
Skip to end of metadata
Go to start of metadata

This feature integrates associations into the assets stored in WSO2 G-Reg. Follow the steps below to add an association to an asset using the G-Reg Publisher.

  1. Log in to the G-Reg Publisher using admin/admin credentials and the following URL: https://<G-REG_HOST>:<G-REG_PORT>/publisher
  2. Click on the corresponding asset type as shown below. 
    select asset type
  3. Click on the asset to which you want to add the association as shown below.
    select the asset
  4. Click the following ASSOCIATIONS button in the top menu: associations button
  5. Click on the association type that you want to add as shown below. For instructions on adding association types, see Managing Dependencies and Associations.
    select the association type
  6. Click the drop down menu box in SELECT ASSET, and then select the asset from which you want to add the association as shown in the example below.

    You can use the provided text field to type the name of an asset to search for it.

  7. Click the following ADD button, to add the association: 
    Click OK in the below message, which you view when the association is successfully added.
    You view the association added to the list of available associations for the corresponding asset as shown below.

    You can use the DELETE button to remove the corresponding association.

    list of all available associations 

  8. Click the following OVERVIEW button in the top menu: overview button
  9.  Click the following Show Dependencies button: show dependencies button
    You view the graphical representation of all the associations of the corresponding artifact, including the one you added as shown below.
    impact analysis

Adding an association to an asset in bi-directional, and thus it also automatically adds a backward association. For an example, adding a security type association for a SOAP service with a policy, also adds, the secures type association from the policy to the SOAP service as well as illustrated below.


Deleting an association removes both associations (i.e. from source to the destination asset, and from destination to the source type asset.)

If you change an association type (e.g. security, depends, usedBy etc.), or a reverse association type (e.g. secures, depends on, uses, etc.) in the <G-REG_HOME>/repository/conf/governance.xml file, and then re-start the server, it does not remove both bi-directional associations of the associations which you already added. It only removes the source to destination association, but does not remove the destination to source association, which is added automatically.

Configuring restrictions on creating associations

Administrators can restrict assets that can be associated with certain other assets by changing the following configurations accordingly in the <G-REG_HOME>/repository/conf/governance.xml file. Add the values you defined as short name in the RXT file of the artifact, within the <Association type> element, to define the association types enabled for that particular asset type.

<AssociationConfig>
    <Association type="default">
        <security reverseAssociation="secures">policy</security>
        <ownedBy reverseAssociation="owns">soapservice,restservice,wsdl</ownedBy>
        <usedBy reverseAssociation="depends">soapservice,restservice,wsdl</usedBy>
        <depends reverseAssociation="usedBy">soapservice,restservice,wsdl</depends>
    </Association>
    <Association type="restservice">
        <security reverseAssociation="secures">policy</security>
        <ownedBy reverseAssociation="owns">restservice,soapservice,wsdl</ownedBy>
        <usedBy reverseAssociation="depends">restservice,soapservice,wsdl</usedBy>
        <depends reverseAssociation="usedBy">restservice,soapservice,wsdl,endpoint</depends>
    </Association>
    <Association type="soapservice">
        <security reverseAssociation="secures">policy</security>
        <ownedBy reverseAssociation="owns">soapservice,restservice,wsdl</ownedBy>
        <usedBy reverseAssociation="depends">soapservice,restservice,wsdl</usedBy>
        <depends reverseAssociation="usedBy">soapservice,restservice,wsdl,endpoint</depends>
    </Association>
</AssociationConfig>

 

Adding a new association type

You can add custom association types in WSO2 G-Reg, and add them to assets using the G-Reg Publisher.

To create a new association type, you can specify it to be available for default or specific asset types by defining the new association type within the defaultrestservice, and soapservice elements in the <G-REG_HOME>/repository/conf/governance.xml file. Default association type denotes all other asset types that are not overridden. The other two association types(i.e restservice, and soapservice)denote the overridden asset types, which are REST Services and SOAP Services. 

For an example, if you want to add a new association named criticalTo, and make it available only for SOAP Services, modify the soapservice association configuration as shown below. The values within the <criticalTo> tag are the comma-separated asset types that you can associate using the criticalTo association type with a SOAP service.

<Association type="soapservice">
            <security reverseAssociation="secures">policy</security>
        	<ownedBy reverseAssociation="owns">soapservice,restservice,wsdl</ownedBy>
        	<usedBy reverseAssociation="depends">soapservice,restservice,wsdl</usedBy>
        	<depends reverseAssociation="usedBy">soapservice,restservice,wsdl,endpoint</depends>
            <criticalTo reverseAssociation="isCritical">soapservice,restservice,wsdl</criticalTo>
</Association>

Viewing the new association type 

Re-start the WSO2 G-Reg server, and then follow the steps 1-4 in the above section, to view the new association type you added above as shown below.

select new association type

Click that the CriticalTo combo box to view the SOAP Services, REST Services and WSDLs stored in the Registry that are available for you to associate with the selected asset, using this new association type as shown below.

view the available assets to associate

  • No labels