KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > swingclient > workflowadmin > instantiation > actions > ReevaluateAssignments


1 package org.enhydra.shark.swingclient.workflowadmin.instantiation.actions;
2
3 import java.awt.event.ActionEvent JavaDoc;
4 import org.enhydra.jawe.xml.elements.Package;
5 import org.enhydra.shark.api.client.wfmodel.WfProcessMgr;
6 import org.enhydra.shark.api.client.wfservice.AdminMisc;
7 import org.enhydra.shark.api.client.wfservice.ExecutionAdministration;
8 import org.enhydra.shark.swingclient.ActionBase;
9 import org.enhydra.shark.swingclient.workflowadmin.SharkAdmin;
10 import org.enhydra.shark.swingclient.workflowadmin.instantiation.ProcessInstantiationManagement;
11
12 /**
13  * Reevaluates assignments (all, for some package, for particular
14  * process definition).
15  *
16  * @author Sasa Bojanic
17  */

18 public class ReevaluateAssignments extends ActionBase {
19
20    public ReevaluateAssignments (ProcessInstantiationManagement pim) {
21       super(pim);
22    }
23
24    public void actionPerformed(ActionEvent JavaDoc e) {
25       ProcessInstantiationManagement pim=(ProcessInstantiationManagement)actionPanel;
26       ExecutionAdministration ea=SharkAdmin.getExecAmin();
27       Object JavaDoc userObject=pim.getSelectedUserObject();
28       try {
29          if (userObject instanceof Package JavaDoc) {
30             String JavaDoc pkgId=((Package JavaDoc)userObject).get("Id").toString();
31             ea.reevaluateAssignments(pkgId);
32          } else if (userObject instanceof WfProcessMgr) {
33             AdminMisc am=SharkAdmin.getAdminMiscUtilities();
34             String JavaDoc pkgId=am.getProcessMgrPkgId(((WfProcessMgr)userObject).name());
35             String JavaDoc pDefId=am.getProcessMgrProcDefId(((WfProcessMgr)userObject).name());
36             ea.reevaluateAssignments(pkgId,pDefId);
37          } else {
38             ea.reevaluateAssignments();
39          }
40       } catch (Exception JavaDoc ex) {
41          ex.printStackTrace();
42       }
43
44    }
45 }
46
Popular Tags