How WSO2 Governance Registry Associations Works

Associating with assets is a core concept in SOA Governance. To achieve this WSO2  Governance Registry use Registry Association concept which is a very useful and also very nice to have feature.

To download the latest version of G-Reg please visit Governance Registry official page.





As you can see from the above image users can visualise registry associations. Without further a due lets see how this magic works.


before I dive in to the code I belive you have already started running WSO2 Governance Registry 5.2.0. If not please download it from here. Just after starting the server For demonstration purposes kindly upload a valid WSDL/WADL or Swagger using publisher. You can find list of publicly available WSDLs from here. For now I'm using ConvertAcceleration wsdl, Lets upload it to GReg.




Upon upload completion find the ConvertAcceleration from the WSDL list and open it.




To view the dependancy graph click on Show Dependancies




As you can see uploaded wsdl have automatically associated with newly created SOAP service and endpoint. If you click on the middle of association(round dot) line you can see association details.




Above sample depict a predefined association model that GReg offers, Like wise GReg will create associations for WADL and Swagger artifact like above. How ever if users want to create a association with another asset he or she is 3 steps away from it. First of all find the new asset that you need to associate with ConvertAcceleration in this case I have created SoapTest just for demonstration.


Step 1
Open the association tab which is located within the SoapTest asset.




Step 2
Select an association type




Step 3
Select ConvertAcceleration from the drop down list. Finally click on add.




Thats it you have successfully created the association now. To view it click on the Overview tab from the ribbon and again click on Show Dependancies, Now you can see the new association in the graph.




In GReg 5.2.0 out of the box it offers 4 default association types for all the main artifact types. These default association types are : security, ownedBy, usedBy and depends


Other than that users can create their own association types using GReg. To demonstrate this functionality lets start creating an association call subscribesTo with the reverse association named subscribe. And lets add this association type only for SOAP services. To do this open governance.xml in <GREG_HOME>/repository/conf/. In that XML file find the <Association type="soapservice"> tag and in there add below xml line


<subscribesTo reverseAssociation ="subscribe" iconClass="fw-subscribe">soapservice,restservice,wsdl,endpoint</subscribesTo>


In the end <Association type="soapservice"> will be look like below. Please find the explnations for bold words below.


<Association type="soapservice">
           <security reverseAssociation ="secures" iconClass="fw-security">policy</security>
           <ownedBy reverseAssociation ="owns" iconClass="fw-wso2">soapservice,restservice,wsdl</ownedBy>
           <usedBy reverseAssociation ="depends" iconClass="fw-wso2">soapservice,restservice,wsdl</usedBy>
           <depends reverseAssociation ="usedBy" iconClass="fw-wso2">soapservice,restservice,wsdl,endpoint</depends>
           <subscribesTo reverseAssociation ="subscribe" iconClass="fw-subscribe">soapservice,restservice,wsdl,endpoint</subscribesTo>
       </Association>


Association type - This defined the mediaType that is valid for the association definition. Users have to use the artifact shortName here. type="default" defined rest of the artifact types which user haven't defined.
security - Always the tag name will be the primary name of the association.
reverseAssociation ="secures" - Secondary name of the association.




iconClass="fw-wso2" - Link a icon to association type. To find more icon types please go to wso2-dev-ux.github.  


soapservice,restservice,wsdl,endpoint - The artifact types that above  depends association type can create associations with. Therefor when you click on depends association type only soap, rest, wsdl and endpoint will get populated in the step 2 dropdown.


Lets use this newly created association with an another asset using above 3 steps. After creating the association it will be look like below.




Like wise users can define and create their own association types. Thats it from here. If you have any questions please create a stackoverflow question and attached it as a comment below.

Comments

  1. Nice blog here! Also your website loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my website loaded up as quickly as yours lol. conex for sale

    ReplyDelete

Post a Comment