You can use the workclassoperations.py script to create, update, and manage work classes.
The workclassoperations.py script is located in the install_root/bin directory.
./wsadmin.sh|bat -lang jython -f workclassoperations.py operation --help
./wsadmin.sh -lang jython -f ..\..\..\bin\workclassoperations.pyNote that if the deployment manager is not started, you must include the additional parameter -conntype NONE:
./wsadmin.sh -lang jython -conntype NONE workclassoperations.py
./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses
./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses --appname Trade
./wsadmin.sh|bat -lang jython -f workclassoperations.py createWorkClass --type ARP --wcname CustomWorkClass --protocol HTTP --wcaction "reject?404" --appname Trade --module myModule.war --members "/test1?/test2"
./wsadmin.sh|bat -lang jython -f workclassoperations.py listWorkClasses --type ARP --appname Trade
./wsadmin.sh|bat -lang jython -f workclassoperations.py getDefaultAction --type ARP --wcname CustomWorkClass --appname Trade
./wsadmin.sh|bat -lang jython -f workclassoperations.py modifyDefaultAction --type ASP --wcname Default_HTTP_WC --wcaction Default_TC --appname Trade-edition1.0
import java.lang.System as System wasinstallroot=System.getProperty("was.install.root") execfile(wasinstallroot+"/bin/XDPYModules.py") import java.lang.System as System wasinstallroot=System.getProperty("was.install.root") execfile(wasinstallroot+"/bin/XDPYModules.py") #application with name DayTrader installed with edition 1.2 appName="DayTrader-edition1.2" #Default_TC_GOLD is the default transaction class mapped to service policy GOLD modifyAppSLADefaultAction("Default_HTTP_WC", appName, tcName, 0) AdminConfig.save()
./wsadmin.sh|bat -lang jython -f workclassoperations.py addRules --wcname CustomWorkClass --appname Trade --type ARP --rule "1?clienthost=\'localhost\' and serverhost like \'\%%.ibm.com\'?permit?Trade"
./wsadmin.sh|bat -lang jython -f workclassoperations.py removeRule --wcname CustomWorkClass --appname Trade --type ARP --priority 1
./wsadmin.sh|bat -lang jython -f workclassoperations.py removeWorkClass --type ARP --wcname CustomWorkClass --appname Trade