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.
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
DOWNLOAD CreateBAMConnectionFactory.py CreateBAMConnectionFactory_12c.py
No comments:
Post a Comment