KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.enhydra.shark.swingclient.workflowadmin.monitoring.actions;
2
3 import java.awt.event.*;
4
5 import javax.swing.*;
6
7
8 import org.enhydra.shark.api.client.wfmodel.*;
9 import org.enhydra.jawe.xml.elements.*;
10 import org.enhydra.shark.swingclient.*;
11 import org.enhydra.shark.swingclient.workflowadmin.monitoring.*;
12
13 /**
14  * Aborts selected activity.
15  *
16  * @author Sasa Bojanic
17  * @version 1.0
18  */

19 public class AbortActivity extends ActionBase {
20
21    public AbortActivity (ManageActivities ma) {
22       super(ma);
23    }
24
25    public void actionPerformed(ActionEvent e) {
26       ManageActivities ma=(ManageActivities)actionPanel;
27       Activity act=ma.getSelectedActivity();
28       try {
29          WfActivity lastActivityForDefinition=ma.getLastActivityForDefinition(act,"open",1);
30          lastActivityForDefinition.abort();
31          ma.updateListDisplay(act);
32          ma.updateProcessView();
33          JOptionPane.showMessageDialog(ma.getWindow(),
34             lastActivityForDefinition.name()+": "+
35             ResourceManager.getLanguageDependentString(
36             "MessageActivityIsAborted"),
37             SharkClient.getAppTitle(),JOptionPane.WARNING_MESSAGE);
38          ma.updateProcessView();
39       } catch (Exception JavaDoc ex) {
40          JOptionPane.showMessageDialog(ma.getWindow(),
41             ResourceManager.getLanguageDependentString(
42             "MessageActivityCannotBeAborted"),
43             SharkClient.getAppTitle(),JOptionPane.WARNING_MESSAGE);
44       }
45    }
46
47 }
48
49
Popular Tags