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.
- Log in to the G-Reg Publisher using admin/admin credentials and the following URL:
- Click on the corresponding asset type as shown below.
- Click on the asset to which you want to add the association as shown below.
- Click the following ASSOCIATIONS button in the top menu:
- Click on the association type that you want to add as shown below. For instructions on adding association types, see Managing Dependencies and Associations.
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.
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.
- Click the following OVERVIEW button in the top menu:
- Click the following Show Dependencies button:
You view the graphical representation of all the associations of the corresponding artifact, including the one you added as shown below.
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.
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.
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
soapservice elements in the
Default association type denotes all other asset types that are not overridden. The other two association types(i.e
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.
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.
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.