1 package org.enhydra.shark.swingclient.workflowadmin.instantiation.actions; 2 3 import java.awt.event.*; 4 5 6 import org.enhydra.shark.api.client.wfmodel.*; 7 8 import org.enhydra.shark.api.client.wfservice.*; 9 import org.enhydra.shark.swingclient.*; 10 import org.enhydra.shark.swingclient.workflowadmin.*; 11 import org.enhydra.shark.swingclient.workflowadmin.instantiation.*; 12 import org.enhydra.jawe.xml.elements.Package; 13 14 21 public class EnableDefinition extends ActionBase { 22 23 public EnableDefinition (ProcessInstantiationManagement pim) { 24 super(pim); 25 } 26 27 public void actionPerformed(ActionEvent e) { 28 ProcessInstantiationManagement pim=(ProcessInstantiationManagement)actionPanel; 29 30 Object userObject=pim.getSelectedUserObject(); 31 if (userObject instanceof Package ) { 32 Package pkg=(Package )userObject; 33 try { 34 WfProcessMgrIterator wpmgi=SharkClient.getCommonExpressionBuilder().getEnabledOrDisabledManagersForPackage(pkg.get("Id").toString(),false); 35 WfProcessMgr[] mgrs=wpmgi.get_next_n_sequence(0); 36 if (mgrs!=null) { 37 for (int i=0; i<mgrs.length; i++) { 38 try { 39 mgrs[i].set_process_mgr_state(process_mgr_stateType.enabled); 40 } catch (TransitionNotAllowed tna){ 41 } catch (Exception ex){} 42 } 43 } 44 } catch (Exception ex) {} 45 } else if (userObject instanceof WfProcessMgr) { 46 try { 47 ((WfProcessMgr)userObject).set_process_mgr_state(process_mgr_stateType.enabled); 48 pim.getTreeSelectionListener().valueChanged(null); 49 } catch (TransitionNotAllowed tna){ 50 } catch (Exception ex){} 51 } 52 53 } 54 } 55 | Popular Tags |