WSO2 Governance Registry Adding Custom Artifacts

WSO2 governance registry is the SOA (Service Oriented Architecture) governance model of the wso2 product catalogue.  If you are an enterprise that has a lot of SOA artifacts to be stored or governed, you might find wso2 GREG as a handy tool. GReg provides SOA artifacts manipulation in two aspects – as a meta data repository and a governing software.

Out of the box it supports following artifact types to be stored.

  • SOAP services
  • REST services
  • WSDL
  • WADL
  • Policies
  • Schemas
  • Swaggers

(WSDL, WADL, Policy and Schemas are also known as content type artifacts.)

SOA governance might run beyond the limits of known ready to go artifacts. i.e: Different stages of SOA governance probably need more types of artifacts to be maintained. planning governance stage will probably ask you to store profiles of different supplements and then move them through different life cycle stages. Development artifacts probably run beyond the known descriptive models. But fret not, answer is just a tab ahead in GReg.

Governance registry supports extension of artifacts, life cycles and handlers. This post will describe how to use artifacts extension model of GReg to store more artifacts.

Customizing an existing artifact type

Registry extensions are defined in a file that has the extension .rxt (registry extension). You can edit the rxt file as you wish at Extension tab of management console.

i.e.: Adding another text area named “Department” to REST services.
  • Browse the Rest services RXT from Management console. (Extensions > Configure > RXT types)
  • Select View/Edit for Rest Services.
  • Add following after the version field and save the RXT.

<field type="text-area" required="false">

view raw


hosted with ❤ by GitHub

  • You will see the custom field when you add a new REST service next time and on asset overview page of existing rest service artifacts after version field.
  • To make the custom field visible on store you need to add it specifically on Store. (To make sure you make it visible for store users). Add following snippet to <GREG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/app/greg-store-defaults/themes/store/partials/asset-attributes.hbs file after version.

{{#if this.attributes.overview_<wbr />department}}
<div class="col-lg-12 divrow">
<div class="col-lg-2">{{t "Department"}}</div>
<div class="col-lg-10">{{this.<wbr />attributes.overview_<wbr />department}}</div>

view raw


hosted with ❤ by GitHub

Adding a new artifact type

You might probably need to add different type of business governing artifacts considering the scenario. Suppose you need to add an newly arrived inventory to the GReg. (Well, you can use GReg as a inventory management software as well)

Move to Extensions -> Artifact Types of Carbon console and click on add new artifact.

Enter the following xml description for a new inventory.

<?xml version="1.0"?>
<artifactType type="application/vnd.wso2-inventory+xml" shortName="inventory" singularLabel="Inventory" pluralLabel="Inventories"
hasNamespace="false" iconSet="10">
<column name="Supplier">
<data type="path" value="overview_supplier" href="@{storagePath}"/>
<column name="Item">
<data type="path" value="overview_item" href="@{storagePath}"/>
<column name="Date">
<data type="path" value="overview_date" href="@{storagePath}"/>
<table name="Overview">
<field type="text" required="true">
<field type="text" required="true" readonly="true">
<field type="date" required="true" readonly="true">
<field type="date">
<name>Expire Date</name>
<field type="options">
<name label="Category">Category</name>
<field type="text">
<name>Inventory Location</name>
<field type="text-area">
<table name="Images">
<field type="text">
<field type="text">

view raw


hosted with ❤ by GitHub

Then save the artifact descriptor and go to the Governnace Publisher URL. (https://localhost:9443/publisher)

Log in as the carbon user admin (user:admin, pw:admin) and see if our newly added inventory asset type is available. Now you are ready to add new inventory to the repository.

Add new asset and view it on Governance Store. (https://localhost:9443/store)

Please note that you have to make the custom fields available by modifying <GREG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/app/greg-store-defaults/themes/store/partials/asset-attributes.hbs file.



7 thoughts on “WSO2 Governance Registry Adding Custom Artifacts

  1. Everson Leal says:

    Hi, nice post. But I’m having some troubles with Role Privileges. When I assign privilege to a Role, this privilege isn’t applied to the Resource.


Comments are closed.