Tuesday, December 20, 2011

WSO2 Governance Registry-Configurable Governance Artifacts part-1

WSO2 Governance Registry give the full flexibility over extending its functionalities and capabilities. One of its configurable capability is extending its Metadata model in a way such that anyone can store any custom type of data like Services, WSDLs, etc. which are already there. This only needs to add a XML file (registry extension or .rxt file) as a resource to the registry which include the new Metadata model artifact. Here I am discussing about creattion of registry extension file which introduce a Event data model.


    event
    /events/@{details_name}
    details_name
    http://www.wso2.com/rxt/event
    
        
            
                
            
        
        
            
                
            
        
    
    
        <table name="Details">
            
                Name
            
            
                Date
            
            
                Venue
            
        </table>
        <table name="Rules">
            
                Gender
                
                    male
                    female
                
            
            
                Description
            
            
                Auther
            
        </table>
        <table name="Participants">
            
                HouseName
            
            
                Contact
                
                    TitansLegionsCloud BotsWild Boars
                
            
        </table>
        <table name="Service Lifecycle">
            
                Lifecycle Name
                
            
        </table>
        <table name="SLA" columns="3">
            
                Document TypeURLComment
            
            
                SLA
            
            
                SLA1
            
            
                SLA2
            
        </table>
    


Now lets identify main elements one by one.

artifactType element

This is the root element of the new artifact which is going to define. It has several attributes.

type - Define the mediatype of the artifact. This should be in the format of "application/vnd.[SOMENAME]+xml".  SOMENAME can contain any alphanumeric character, '-' (hyphen) or '.' (period).
shortName - Short name for the artifact
singularLabel - Singular label of artifact
pluralLabel - Plural label of artifact
hasNamespace - Whether artifact has a namespace (boolean)
iconSet - Icon set number which use as the artifact icons

artifactKey element
event
This element defines the unique key which can be used to identify the artifact. This key is used when fetching configurations and loading customized UIs.

storagePath element
/consumers/@{namespace}/@{name}
This is the path where the instance data of artifact is stored. When evaluate this expression, it automatically replace @{name} with the name of the artifact, and @{namespace} with the namespace of the artifact. In addition to name and namespace, you can also specify any other attribute in the format @{ATTRIBUTE_NAME}. e.g. /trunk/processes/@{business_domain}/@{overview_version}

nameAttribute element
details_name
This is the main attribute which define the name of the artifact. This must be in the format, {$table}_{$base-column}.

namespaceAttribute element
http://www.wso2.com/rxt/event
This attribute which you will define the namespace of the artifact. some artifacts might not need a namespace, and therefore, this is optional. Namespaces are found in artifacts related to Web Services, but might not be common to others such as Policy and SLA.


ui element

    
        
            
        
        
            
        
    


This element define the view of the data instances when browsing for that data type. It can include the list of data types which are in the content of the artifact.



relationships element

    
    
    

relationships defines the relationships between the newly created artifact and other artifacts. We can find three types here.

isConsumedBy - Artifact which consume newly created artifact
uses - Artifact which use newly created artifact
usedBy - Artifact used by the newly created artifact

content element

    <table name="Details">
        
            Name
        
        
            Date
        
        
            Venue
        
    </table>
    <table name="Rules">
        
            Gender
            
                male
                female
            
        
        
            Description
        
        
            Auther
        
    </table>
    <table name="Participants">
        
            HouseName
        
        
            Contact
            
                TitansLegionsCloud BotsWild Boars
            
        
    </table>
    <table name="Service Lifecycle">
        
            Lifecycle Name
            
        
    </table>
    <table name="SLA" columns="3">
        
            Document TypeURLComment
        
        
            SLA
        
        
            SLA1
        
        
            SLA2
        
    </table>

This element defines the data model of the new artifact. Also it will use to auto-generate the ui of instantiate artifacts.
We will discuss about content in the next post.

3 comments:

  1. I tried your example but it does not work, I loaded events.rxt and I put the correct mimetype, but the new metadata will not appear. Can anyone help me?

    ReplyDelete
  2. I solved the problem with your example that is posted on the wiki, xml code in the example does not respect the camelNotation. So the registry is unable to parse the rxt.

    ReplyDelete
  3. I am on WSO2 GREG version 4.5.0 When I added the RXT as "Create Text content" and provided the XML and the mime types, it added successfully. However when I sign out and sign in, I dont see the new artifact in the menu. Is there some other configuration needed?

    ReplyDelete