KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.enhydra.shark.swingclient.workflowadmin.monitoring.actions;
2
3 import java.awt.event.ActionEvent JavaDoc;
4 import org.enhydra.shark.api.client.wfmodel.WfProcess;
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  * Checks deadlines for selected process (if it is not finished), or for all running
11  * processes if process is not selected.
12  *
13  * @author Sasa Bojanic
14  */

15 public class CheckDeadlines extends ActionBase {
16
17    public CheckDeadlines (ProcessMonitor pm) {
18       super(pm);
19    }
20
21    public void actionPerformed(ActionEvent JavaDoc e) {
22       ProcessMonitor pm=(ProcessMonitor)actionPanel;
23       SharkAdmin workflowAdmin=pm.getWorkflowAdmin();
24
25       WfProcess proc=pm.getProcessViewer().getCurrentProcess();
26
27       try {
28          if (proc!=null) {
29             SharkAdmin.getDeadlineAdmin().checkDeadlines(proc.key());
30          } else {
31             String JavaDoc[] failed = SharkAdmin.getDeadlineAdmin().checkDeadlines(5, 12);
32             for (int i = 0; i < failed.length; i++) {
33                SharkAdmin.getDeadlineAdmin().checkDeadlines(failed[i]);
34             }
35          }
36          workflowAdmin.refresh(true);
37       } catch (Exception JavaDoc ex){
38       }
39    }
40 }
41
Popular Tags