Why?

Oracle B2B provides a nice console to configure document definitions, trading partners, and trading partner agreements. That said, all of this configuration can be quite complex. Maintaining control over the configuration and ensuring an adequate baseline is not easy. This plugin aids Continuous Deployment by adding a ‘development workflow’ for B2B artifacts.

Details

Rather than supplant the B2B Console, the plugin embraces the existing B2B Console as the “IDE” where B2B artifacts are created or edited. The change is in how those projects are migrated from one environment to the next.

Practically speaking, the plugin serves as an “intelligent wrapper” around the existing Oracle B2B ANT tasks. It calls the core import/export tasks (which produce/consume document definitions, trading partners, and trading agreements in XML files), adapts them to the Maven lifecycle, and applies some tweaks to ease the development experience when storing these in source control. See github.com/avioconsulting/b2b-maven-plugin for more information about how that works.

Usage

Installation/environment setup

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

Create a project

There are two types of projects that need to be defined:

Document definitions

These projects will contain document definitions (e.g. EDI_X12 variants) that specific trading partners/agreements, which can be specified in other projects, will then depend on. You’re expected to ensure this project is run/deployed before the trading partner projects.

Trading partners/agreements

These projects contain specific trading partners and agreements that reference the document definitions. The main practical difference from the plugin’s point of view as compared to document definition projects has to do with ID/XML reformatting and additional deployment steps. The plugin is designed to eventually allow separate Maven projects for each trading partner to allow granular deployments. Read about the Maven goals on the Github site for more information.

POM setup

Note the different properties based on each project style below:

<?xml version="1.0" encoding="UTF-8"?>
<project >
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.evhc</groupId>
  <artifactId>tradingpartner1B2BDoc</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Super POM for tradingpartner1</description>
  <packaging>b2b</packaging>
  
  <properties>
    <b2b.artifact.type>DocumentDefinitions</b2b.artifact.type>
    
    <!-- OR -->

    <b2b.artifact.type>PartnersAndAgreements</b2b.artifact.type>
    <!– These should match up with the trading partner names from the B2B console that you wish to include in this project. This will be used by the export goal to filter. Due to the ID issue in the wish list, include all names here –>
<b2b.partners>AVIOConsulting,A_PARTNER</b2b.partners>
<!– These should match up with the trading partner agreement names from the B2B console that you wish to include in this project. This will be used by the export goal to filter. Due to the ID issue in the wish list, include all names here –>
<b2b.agreements>837Agreement,999Agreement</b2b.agreements>


    <!-- Applicable to both -->
    <soa.t3.url>t3://soa_server_hostname:soa_server1_port</soa.t3.url>
    <weblogic.user>username</weblogic.user>
    <weblogic.password>thepassword</weblogic.password>
  </properties>
  
  <build>
    <plugins>
      <plugin>
         <groupId>com.avioconsulting</groupId>
         <artifactId>b2b-maven-plugin</artifactId>
         <version>1.0.8</version>
         <extensions>true</extensions>
         <configuration>
          <soaDeployUrl>${soa.t3.url}</soaDeployUrl>
          <!-- If you're using settings.xml for these, need to repeat them here, overriden values from settings.xml do not make it into the plugin for some reason -->
          <weblogicUser>${weblogic.user}</weblogicUser>
          <weblogicPassword>${weblogic.password}</weblogicPassword>
        </configuration>
     </plugin>
    </plugins>
  </build>
</project>

Exporting to source control

As mentioned above, B2B artifacts are first created/edited in the B2B Console. 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 -Db2b.export=true generate-resources

As part of the export process, trading partner IDs/filenames are altered to be more consistent along with consistent XML node order. This aids in useful source control diffs. After running this, ensure you check in all changed files.

Deployment

When it’s time to promote B2B artifacts to another environment, it’s another simple Maven command:

mvn pre-integration-test

This command will package up the B2B artifacts from source control and import it into the B2B metadata repository on the server.

Details/source code

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