Get a list of Triggers from IS

What is the best way to get a list of triggers from IS. Is there any built in service for this? Which API to be used to get a list of triggers defined in IS, if there are no built in services.

Thanks

Siby,

Get all nodes from a package using:

Vector nodes = PackageManager.getNodes(pkgName)

Then loop over the nodes and for each NSNode, get the type:

for (int j = 0; j < nodes.size(); j++) { 
  NSNode node = (NSNode)nodes.get(j); 
  if (node.getNodeTypeObj().getType().toLowerCase().indexOf("trigger") >= 0) { 
    // here some code to add the node object to a list 
}}

You will end up with a list of nodes (or attributes thereof) which are all triggers. If you want to do this for all packages, just enclose the above code in another loop going over PackageManager.getAllPackages().

Hope this suffices. Otherwise, post your issues :wink:

Thanks Chris. I built a Java service to get a list of triggers. I could not find documentation for these classes (PackageManager, NSNode etc) in the API reference. Probably they are not exposed to users. Is there any other place I can look for these API documentation?

I need to eliminate the triggers which are disabled, from the list. How do we accomplish this in the Java service. Any method?

Thanks
Siby

Hi Chris\ALL,
It would be great if you share API & along with their documentation e.g PackageManager, NSNode etc.
Or else tell from where can one get it?

Regards,
Puneet Saxena

Well, there isn’t any documentation. Officially :wink: If you download jCavaj ([url=“http://www.download.com/JCavaj-Java-Decompiler/3000-2417-10149800.html”]http://www.download.com/JCavaj-Java-Decompiler/3000-2417-10149800.html[/url]) you can decompile & read the classes in the server.jar which should get you a long way… Another tip is to use the source of the DSP pages. If you need to Java something you know is available in DSP (eg. WmRoot), use the source of the DSP to trace the service & then use the decompiler to check within the service which API calls are made.

Good luck, Chris

PS. You might want to check for new versions of jCavaj.