1 package org.enhydra.shark.corba; 2 3 import org.omg.WfBase.*; 4 import org.omg.WorkflowModel.*; 5 6 12 public class WfResourceCORBA extends _WfResourceImplBase { 13 15 org.enhydra.shark.api.client.wfmodel.WfResource sharkRes; 16 private Collective __collective; 17 18 23 protected WfResourceCORBA(Collective toJoin, 24 org.enhydra.shark.api.client.wfmodel.WfResource sharkRes) { 25 __collective = toJoin; 26 toJoin.__recruit(this); 27 this.sharkRes = sharkRes; 28 } 29 30 33 public int how_many_work_item() throws BaseException { 34 try { 35 return sharkRes.how_many_work_item(); 36 } catch (Exception ex) { 37 throw new BaseException(); 38 } 39 } 40 41 44 public WfAssignmentIterator get_iterator_work_item() throws BaseException { 45 try { 46 return new WfAssignmentIteratorCORBA(__collective, 47 sharkRes.get_iterator_work_item()); 48 } catch (Exception ex) { 49 throw new BaseException(); 50 } 51 } 52 53 58 public WfAssignment[] get_sequence_work_item(int max_number) throws BaseException { 59 try { 60 return SharkCORBAUtilities.makeCORBAAssignments(__collective, 61 sharkRes.get_sequence_work_item(max_number)); 62 } catch (Exception ex) { 63 throw new BaseException(); 64 } 65 } 66 67 73 public boolean is_member_of_work_items(WfAssignment member) throws BaseException { 74 try { 75 WfAssignment[] ass = get_sequence_work_item(0); 76 boolean ret = false; 77 if (ass != null) { 78 for (int i = 0; i < ass.length; i++) { 79 WfAssignment as = ass[i]; 80 if (as.equals(member)) { 81 ret = true; 82 break; 83 } 84 } 85 } 86 return ret; 87 } catch (Exception ex) { 88 throw new BaseException(); 89 } 90 } 91 92 95 public String resource_key() throws BaseException { 96 try { 97 return sharkRes.resource_key(); 98 } catch (Exception ex) { 99 throw new BaseException(); 100 } 101 } 102 103 106 public String resource_name() throws BaseException { 107 try { 108 return sharkRes.resource_name(); 109 } catch (Exception ex) { 110 throw new BaseException(); 111 } 112 } 113 114 117 public void release(WfAssignment from_assigment, String release_info) throws BaseException, 118 NotAssigned { 119 try { 120 sharkRes.release(null, release_info); 121 } catch (org.enhydra.shark.api.client.wfmodel.NotAssigned na) { 122 throw new NotAssigned(); 123 } catch (Exception ex) { 124 throw new BaseException(); 125 } 126 } 127 128 132 public boolean equals(Object obj) { 133 if (!(obj instanceof WfResource)) return false; 134 WfResource res = (WfResource) obj; 135 try { 136 return res.resource_key().equals(resource_key()); 137 } catch (Exception ex) { 138 return false; 139 } 140 } 141 142 public String toString() { 143 return sharkRes.toString(); 144 } 145 146 } | Popular Tags |