Modifying the starting weight of applications using scripting

Use the wsadmin tool and scripting to modify the starting weight of an application.

 

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

 

About this task

To modify the starting weight of an application, perform the following steps:

 

Procedure

  1. Retrieve the configuration ID of the object that you want to modify and set it to the dep variable. For example:

    • Using Jacl

      set dep [$AdminConfig getid /Deployment:MyApp/]
      

    • Using Jython

      dep = AdminConfig.getid("/Deployment:MyApp/")
      

  2. Identify the deployed object and set it to the depObject variable. For example:

    • Using Jacl

      set depObject [$AdminConfig showAttribute $dep deployedObject]
      

    • Using Jython

      depObject = AdminConfig.showAttribute(dep, "deployedObject")
      

  3. Show the current attribute values of the configuration object with the show command, for example:

    • Using Jacl

      $AdminConfig show $depObject startingWeight
      

      Example output:

      {startingWeight 1}
      

    • Using Jython

      AdminConfig.show(depObject, 'startingWeight')
      

      Example output:

      [startingWeight 1]
      

  4. Modify the attributes of the configuration object with the modify command, for example:

    • Using Jacl

      $AdminConfig modify $depObject {{startingWeight 2}}
      

    • Using Jython

      AdminConfig.modify(depObject, [['startingWeight', '2']])
      

  5. Verify the changes that you made to the attribute value with the show command, for example:

    • Using Jacl

      $AdminConfig show $depObject startingWeight
      

      Example output:

      {startingWeight 2}
      

    • Using Jython

      AdminConfig.show(depObject, 'startingWeight')
      

      Example output:

      [startingWeight 2]
      


Related tasks
Using the AdminConfig object for scripted administration Related reference
Commands for the AdminConfig object