KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > swingclient > workflowadmin > monitoring > actions > DeleteFinishedProcesses


1 package org.enhydra.shark.swingclient.workflowadmin.monitoring.actions;
2
3 import java.awt.event.ActionEvent JavaDoc;
4
5 import org.enhydra.shark.swingclient.ActionBase;
6 import org.enhydra.shark.swingclient.workflowadmin.SharkAdmin;
7 import org.enhydra.shark.swingclient.workflowadmin.monitoring.ProcessMonitor;
8
9 /**
10  * Deletes finished processes from DB.
11  *
12  * @author Sasa Bojanic
13  */

14 public class DeleteFinishedProcesses extends ActionBase {
15
16    public DeleteFinishedProcesses (ProcessMonitor pm) {
17       super(pm);
18    }
19
20    public void actionPerformed(ActionEvent JavaDoc e) {
21       ProcessMonitor pm=(ProcessMonitor)actionPanel;
22       SharkAdmin workflowAdmin=pm.getWorkflowAdmin();
23       try {
24          String JavaDoc[] failed = SharkAdmin.getExecAmin().deleteClosedProcesses(5, 12);
25          for (int i = 0; i < failed.length; i++) {
26             SharkAdmin.getExecAmin().deleteClosedProcess(failed[i]);
27          }
28          workflowAdmin.getEngineTreeModel().clear();
29          workflowAdmin.refresh(true);
30       } catch (Exception JavaDoc ex){
31          ex.printStackTrace();
32       }
33    }
34 }
35
Popular Tags