April 6 2017

Oracle BAM dashboards and user objects can be quite powerful. All of the sophisticated dashboards and user objects in the world are not as useful though if migrating them from a test to a production environment is a tedious, error-prone process. Oracle provides a utility to import/export BAM information and AVIO has a Maven plugin that aids in calling that import/export utility using baselined BAM information in source control. This helps make Continuous Deployment possible by adding a "development workflow" to Oracle BAM.

Details

The way Oracle BAM dashboards and data objects are built does not change. The BAM Composer is still used to create and edit BAM projects. The change is in how those projects are migrated from one environment to the next.

The architecture of the plugin is quite simple, mainly just wrapping the bamcommand utility that's already present on SOA Suite installs and JDeveloper/SOA Suite Quick Start installs. It might be the case that the best environment for business users, etc. to create/customize dashboards is a test/UAT environment which tends to have better data than a development environment. The catch is that test or production environments often have limited developer access. In order to allow read-only/export access to those environments, this plugin is designed to work with a "proxy" SOA composite that runs bamcommand on the privileged environment and sends the ZIP file containing the export back to the developer's machine using a SOAP reply.

Once the exported ZIP from Oracle is obtained, it's automatically unzipped and the XML files that make up the BAM artifacts are put in a directory structure that can be versioned.

Usage

Installation/environment setup

The plugin is currently available only via source. Visit github.com/avioconsulting/bam-maven-plugin and follow the instructions on how to build/install.

Whatever machine runs the Maven deployment will also need network access to the port of the Weblogic BAM managed server(s).

Create project/setup POM

Just create an empty directory and place the POM below in it. In particular, the bam.project property needs to be set to the same project used in the BAM composer.

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.avioconsulting.project</groupId>
  <artifactId>Bam</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Project for BAM artifacts</description>
  <packaging>bam</packaging>

  <properties>
    <bam.project>BAMProjectName</bam.project>
    <!-- Business user dashboard development happens in TEST -->
    <bam.export.endpoint>https://test.environment/soa-infra/services/default/BAMExporter/bamexporterprocess_client_ep</bam.export.endpoint>
    <weblogic.user>username</weblogic.user>
    <weblogic.password>thepassword</weblogic.password>
    <bam.hostname>thebamserverhostname</bam.hostname>
    <bam.port>thebamserverport</bam.port>
  </properties>

  <build>
    <plugins>     
      <plugin>
         <groupId>com.avioconsulting</groupId>
         <artifactId>bam-maven-plugin</artifactId>
         <version>1.0.0</version>
         <extensions>true</extensions>
         <configuration>
             <!-- If we don't repeat the username here, overriden values from settings.xml do not make it into the plugin for some reason -->
            <weblogicUser>${weblogic.user}</weblogicUser>
            <!-- not sure if problem is happening w/ password but included it for above reason -->
            <weblogicPassword>${weblogic.password}</weblogicPassword>
         </configuration>
     </plugin>
    </plugins>
    <!-- see copy-project-properties above for why we're doing this -->
    <filters>
      <filter>${project.basedir}/../../../env/${env}.properties</filter>
    </filters>
  </build>
</project>

Exporting to source control

As mentioned above, BAM artifacts are first created/edited in the BAM Composer. When you are ready to take a baseline (this should happen often, not far off from how often regular code is committed), run the following:

mvn -Dbam.export=true generate-resources

Deployment

When it's time to promote BAM artifacts to another environment, it's another simple Maven command:

mvn pre-integration-test

This command will package up the BAM artifacts from source control and import it into the BAM server using the Oracle utility.

Details/source code

For more details about the Maven goals/lifecycle the plugin implements and for the source code, visit github.com/avioconsulting/bam-maven-plugin.

About the Author

Bio

Brady has worked in various aspects of the software lifecycle for 12 years. His interests include test driven/agile development, using TDD to deliver more secure software, governance, pragmatic architecture, and polyglot approaches to solving problems. He has worked with health care, financial services, energy, travel, and government clients.

Join the Conversation

Enter your first name. It will only be used to display with your comment.
Enter your email. This will be used to validate you as a real user but will NOT be displayed with the comment.
By submitting this form, you accept the Mollom privacy policy.