Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once successfully deployed this sample will forward notification generated on WSO2 Governance Registry to the WSO2 Business Activity Monitor. We will be reusing the code of the Handler Sample in this example. This sample requires Apache Maven and WSO2 Business Activity Monitor. See Installing Apache Maven on Windows or Installing Apache Maven on Linux  See Installation Prerequisites for more information on downloading these. Also see Installing Business Activity Monitor on Windows from Binary Distribution or Installing  Business Activity Monitor  on Linux and Solaris from Binary Distribution.

...

Select the ToolBox From File System option and fill in the URL of the KPI_Registry_Activity.tbox Toolbox. Then click on the Installbutton button.

Info
titleTip

If the BAM Toolbox fails to install from the URL download the KPI_Registry_Activity.tbox Toolbox to your local file system and upload it.

...

5. Add the following dependencies to your POM file:

Info
titleTip

Project Object Model (POM) is an XML representation of a Maven project held in a file named pom.xml. You should find POM file by the name pom.xml inside GREG_HOME/ samples/handler/src.

...

Code Block
languagehtml/xml
<!--Fragment-Host>org.wso2.carbon.registry.core</Fragment-Host-->
Tip
Info
title

The Fragment-Host Bundle Manifest Header declares this sample bundle to be a Fragment of the Registry Kernel. This would mean that the sample handler bundle will become an extension to the Registry Kernel. However, bundles containing services.xml files would not be deployed until the Apache Axis2 runtime has been initialized. Due to OSGi bundle start-up order, it is required that the Registry Kernel starts up before the Apache Axis2 runtime.

Since the Fragment now also being an extension to the Registry Kernel, the combination of this bundle and the Registry Kernel (plus any other fragments) should start up before the Apache Axis2 runtime. But, due to the bundle not getting deployed until the Apache Axis2 runtime has been initialized, it will create a deadlock situation. Due to this reason, we have to get rid of the Fragment-Host header.

...

Code Block
mvn clean install
title
Info
Note

The command mvn clean install will trigger an Apache Maven Build in your command line. This requires you having installed Apache Maven. See Installing Apache Maven on Windows or Installing Apache Maven on Linux See Installation Prerequisites for more information on downloading this.

A successful run of Apache Maven will generate a report similar to the following:

...

  • Event - Update
  • Notification - SOAP
  • Endpoint - http://localhost:9763/services/Subscriber
  • Hierarchical Subscription Method - Collection, Children and Grand Children

...

13. Now perform various operations on the registry such such Adding/Updating Resources, Setting Properties etc. This should generate notifications which will then be forwarded for BAM. You should see lines similar to the following printed on your command prompt, which indicates that you events were successfully generated. For best results, create multiple user accounts and log in using different credentials while you perform operations.

...