Wednesday, September 5, 2012

Creating Socket Adapter connection factories through WLST script - Oracle SOA Suite

Creating Socket Adapter connection factories through WLST script - Oracle SOA Suite

The below WLST script will help us to create the Socket adapter connection factories in Oracle SOA Suite 11g or Oracle SOA Suite 12c

Change the Socket/SOA server details accordingly in the script.

Before executing the script make sure the SocketAdapter is targeted to the servers.

socket_adapter_target_servers

CreateSocketConnectionFactory.py

TargetServerName='AdminServer'

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

appPathSock=soaHome+'\soa\connectors\SocketAdapter.rar'
appNameSock='SocketAdapter'
moduleOverrideNameSock=appNameSock+'.rar'
SockJNDIName = 'eis/socket/SocketAdapterBlog'
#Socket Sever Details
HostName='101.63.203.129'
Password='blogenv1'
Port='7001'
UserName='weblogic'

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

def createSocketConnectionFactory(): 

        edit()
        startEdit()
        startApplication(appNameSock)
        myPlanSock=loadApplication(appPathSock, planPathSock)
        makeDeploymentPlanVariable(myPlanSock,'ConnectionInstance_eis/Socket_JNDIName_13102979357209', SockJNDIName , '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+SockJNDIName+'"]/jndi-name',moduleOverrideNameSock)
        makeDeploymentPlanVariable(myPlanSock, 'ConfigProperty_eis/Socket_JNDIName_Host_Name_13102979357210', HostName,'/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+SockJNDIName+'"]/connection-properties/properties/property/[name="Host"]/value',moduleOverrideNameSock)
        makeDeploymentPlanVariable(myPlanSock, 'ConfigProperty_eis/Socket_JNDIName_Port_13102979357212', Port,'/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="javax.resource.cci.ConnectionFactory"]/connection-instance/[jndi-name="'+SockJNDIName+'"]/connection-properties/properties/property/[name="Port"]/value',moduleOverrideNameSock)
               
        myPlanSock.save();
        save();
        cd('/AppDeployments/SocketAdapter/Targets');
        updateApplication(appNameSock, planPathSock);
        startApplication(appNameSock);
        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)
       createSocketConnectionFactory()
       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 CreateSocketConnectionFactory.py




DOWNLOAD  CreateSocketConnectionFactory.py

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