I am assuming that you are aware of the risks of modifying the WmRoot code. As long as you are willing to accept the risk here is what you can do :
Lets assume that you want to override the service
wm.server.ns:lockNode
This is the service that is invoked everytime a node is locked.
- Shutdown the Integration Server. Backup the WmRoot package so that you can fall back to the original server if needed. Go to the folder
packages\WmRoot\ns\wm\server\ns
-
Create a copy of the folder named lockNode. Rename the copy to lockNodeOld.
-
Now traverse into the lockNodeOld folder and open the file named node.ndf in an editor. There should be a few lines at the end of the file that look as under :
<record name=“java_data” javaclass=“com.wm.util.Values”>
<value name=“class”>wm.server.nsimpl</value>
<value name=“method”>lockNode</value>
</record
Change the “lockNode” text to “lockNodeOld”. Save the file and exit the editor.
- Using you preferred java tool (not Developer ;-)) create a new java class. Lets assume that you name it “NSImpl” and put it in a java package (not webm package) named “my.server”. So the fully qualified name of the class would be “my.server.NSImpl”.
Add a method to this class that has the following signature :
public static final synchronized void lockNode(IData pipeline) throws ServiceException
- You can write your code to checkOut the code from your favorite Source Code Management tool here in this method. Make sure that you dont forget to invoke the old lockNode service by using :
Service.doInvoke(“wm.server.ns”, “lockNodeOld”, pipeline)
-
Compile this class and place the compiled class in the folder
packages\WmRoot\code\classes
-
Open the file packages\WmRoot\ns\wm\server\ns\lockNode\node.ndf and change the following lines
<record name=“java_data” javaclass=“com.wm.util.Values”>
<value name=“class”>wm.server.nsimpl</value>
<value name=“method”>lockNode</value>
</record>
to
<record name=“java_data” javaclass=“com.wm.util.Values”>
<value name=“class”>my.server.NSImpl</value>
<value name=“method”>lockNode</value>
</record>
making sure to use the fully qualified name of the class you created in step 4.
Restart the server and you are good to go.
You can use this strategy to override any webMethods service with your own proxy service. I had implemented a similar checkIn/checkOut strategy in IS 4.6 days when there was no locking/unlocking available. So I had overridden putNode to invoke my own code that would check whether the node was checkedOut by the current user and throw an exception if it was not. When you throw an exception, the logged in user can see the text of the exception in developer. I had implemented the checkin/checkout feature through dsp as there are no hooks to add menu items to developer.
#webMethods#Integration-Server-and-ESB#Flow-and-Java-services