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