The following code shows how to programatically add Documents to be logged by WmMonitor. I leave it as an exercise to the reader to extract the variables from the pipeline appropriately and to properly manage any exceptions.
You may wish to call this code during the startup of your package to ensure that your logging documents appropriately to wmMonitor.
IDataCursor passedCursor = pipeline.getCursor();
IDataUtil.put( passedCursor, "clientGroup", "<the broker client group that hosts wmMonitor>" );
IDataUtil.put( passedCursor, "clientGroupTypes", "clientGroupLogPublishTypes" ); IDataUtil.put( passedCursor, "serverName", "<the broker server>" );
IDataUtil.put( passedCursor, "brokerName", "<the broker name>" );
IDataUtil.put( passedCursor, "clientGroupTypesTitle", "Log+Publish&clientGroupEncoded=true" ); IDataUtil.put( passedCursor, "selection." + "<The name of the document using broker syntax, ie :: delimiters>", "on" );
try
{
Service.doInvoke("wm.broker.admin.clientgroups", "addClientGroupTypes", pipeline);
}
catch (Exception e)
{
throw new ServiceException("exception during my invoke:" + e.getMessage());
}
Note that 'brokerName' is the name of the broker WITHOUT the server name. Eg., if the name of your broker displayed on your Broker Admin page is 'Broker #1@localhost', you should set 'brokerName' to 'Broker #1'.
The trickiest part of this code is the final IDataUtil.put method, that constructs a name that is a combination of "selection." and the name of your document, for example, it could look like "selection.cwCanonical::SalesOrderDocs::SalesOrder".
For the astute reader, this code is derived from the appropriate dsp pages for adding document logging to wmMonitor.
 | Remember
To enable any document logging in wmMonitor, you must enable DocumentType Logging for this broker as defined in the LoggingAndMonitoring Guide that comes with your installation. |