KickJava   Java API By Example, From Geeks To Geeks.

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


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

19 public class ActivityManagement extends ActionBase {
20
21    public ActivityManagement (ProcessMonitor pm) {
22       super(pm);
23    }
24
25    public void actionPerformed(ActionEvent e) {
26       ProcessMonitor pm=(ProcessMonitor)actionPanel;
27       SharkAdmin workflowAdmin=pm.getWorkflowAdmin();
28
29       WfProcess proc=pm.getProcessViewer().getCurrentProcess();
30       if (proc!=null) {
31          List allActs=new ArrayList();
32
33          org.enhydra.jawe.xml.elements.Package pkg=
34             pm.getProcessViewer().getCurrentPackage();
35          WorkflowProcesses wps=(WorkflowProcesses)pkg.get("WorkflowProcesses");
36          String JavaDoc pdId="";
37          try {pdId=SharkAdmin.getAdminMiscUtilities().getProcessDefinitionId(proc.key());}catch (Exception JavaDoc ex){}
38          WorkflowProcess wp=wps.getWorkflowProcess(pdId);
39          Activities acts=(Activities)wp.get("Activities");
40          // adding all process activities
41
allActs.addAll(acts.toCollection());
42
43          // Iterating through all process Activity sets and adding it's activities
44
// IMPLEMENT LATER: SOME OTHER THINGS MUST BE DONE TO MANAGE BLOCK ACTIVITY CONTENT
45
/*Iterator asts=((ActivitySets)wp.get("ActivitySets")).toCollection().iterator();
46          while (asts.hasNext()) {
47             ActivitySet as=(ActivitySet)asts.next();
48             acts=(Activities)as.get("Activities");
49             allActs.addAll(acts.toCollection());
50          }*/

51
52          ManageActivities mad=
53             new ManageActivities(pm,proc,allActs);
54          mad.showDialog();
55       } else {
56          System.err.println("Process is not selected");
57       }
58    }
59
60 }
61
Popular Tags