ProcessDirectory pd = workflowService().processDirectory();
Collection processes = pd.processes();
for (Iterator it=processes.iterator(); it.hasNext();) {
try {
Process process = (Process)(it.next());
pd.removeProcess(process);
} catch (Exception e) {
// process not in database anymore, so it is not running anymore
}
}
}