1 package org.enhydra.shark.corba; 2 3 import org.omg.TimeBase.UtcT; 4 import org.omg.WfBase.BaseException; 5 import org.omg.WfBase.NameValue; 6 import org.omg.WorkflowModel.*; 7 8 14 public class WfActivityCORBA extends _WfActivityImplBase { 15 16 org.enhydra.shark.api.client.wfmodel.WfActivity sharkAct; 17 18 private Collective __collective; 19 20 23 protected WfActivityCORBA(Collective toJoin, 24 org.enhydra.shark.api.client.wfmodel.WfActivity sharkAct) { 25 __collective = toJoin; 26 toJoin.__recruit(this); 27 this.sharkAct = sharkAct; 28 } 29 30 36 public int how_many_assignment() throws BaseException { 37 try { 38 return sharkAct.how_many_assignment(); 39 } catch (Exception ex) { 40 throw new BaseException(); 41 } 42 } 43 44 47 public WfAssignmentIterator get_iterator_assignment() throws BaseException { 48 try { 49 return new WfAssignmentIteratorCORBA(__collective, 50 sharkAct.get_iterator_assignment()); 51 } catch (Exception ex) { 52 throw new BaseException(); 53 } 54 } 55 56 61 public WfAssignment[] get_sequence_assignment(int max_number) throws BaseException { 62 try { 63 return SharkCORBAUtilities.makeCORBAAssignments(__collective, 64 sharkAct.get_sequence_assignment(max_number)); 65 } catch (Exception ex) { 66 throw new BaseException(); 67 } 68 } 69 70 75 public boolean is_member_of_assignment(WfAssignment member) throws BaseException { 76 try { 77 String actId = member.activity().key(); 78 return actId.equals(sharkAct.key()); 79 } catch (Exception ex) { 80 throw new BaseException(); 81 } 82 } 83 84 87 public WfProcess container() throws BaseException { 88 try { 89 return new WfProcessCORBA(__collective, sharkAct.container()); 90 } catch (Exception ex) { 91 throw new BaseException(); 92 } 93 } 94 95 100 public NameValue[] result() throws BaseException, ResultNotAvailable { 101 try { 102 return SharkCORBAUtilities.makeCORBANameValueArray(this._orb(), 103 sharkAct.result()); 104 } catch (org.enhydra.shark.api.client.wfmodel.ResultNotAvailable rna) { 105 throw new ResultNotAvailable(); 106 } catch (Exception ex) { 107 throw new BaseException(); 108 } 109 } 110 111 114 public void set_result(NameValue[] results) throws BaseException, 115 InvalidData { 116 try { 117 sharkAct.set_result(SharkCORBAUtilities.makeMap(results)); 118 } catch (org.enhydra.shark.api.client.wfmodel.InvalidData id) { 119 throw new InvalidData(); 120 } catch (Exception ex) { 121 throw new BaseException(); 122 } 123 } 124 125 128 public void complete() throws BaseException, CannotComplete { 129 try { 130 sharkAct.complete(); 131 } catch (org.enhydra.shark.api.client.wfmodel.CannotComplete cnc) { 132 throw new CannotComplete(); 133 } catch (Exception ex) { 134 throw new BaseException(); 135 } 136 } 137 138 public workflow_stateType workflow_state() throws BaseException { 139 try { 140 return workflow_stateType.from_int(sharkAct.workflow_state().value()); 141 } catch (Exception ex) { 142 throw new BaseException(); 143 } 144 } 145 146 public while_openType while_open() throws BaseException { 147 try { 148 return while_openType.from_int(sharkAct.while_open().value()); 149 } catch (Exception ex) { 150 throw new BaseException(); 151 } 152 } 153 154 public why_not_runningType why_not_running() throws BaseException { 155 try { 156 return why_not_runningType.from_int(sharkAct.why_not_running() 157 .value()); 158 } catch (Exception ex) { 159 throw new BaseException(); 160 } 161 } 162 163 public how_closedType how_closed() throws BaseException { 164 try { 165 return how_closedType.from_int(sharkAct.how_closed().value()); 166 } catch (Exception ex) { 167 throw new BaseException(); 168 } 169 } 170 171 public String [] valid_states() throws BaseException { 172 try { 173 return sharkAct.valid_states(); 174 } catch (Exception ex) { 175 throw new BaseException(); 176 } 177 } 178 179 public String state() throws BaseException { 180 try { 181 return sharkAct.state(); 182 } catch (Exception ex) { 183 throw new BaseException(); 184 } 185 } 186 187 public void change_state(String new_state) throws BaseException, 188 InvalidState, 189 TransitionNotAllowed { 190 try { 191 sharkAct.change_state(new_state); 192 } catch (org.enhydra.shark.api.client.wfmodel.InvalidState is) { 193 throw new InvalidState(); 194 } catch (org.enhydra.shark.api.client.wfmodel.TransitionNotAllowed tna) { 195 throw new TransitionNotAllowed(); 196 } catch (Exception ex) { 197 throw new BaseException(); 198 } 199 } 200 201 public String name() throws BaseException { 202 try { 203 return sharkAct.name(); 204 } catch (Exception ex) { 205 throw new BaseException(); 206 } 207 } 208 209 public void set_name(String new_value) throws BaseException { 210 try { 211 sharkAct.set_name(new_value); 212 } catch (Exception ex) { 213 throw new BaseException(); 214 } 215 } 216 217 public String key() throws BaseException { 218 try { 219 return sharkAct.key(); 220 } catch (Exception ex) { 221 throw new BaseException(); 222 } 223 } 224 225 public String description() throws BaseException { 226 try { 227 return sharkAct.description(); 228 } catch (Exception ex) { 229 throw new BaseException(); 230 } 231 } 232 233 public void set_description(String new_value) throws BaseException { 234 try { 235 sharkAct.set_description(new_value); 236 } catch (Exception ex) { 237 throw new BaseException(); 238 } 239 } 240 241 public NameValue[] process_context() throws BaseException { 242 try { 243 return SharkCORBAUtilities.makeCORBANameValueArray(this._orb(), 244 sharkAct.process_context()); 245 } catch (Exception ex) { 246 throw new BaseException(); 247 } 248 } 249 250 public void set_process_context(NameValue[] new_value) throws BaseException, 251 InvalidData, 252 UpdateNotAllowed { 253 try { 254 sharkAct.set_process_context(SharkCORBAUtilities.makeMap(new_value)); 255 } catch (org.enhydra.shark.api.client.wfmodel.InvalidData id) { 256 throw new InvalidData(); 257 } catch (org.enhydra.shark.api.client.wfmodel.UpdateNotAllowed una) { 258 throw new UpdateNotAllowed(); 259 } catch (Exception ex) { 260 throw new BaseException(); 261 } 262 } 263 264 public short priority() throws BaseException { 265 try { 266 return sharkAct.priority(); 267 } catch (Exception ex) { 268 throw new BaseException(); 269 } 270 } 271 272 public void set_priority(short new_value) throws BaseException { 273 try { 274 sharkAct.set_priority(new_value); 275 } catch (Exception ex) { 276 throw new BaseException(); 277 } 278 } 279 280 283 public void resume() throws BaseException, CannotResume, NotSuspended { 284 try { 285 sharkAct.resume(); 286 } catch (org.enhydra.shark.api.client.wfmodel.CannotResume cnr) { 287 throw new CannotResume(); 288 } catch (org.enhydra.shark.api.client.wfmodel.NotSuspended ns) { 289 throw new NotSuspended(); 290 } catch (Exception ex) { 291 throw new BaseException(); 292 } 293 } 294 295 298 public void suspend() throws BaseException, 299 CannotSuspend, 300 NotRunning, 301 AlreadySuspended { 302 try { 303 sharkAct.suspend(); 304 } catch (org.enhydra.shark.api.client.wfmodel.CannotSuspend cns) { 305 throw new CannotSuspend(); 306 } catch (org.enhydra.shark.api.client.wfmodel.NotRunning nr) { 307 throw new NotRunning(); 308 } catch (org.enhydra.shark.api.client.wfmodel.AlreadySuspended as) { 309 throw new AlreadySuspended(); 310 } catch (Exception ex) { 311 throw new BaseException(); 312 } 313 } 314 315 318 public void terminate() throws BaseException, CannotStop, NotRunning { 319 try { 320 sharkAct.terminate(); 321 } catch (org.enhydra.shark.api.client.wfmodel.CannotStop cns) { 322 throw new CannotStop(); 323 } catch (org.enhydra.shark.api.client.wfmodel.NotRunning nr) { 324 throw new NotRunning(); 325 } catch (Exception ex) { 326 throw new BaseException(); 327 } 328 } 329 330 333 public void abort() throws BaseException, CannotStop, NotRunning { 334 try { 335 sharkAct.abort(); 336 } catch (org.enhydra.shark.api.client.wfmodel.CannotStop cns) { 337 throw new CannotStop(); 338 } catch (org.enhydra.shark.api.client.wfmodel.NotRunning nr) { 339 throw new NotRunning(); 340 } catch (Exception ex) { 341 throw new BaseException(); 342 } 343 } 344 345 public int how_many_history() throws BaseException, HistoryNotAvailable { 346 try { 347 return sharkAct.how_many_history(); 348 } catch (org.enhydra.shark.api.client.wfmodel.HistoryNotAvailable hna) { 349 throw new HistoryNotAvailable(); 350 } catch (Exception ex) { 351 throw new BaseException(); 352 } 353 } 354 355 362 public WfEventAuditIterator get_iterator_history(String query, 363 NameValue[] names_in_query) throws BaseException, 364 HistoryNotAvailable { 365 try { 366 return new WfEventAuditIteratorCORBA(__collective, 367 sharkAct.get_iterator_history(query, 368 SharkCORBAUtilities.makeMap(names_in_query))); 369 } catch (org.enhydra.shark.api.client.wfmodel.HistoryNotAvailable hna) { 370 throw new HistoryNotAvailable(); 371 } catch (Exception ex) { 372 throw new BaseException(); 373 } 374 } 375 376 382 public WfEventAudit[] get_sequence_history(int max_number) throws BaseException, 383 HistoryNotAvailable { 384 try { 385 return SharkCORBAUtilities.makeCORBAEventAudits(__collective, 386 sharkAct.get_sequence_history(max_number)); 387 } catch (org.enhydra.shark.api.client.wfmodel.HistoryNotAvailable hna) { 388 throw new HistoryNotAvailable(); 389 } catch (Exception ex) { 390 throw new BaseException(); 391 } 392 } 393 394 399 public boolean is_member_of_history(WfExecutionObject member) throws BaseException { 400 try { 401 boolean ret = false; 402 WfEventAudit[] evs = SharkCORBAUtilities.makeCORBAEventAudits(__collective, 403 sharkAct.get_sequence_history(0)); 404 if (evs != null) { 405 for (int i = 0; i < evs.length; i++) { 406 WfEventAudit ea = evs[i]; 407 if (member instanceof WfActivity) { 408 WfActivity act = (WfActivity) member; 409 if (act.container().key().equals(ea.process_key()) 410 && act.key().equals(ea.activity_key())) { 411 ret = true; 412 break; 413 } 414 } else { 415 if (member.key().equals(ea.process_key())) { 416 ret = true; 417 break; 418 } 419 } 420 } 421 } 422 return ret; 423 } catch (Exception ex) { 424 throw new BaseException(); 425 } 426 } 427 428 public UtcT last_state_time() throws BaseException { 429 try { 430 org.enhydra.shark.api.client.timebase.UtcT t = sharkAct.last_state_time(); 431 return new UtcT(t.time, t.inacclo, t.inacchi, t.tdf); 432 } catch (Exception ex) { 433 throw new BaseException(); 434 } 435 } 436 437 440 public int how_many_performer() throws BaseException { 441 try { 442 return sharkAct.how_many_performer(); 443 } catch (Exception ex) { 444 throw new BaseException(); 445 } 446 } 447 448 451 public WfProcessIterator get_iterator_performer() throws BaseException { 452 try { 453 return new WfProcessIteratorCORBA(__collective, 454 sharkAct.get_iterator_performer()); 455 } catch (Exception ex) { 456 throw new BaseException(); 457 } 458 } 459 460 465 public WfProcess[] get_sequence_performer(int max_number) throws BaseException { 466 try { 467 return SharkCORBAUtilities.makeCORBAProcesses(__collective, 468 sharkAct.get_sequence_performer(max_number)); 469 } catch (Exception ex) { 470 throw new BaseException(); 471 } 472 } 473 474 479 public boolean is_member_of_performer(WfProcess member) throws BaseException { 480 try { 481 boolean ret = false; 482 WfProcess[] perfs = SharkCORBAUtilities.makeCORBAProcesses(__collective, 483 sharkAct.get_sequence_performer(0)); 484 if (perfs != null) { 485 for (int i = 0; i < perfs.length; i++) { 486 WfProcess perf = perfs[i]; 487 if (perf.key().equals(member.key())) { 488 ret = true; 489 break; 490 } 491 } 492 } 493 return ret; 494 } catch (Exception ex) { 495 throw new BaseException(); 496 } 497 } 498 499 public void receive_event(WfEventAudit event) throws BaseException, 500 InvalidPerformer {} 501 502 506 public boolean equals(java.lang.Object obj) { 507 if (!(obj instanceof WfActivity)) return false; 508 WfActivity act = (WfActivity) obj; 509 try { 510 return act.key().equals(key()); 511 } catch (Exception ex) { 512 return false; 513 } 514 } 515 516 public String toString() { 517 return sharkAct.toString(); 518 } 519 520 } | Popular Tags |