Deploying BAM artifacts

Compared to SOA and OSB, BAM is definitely an outlier in terms of functionality as well as a method of migrating code into various environments. To begin with, the development of BAM artifacts is done on the server, whereas SOA and OSB development is primarily done in JDeveloper.

Note

OSB services can also be developed through the Service Bus Console.

This means that in some ways the deployment process is much easier, since there are really only two steps for exporting and importing BAM artifacts. Both of these steps are accomplished with the same tool, BAMCommand.

BAM artifacts, as mentioned earlier, can take the form of data objects, business queries, KPIs, business views, dashboards, alerts, or parameters.

Note

BAMCommand is the successor of ICommand, which was used in the earlier versions of Oracle SOA Suite 10g and 11g.

It is similar in many respects, but provides some additional commands, making it possible to import artifacts and data from 11g into the new 12c environment. The full details for migration between the major releases can be found at http://docs.oracle.com/middleware/1213/core/FUPSS/bam.htm#FUPSS256.

Setting up the environment

The BAMCommand tool can be used from the middleware installation where BAM exists, but it can also be run remotely. To run it remotely, an installation of BAM or JDeveloper will suffice. In either case, bamcommand (bamcommand.cmd for Microsoft Windows) is located in the $MW_HOME/soa/bam/bin directory.

Setting up the environment path

In your environment, we assume that Oracle SOA Suite 12c is installed, and more specifically, Oracle BAM 12c is installed, as it will include all the required binaries to run BAMCommand.

In this section, we assume that all BAM objects will be imported and exported to a $CODE directory. To set up your environment, we recommend you to first create the setBAMEnv.sh shell script with the following content:

export CODE=/home/oracle/bamcode
export MW_HOME=/u01/app/oracle/middleware
export JAVA_HOME=$MW_HOME/jdk1.7.0_15
export PATH=$MW_HOME/soa/bam/bin:$PATH:.

Modify the parameter values to reflect your environment.

Updating the configuration file

BAMCommandConfig.xml is located in $MW_HOME/soa/bam/bin alongside the bamcommand executable. It contains a number of parameters that are used whenever they are not provided in the command line. An example of BAMCommandConfig.xml can be found here:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BAMCommandConfig>
  <host>soahost1</host>
  <port>9001</port>
  <username>weblogic</username>
  <password>welcome1</password>
  <!-- Below fields only needed when using -migrate -->
  <dbusername>DEV_SOAINFRA</dbusername>
  <dbpassword>welcome1</dbpassword>
  <dburl>jdbc:oracle:thin:@soadb:1521:orcl</dburl>
</BAMCommandConfig>

Update the settings in this file to reflect your environment. Note that the port number should be that of the BAM managed server and not the AdminServer. Alternatively, you may choose to pass these arguments through the command line.

Exporting BAM artifacts

Since the development process begins on the runtime environment before anything can be deployed, it must first be exported from the existing environment, often a development environment. To export an object, issue the following commands:

source setBAMEnv.sh
bamcommand -cmd export -name "Hello/World" -file "$CODE/World.zip

The command exports an object named World located in the Hello directory on the server, and the generated output is exported to a file named World.zip. This ZIP file will later be used to import the object into a target server. In Oracle SOA Suite 12c, we do not have to explicitly specify the type of this object, whether it is a data object, rule, or otherwise.

Importing BAM artifacts

Once objects have been exported, they can be imported into a target BAM server. This is done with the import command after the -cmd argument:

source setBAMEnv.sh
bamcommand -cmd import -file "$CODE/World.zip"

When an import is performed, the fully qualified file path should be provided for the -file argument. There are many command-line arguments available that can provide further options and control. Additional information can be found in Chapter 17, Oracle Fusion Middleware Monitoring Business Activity with Oracle BAM at http://docs.oracle.com/middleware/1213/bam/BAMUG/bam-using-commands.htm. Using the command file to perform multiple operations

The command file can make it easy to perform many operations on objects consistently within BAM. However, the command file is limited to the <Export>, <Delete>, and <Rename> commands. Within each of these commands, it is possible to provide most of the options, including continue on error, as if they were being called individually. The bamcommand argument can make a very handy tool when you want to clone a BAM environment, since once all the objects are listed, then they can be exported into an archive or series of files.

An example command.xml file is shown as follows:

<?xml version="1.0" encoding="utf-8"?>
<OracleBAMCommands continueonerror="1">
  <Export name="Test/Hello World" file="Hello World.xml" contents="0" />
  <Rename name="Test/Foo" newdisplayname="Bar" />
  <Delete type="EMS" name="ApacheLog" />
</OracleBAMCommands>

In this command file, we are performing three functions: exporting a BAM artifact, renaming a BAM artifact, and deleting a BAM artifact.

We can reference the BAM command file through the -cmdfile argument. An example is shown using our previous example, command.xml:

source setBAMEnv.sh
bamcommand -cmdfile "command.xml"
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.183.210