Retrieving the log data for a Unit of Work

The retrieving the log file for a Unit Of Work (UOW) example shows how to find the log file associated with a specific UOW ID.

The retrieving the log data for a Unit Of Work (UOW) example shows how to fetch the log data associated with a specific UOW. Each UOW that is executed will have a corresponding set of log data stored in Netcool Configuration Manager - Base. The log data will show details of what was done in the course of executing the work. It may contain error messages and other diagnostic information. In this example, the getWorkLog method takes as its parameter the return from getWorkKey. There is also a getWorkLog signature that takes a UOWID of type String as its parameter.

ApiSession session;
WorkflowManager wMgr;
Work work;
.
.
.
//it is assumed the session has been established
wMgr = session.workflowManager();
//it is assumed that a Work object has been retrieved
try {
byte[] log = wMgr.getWorkLog(work.getWorkKey());
//now do something with it…
} catch (IcosException ie) {
System.err.println("Exception getting Work log");
ie.printStackTrace();
System.err.println(ie.getNestedExceptionStackTrace());
} catch (Exception e) {
System.err.println("Exception getting Work log");
e.printStackTrace();
}