Use the commands in the BLAManagement command group to manage composition units. Use the examples in this topic to add, remove, edit, export, and view composition units.
There are two ways to complete the examples in this task. Use the BLAManagement command group for the AdminTask object to manage composition units. Alternatively, you can use the scripts in the AdminBLA script library to administer your composition unit configurations.
Composition units can represent deployed assets, other business-level applications, or external artifacts that are deployed on non-WebSphere® Application Server runtime environments without associated assets. Business-level applications contain zero or more composition units. You cannot add the same composition unit to more than one business-level application, but you can use one asset to create more than one composition unit.
AdminTask.addCompUnit('-blaID myBLA –cuSourceID asset1 -CUOptions [[.* .*
compositionUnit1 "composition unit that is backed by asset1" 0]] -MapTargets
[[.* server1]]
–ActivationPlanOptions [.* specname=actplan0+specname=actplan1]')
AdminTask.addCompUnit('-blaID myBLA –cuSourceID asset2 -CUOptions [[.* .*
compositionUnit2 "composition unit that is backed by asset2" 0]] -MapTargets [[.*
server1+testServer]] –ActivationPlanOptions [.* specname=actplan0+specname=actplan1]')
AdminTask.addCompUnit('[-blaID myBLA –cuSourceID J2EEAsset
–defaultBindingOptions defaultbinding.ejbjndi.prefix=ejb# defaultbinding.virtual.host=default_host#
defaultbinding.force=yes –AppDeploymentOptions [-appname defaultapp -installed.ear.destination
application_root/myCell/defaultapp.ear] –MapModulesToServers [[defaultapp.war
.* WebSphere:cell=cellName,node=nodeName,server=server1][Increment.jar .*
Websphere:cell=cellName,node=nodeName,server=testServer]] -CtxRootForWebMod [[defaultapp.war .*
myctx/]]]')
If you are editing a composition unit to update a shared library, you must first manually stop all Java EE applications that depend on that shared library. After updating the shared library, manually restart the Java EE applications. Java EE applications do not automatically restart when a shared library is updated.
WebSphere:cuname=compositionUnit1 WebSphere:cuname=compositionUnit2
WebSphere:cuname=J2EEAsset
AdminConfig.save()
Use the listCompUnits and viewCompUnits commands to display the configuration IDs of each composition unit that matches a specific search scope.
AdminTask.listCompUnits('-blaID blaname=myBLA')
Websphere:cuname=cu1 asset Websphere:cuname=cu4 bla WebSphere:cuname=defaultapp
__j2ee
AdminTask.viewCompUnit('-blaID myBLA -cuID cu1')
Specify Composition Unit options (CUOptions) Specify name, description options for
Composition Unit. Parent BLA (parentBLA): [WebSphere:blaname=myBLA] Backing Id (backingId):
[WebSphere:assetname=asset1.zip]
Name (name): [cu1] Description (description): [my description of cu1 composition unit] Starting Weight
(startingWeight): [0]
Specify servers (MapTargets) Specify targets such as application servers or clusters of application servers
where you want to deploy the composition unit contained in the application. Deployable Unit (deplUnit):
[default] *Servers (server):
[WebSphere:node=myNode,server=server1] Specify Composition Unit activation plan options (ActivationPlanOptions)
Specify composition unit activation plan optionsDeployableUnit Name (deplUnit):
[default] Activation Plan (activationPlan):
[WebSphere:specname=actplan0+WebSphere:specname=actplan1]
AdminTask.editCompUnit('-blaID myBLA –cuID cu1 –CUOptions [[.* .* cu1
cudesc 1]] -MapTargets [[.* server2]] -ActivationPlanOptions [.*
#specname=actplan0+specname=actplan2]')
WebSphere:cuname=cu1
AdminConfig.save()
AdminTask.deleteCompUnit('-blaID myBLA –cuID cu1')
WebSphere:cuname=cu1
AdminConfig.save()