Tuesday, September 4, 2012

Creating Oracle BAM Adapter connection factories through WLST script in Oracle SOA Suite

Creating Oracle BAM Adapter connection factories through WLST script in Oracle SOA Suite

The below WLST script will help us to create the Oracle  BAM adapter connection factories in Oracle SOA Suite.
Change the BAM/SOA server details accordingly.

Before executing the script make sure the OracleBamAdapter is targeted to the server.

oraclebamadapter_target_server

CreateBAMConnectionFactory.py

TargetServerName='AdminServer'

soaHome='C:\EnvSetup\MiddlewareBlog\Oracle_SOA1'

appPathBAM=soaHome+'\soa\connectors\OracleBamAdapter.rar'
appNameBAM='OracleBamAdapter'
moduleOverrideNameBAM=appNameBAM+'.rar'
BAMJNDIName = 'eis/BAM/Connection'
#BAM Server Details
HostName='localhost'
Password='blogenv1'
Port='7001'
UserName='weblogic'

moduleDescriptorName='META-INF/weblogic-ra.xml'
planPathBAM='C:\EnvSetup\MiddlewareBlog\Oracle_SOA1\soa\connectors\Plan_BAM.xml'

def createBAMConnectionFactory(): 

        edit()
        startEdit()
        startApplication(appNameBAM)
        myPlanBAM=loadApplication(appPathBAM, planPathBAM)
        makeDeploymentPlanVariable(myPlanBAM, 'ConnectionInstance_eis/BAM/BAM_JNDIName_13102979357209', BAMJNDIName , '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+BAMJNDIName+'"]/jndi-name',moduleOverrideNameBAM)
       
        makeDeploymentPlanVariable(myPlanBAM, 'ConfigProperty_eis/BAM/BAM_JNDIName_Host_Name_13102979357210', HostName,'/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="oracle.bam.adapter.adc.RMIConnectionFactory"]/connection-instance/[jndi-name="'+BAMJNDIName+'"]/connection-properties/properties/property/[name="HostName"]/value',moduleOverrideNameBAM)
       
        makeDeploymentPlanVariable(myPlanBAM, 'ConnectionInstance_eis/BAM/BAM_JNDIName_Password_13102979357211', Password , '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="oracle.bam.adapter.adc.RMIConnectionFactory"]/connection-instance/[jndi-name="'+BAMJNDIName+'"]/connection-properties/properties/property/[name="Password"]/value',moduleOverrideNameBAM)
       
        makeDeploymentPlanVariable(myPlanBAM, 'ConfigProperty_eis/BAM/BAM_JNDIName_Port_13102979357212', Port,'/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="oracle.bam.adapter.adc.RMIConnectionFactory"]/connection-instance/[jndi-name="'+BAMJNDIName+'"]/connection-properties/properties/property/[name="PortNumber"]/value',moduleOverrideNameBAM)
       
        makeDeploymentPlanVariable(myPlanBAM, 'ConnectionInstance_eis/BAM/BAM_JNDIName_UserName_13102979357211', UserName , '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="oracle.bam.adapter.adc.RMIConnectionFactory"]/connection-instance/[jndi-name="'+BAMJNDIName+'"]/connection-properties/properties/property/[name="UserName"]/value',moduleOverrideNameBAM)
       
        myPlanBAM.save();
        save();
        cd('/AppDeployments/OracleBamAdapter/Targets');
        updateApplication(appNameBAM, planPathBAM);
        activate(block='true');
      
   
def makeDeploymentPlanVariable(wlstPlan, name, value, xpath,overrideName, origin='planbased'):
    wlstPlan.destroyVariable(name)
    wlstPlan.destroyVariableAssignment(name, overrideName, moduleDescriptorName)
    variableAssignment = wlstPlan.createVariableAssignment(name, overrideName, moduleDescriptorName)
    variableAssignment.setXpath(xpath)
    variableAssignment.setOrigin(origin)
    wlstPlan.createVariable(name, value)
    print 'moduleDescriptorName=',moduleDescriptorName


def main():
       #SOA Server Details
       adminURL='t3://localhost:7001'
       adminUserName='weblogic'
       adminPassword='blogenv1'
       connect(adminUserName, adminPassword, adminURL)
       createBAMConnectionFactory()
       disconnect()
main()

Login to the server, cd to the folder where the script is available and execute the script as shown below.

%MIDDLEWARE_HOME%\wlserver_10.3\common\bin\wlst.cmd CreateBAMConnectionFactory.py




The same script will not work in Oracle SOA Suite 12c - the connection-factory-interface javax.resource.cci.ConnectionFactory is not working with 12c. Refer the attached script specific to 12c

DOWNLOAD CreateBAMConnectionFactory.py    CreateBAMConnectionFactory_12c.py


Monday, September 3, 2012

Importing the Oracle BAM objects from 10g to 11g

Importing the Oracle BAM objects from 10g to 11g


The icommand utility will be used to export and import the Oracle BAM objects between environments.

This blog will explain how to import the Oracle BAM objects exported from the 10g environment.

Before executing the icommand to import the BAM objects make sure the BAM port name (the default port name is 9001) configured properly in $MIDDLE_HOME/ORACLE_SOA1/bam/config/BAMICommandConfig.xml file.


Import the data object:

icommand -cmd import -file D:\Albin\Docs\SavingsAccountOpeningBAM\SavingsAccountOpening.do -mode preserveid






Configuring Oracle BAM Adapter connection factory through EM console– Oracle SOA Suite


Configuring Oracle BAM Adapter connection factory through EM console– Oracle SOA Suite:

The Oracle BAM Adapter is used as a partner link in a BPEL process to send data to Oracle BAM data object.

The below are the steps to configure the default connection factory, new connection factories also can be created instead of using the default one in Oracle SOA Suite 11g or Oracle SOA Suite 12c

Steps to configure the BAM Adapter:

  • Login WebLogic Admin Console
  • Click Deployments in Domain Structure pane
  • Click on the application OralceBamAdapter
  • Click on Configuration tab
  • Click on Outbound Connection Pools
  • Expand oracle.bam.adapter.adc.RMIConnectionFactory.


Configuring BAM web application properties – Oracle SOA Suite


Configuring BAM web application properties – Oracle SOA Suite

The BAM web application properties should be configured before designing the reports in Oracle BAM, these properties will be configured in reports.

Steps to configure the BAM web application properties

  • Login to EM console and maximize the BAM node
  • Click on OracleBamWeb and click on BAM Web Properties

  • Change the application URL and the Server name as shown below (port should be the BAM server port) and Click on Apply


Saturday, September 1, 2012

Configuring the Caching of WSDL URLs resolved from OSR registry - Oracle SOA Suite



Configuring the Caching of WSDL URLs resolved from Oracle Service Registry - Oracle SOA Suite

Caching of endpoint WSDL URLs occurs by default during runtime. If an endpoint WSDL URL is resolved using the orauddi protocol, subsequent invocations retrieve the WSDL URLs from cache, and not from OSR. 

We can increase the amount of time that the endpoint WSDL URL is available in cache for inquiry by the service key with the UddiCacheLifetime property. This property invalidates the cache at specified time intervals. The default value is 86400 seconds. The minimum value is 300 seconds.

To configure endpoint caching of WSDL URLs:

  1. From the SOA Infrastructure menu, select Administration > System MBean Browser.
  2. Select Application Defined MBeans > oracle.as.soainfra.config > Server: soa_server1 > SoaInfraConfig > soa-infra > Attributes.
  3. Click the UddiCacheLifetime property on the right side of the page.
  4. Enter a value.
  5. Click Apply.