Invoke a Service Similar to an Event Handler

Execute a service (i.e. checkFilesOutOfPVCS) when another service (i.e. wm.server.ns:unlockNode) is executed. As you can see, I am trying to tie together unlocking a service with checking it out.

I have tried to use the audit event handler, but you can’t audit the root services.

I would like to put a line of code within the WMRoot package that does a checkin/out when the service is locked/unlocked.

Anyone have any thoughts on how I can do this?


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


This is the service that is invoked everytime a node is locked.

  1. Shutdown the Integration Server. Backup the WmRoot package so that you can fall back to the original server if needed. Go to the folder


  1. Create a copy of the folder named lockNode. Rename the copy to lockNodeOld.

  2. 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>

Change the “lockNode” text to “lockNodeOld”. Save the file and exit the editor.

  1. 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

  1. 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)

  1. Compile this class and place the compiled class in the folder

  2. 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 name=“java_data” javaclass=“com.wm.util.Values”>
<value name=“class”>my.server.NSImpl</value>
<value name=“method”>lockNode</value>

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.

Thanks…I wouldn’t say we ‘considered’ creating a new WmRoot package since we would need to deploy it to numerous different environments across multiple projects (>25 WM servers). Upgrading servers would be a nightmare.

But the logic is essentially what I would like to mimic. The event handler allows you to trigger an event on an audit message. Unfortunately, you can’t audit WmRoot services, then find perform logic if the audit event was the locking or unlocking of a node.

I think the DSP would be something easy to create, but obviously not as user friendly as I would like it to be since its just another interface.

I had been looking through the WM code to find something that would trigger an event based on the service usage to no avail.

It seems to me that there should be some snipit of code that can do an ‘on event’ invocation based on the service usage.

Please let me know if you find anything…and I will post it here if I do.