private boolean getNotification(String type) throws RemoteException, IllegalStateFault, IllegalAccessFault, IllegalArgumentFault, InterruptedException { boolean success = false; Thread.sleep(3000); // force delay otherwise getWorkItems return null // get all the management console notifications WorkItem[] workItems = WorkItemClient.getWorkItems(humanTaskAdminClient); for (WorkItem workItem : workItems) { // search for the correct notification if ((workItem.getPresentationSubject().toString()).contains(type)) { success = true; break; } } workItems = null; return success; }