1 package org.enhydra.shark; 2 3 import org.enhydra.shark.api.RootException; 4 import org.enhydra.shark.api.SharkTransaction; 5 import org.enhydra.shark.api.client.wfbase.BaseException; 6 import org.enhydra.shark.api.client.wfservice.AdminMisc; 7 import org.enhydra.shark.api.common.SharkConstants; 8 import org.enhydra.shark.api.internal.working.*; 9 10 16 public class AdminMiscImpl implements AdminMisc { 17 18 private CallbackUtilities cus; 19 private String userId="Unknown"; 20 21 protected AdminMiscImpl () { 22 this.cus=SharkEngineManager.getInstance().getCallbackUtilities(); 23 } 24 25 public void connect (String userId) { 26 this.userId=userId; 27 } 28 29 public String [][] getPackageExtendedAttributeNameValuePairs (String pkgId) throws BaseException { 30 String [][] ret = null; 31 SharkTransaction t = null; 32 try { 33 t = SharkUtilities.createTransaction(); 34 ret = getPackageExtendedAttributeNameValuePairs(t,pkgId); 35 } catch (RootException e) { 37 SharkUtilities.emptyCaches(t); 39 if (e instanceof BaseException) 40 throw (BaseException)e; 41 else 42 throw new BaseException(e); 43 } finally { 44 SharkUtilities.releaseTransaction(t); 45 } 46 return ret; 47 } 48 49 public String [][] getPackageExtendedAttributeNameValuePairs (SharkTransaction t,String pkgId) throws BaseException { 50 try { 51 return SharkUtilities.getPackageExtendedAttributeNameValuePairs(t,pkgId); 52 } catch (Exception ex) { 53 throw new BaseException(ex); 54 } 55 } 56 57 public String [] getPackageExtendedAttributeNames (String pkgId) throws BaseException { 58 String [] ret = null; 59 SharkTransaction t = null; 60 try { 61 t = SharkUtilities.createTransaction(); 62 ret = getPackageExtendedAttributeNames(t,pkgId); 63 } catch (RootException e) { 65 SharkUtilities.emptyCaches(t); 67 if (e instanceof BaseException) 68 throw (BaseException)e; 69 else 70 throw new BaseException(e); 71 } finally { 72 SharkUtilities.releaseTransaction(t); 73 } 74 return ret; 75 } 76 77 public String [] getPackageExtendedAttributeNames (SharkTransaction t,String pkgId) throws BaseException { 78 try { 79 return SharkUtilities.getPackageExtendedAttributeNames(t,pkgId); 80 } catch (Exception ex) { 81 throw new BaseException(ex); 82 } 83 } 84 85 public String getPackageExtendedAttributeValue (String pkgId,String extAttrName) throws BaseException { 86 String ret = null; 87 SharkTransaction t = null; 88 try { 89 t = SharkUtilities.createTransaction(); 90 ret = getPackageExtendedAttributeValue(t,pkgId,extAttrName); 91 } catch (RootException e) { 93 SharkUtilities.emptyCaches(t); 95 if (e instanceof BaseException) 96 throw (BaseException)e; 97 else 98 throw new BaseException(e); 99 } finally { 100 SharkUtilities.releaseTransaction(t); 101 } 102 return ret; 103 } 104 105 public String getPackageExtendedAttributeValue (SharkTransaction t,String pkgId,String extAttrName) throws BaseException{ 106 try { 107 return SharkUtilities.getProcessExtendedAttributeValue(t,pkgId,extAttrName); 108 } catch (Exception ex) { 109 throw new BaseException(ex); 110 } 111 } 112 113 public String [][] getProcessDefinitionExtendedAttributeNameValuePairs (String mgrName) throws BaseException { 114 String [][] ret = null; 115 SharkTransaction t = null; 116 try { 117 t = SharkUtilities.createTransaction(); 118 ret = getProcessDefinitionExtendedAttributeNameValuePairs(t,mgrName); 119 } catch (RootException e) { 121 SharkUtilities.emptyCaches(t); 123 if (e instanceof BaseException) 124 throw (BaseException)e; 125 else 126 throw new BaseException(e); 127 } finally { 128 SharkUtilities.releaseTransaction(t); 129 } 130 return ret; 131 } 132 133 public String [][] getProcessDefinitionExtendedAttributeNameValuePairs (SharkTransaction t,String mgrName) throws BaseException { 134 try { 135 return SharkUtilities.getProcessDefinitionExtendedAttributeNameValuePairs(t,mgrName); 136 } catch (Exception ex) { 137 throw new BaseException(ex); 138 } 139 } 140 141 public String [] getProcessDefinitionExtendedAttributeNames (String mgrName) throws BaseException { 142 String [] ret = null; 143 SharkTransaction t = null; 144 try { 145 t = SharkUtilities.createTransaction(); 146 ret = getProcessDefinitionExtendedAttributeNames(t,mgrName); 147 } catch (RootException e) { 149 SharkUtilities.emptyCaches(t); 151 if (e instanceof BaseException) 152 throw (BaseException)e; 153 else 154 throw new BaseException(e); 155 } finally { 156 SharkUtilities.releaseTransaction(t); 157 } 158 return ret; 159 } 160 161 public String [] getProcessDefinitionExtendedAttributeNames (SharkTransaction t,String mgrName) throws BaseException { 162 try { 163 return SharkUtilities.getProcessDefinitionExtendedAttributeNames(t,mgrName); 164 } catch (Exception ex) { 165 throw new BaseException(ex); 166 } 167 } 168 169 public String getProcessDefinitionExtendedAttributeValue (String mgrName,String extAttrName) throws BaseException { 170 String ret = null; 171 SharkTransaction t = null; 172 try { 173 t = SharkUtilities.createTransaction(); 174 ret = getProcessDefinitionExtendedAttributeValue(t,mgrName,extAttrName); 175 } catch (RootException e) { 177 SharkUtilities.emptyCaches(t); 179 if (e instanceof BaseException) 180 throw (BaseException)e; 181 else 182 throw new BaseException(e); 183 } finally { 184 SharkUtilities.releaseTransaction(t); 185 } 186 return ret; 187 } 188 189 public String getProcessDefinitionExtendedAttributeValue (SharkTransaction t,String mgrName,String extAttrName) throws BaseException { 190 try { 191 return SharkUtilities.getProcessDefinitionExtendedAttributeValue(t,mgrName,extAttrName); 192 } catch (Exception ex) { 193 throw new BaseException(ex); 194 } 195 } 196 197 public String [][] getProcessExtendedAttributeNameValuePairs (String procId) throws BaseException { 198 String [][] ret = null; 199 SharkTransaction t = null; 200 try { 201 t = SharkUtilities.createTransaction(); 202 ret = getProcessExtendedAttributeNameValuePairs(t,procId); 203 } catch (RootException e) { 205 SharkUtilities.emptyCaches(t); 207 if (e instanceof BaseException) 208 throw (BaseException)e; 209 else 210 throw new BaseException(e); 211 } finally { 212 SharkUtilities.releaseTransaction(t); 213 } 214 return ret; 215 } 216 217 public String [][] getProcessExtendedAttributeNameValuePairs (SharkTransaction t,String procId) throws BaseException { 218 try { 219 return SharkUtilities.getProcessExtendedAttributeNameValuePairs(t,procId); 220 } catch (Exception ex) { 221 throw new BaseException(ex); 222 } 223 } 224 225 public String [] getProcessExtendedAttributeNames (String procId) throws BaseException { 226 String [] ret = null; 227 SharkTransaction t = null; 228 try { 229 t = SharkUtilities.createTransaction(); 230 ret = getProcessExtendedAttributeNames(t,procId); 231 } catch (RootException e) { 233 SharkUtilities.emptyCaches(t); 235 if (e instanceof BaseException) 236 throw (BaseException)e; 237 else 238 throw new BaseException(e); 239 } finally { 240 SharkUtilities.releaseTransaction(t); 241 } 242 return ret; 243 } 244 245 public String [] getProcessExtendedAttributeNames (SharkTransaction t,String procId) throws BaseException { 246 try { 247 return SharkUtilities.getProcessExtendedAttributeNames(t,procId); 248 } catch (Exception ex) { 249 throw new BaseException(ex); 250 } 251 } 252 253 public String getProcessExtendedAttributeValue (String procId,String extAttrName) throws BaseException { 254 String ret = null; 255 SharkTransaction t = null; 256 try { 257 t = SharkUtilities.createTransaction(); 258 ret = getProcessExtendedAttributeValue(t,procId,extAttrName); 259 } catch (RootException e) { 261 SharkUtilities.emptyCaches(t); 263 if (e instanceof BaseException) 264 throw (BaseException)e; 265 else 266 throw new BaseException(e); 267 } finally { 268 SharkUtilities.releaseTransaction(t); 269 } 270 return ret; 271 } 272 273 public String getProcessExtendedAttributeValue (SharkTransaction t,String procId,String extAttrName) throws BaseException{ 274 try { 275 return SharkUtilities.getProcessExtendedAttributeValue(t,procId,extAttrName); 276 } catch (Exception ex) { 277 throw new BaseException(ex); 278 } 279 } 280 281 public String getActivitiesExtendedAttributes (String procId,String actId) throws BaseException { 282 String ret = null; 283 SharkTransaction t = null; 284 try { 285 t = SharkUtilities.createTransaction(); 286 ret = getActivitiesExtendedAttributes(t,procId,actId); 287 } catch (RootException e) { 289 SharkUtilities.emptyCaches(t); 291 if (e instanceof BaseException) 292 throw (BaseException)e; 293 else 294 throw new BaseException(e); 295 } finally { 296 SharkUtilities.releaseTransaction(t); 297 } 298 return ret; 299 } 300 301 public String getActivitiesExtendedAttributes (SharkTransaction t,String procId,String actId) throws BaseException{ 302 try { 303 return SharkUtilities.getActivitiesExtendedAttributes(t,procId,actId); 304 } catch (Exception ex) { 305 throw new BaseException(ex); 306 } 307 } 308 309 public String [][] getActivitiesExtendedAttributeNameValuePairs (String procId,String actId) throws BaseException { 310 String [][] ret = null; 311 SharkTransaction t = null; 312 try { 313 t = SharkUtilities.createTransaction(); 314 ret = getActivitiesExtendedAttributeNameValuePairs(t,procId,actId); 315 } catch (RootException e) { 317 SharkUtilities.emptyCaches(t); 319 if (e instanceof BaseException) 320 throw (BaseException)e; 321 else 322 throw new BaseException(e); 323 } finally { 324 SharkUtilities.releaseTransaction(t); 325 } 326 return ret; 327 } 328 329 public String [][] getActivitiesExtendedAttributeNameValuePairs (SharkTransaction t,String procId,String actId) throws BaseException { 330 try { 331 return SharkUtilities.getActivitiesExtendedAttributeNameValuePairs(t,procId,actId); 332 } catch (Exception ex) { 333 throw new BaseException(ex); 334 } 335 } 336 337 public String [] getActivitiesExtendedAttributeNames (String procId,String actId) throws BaseException { 338 String [] ret = null; 339 SharkTransaction t = null; 340 try { 341 t = SharkUtilities.createTransaction(); 342 ret = getActivitiesExtendedAttributeNames(t,procId,actId); 343 } catch (RootException e) { 345 SharkUtilities.emptyCaches(t); 347 if (e instanceof BaseException) 348 throw (BaseException)e; 349 else 350 throw new BaseException(e); 351 } finally { 352 SharkUtilities.releaseTransaction(t); 353 } 354 return ret; 355 } 356 357 public String [] getActivitiesExtendedAttributeNames (SharkTransaction t,String procId,String actId) throws BaseException { 358 try { 359 return SharkUtilities.getActivitiesExtendedAttributeNames(t,procId,actId); 360 } catch (Exception ex) { 361 throw new BaseException(ex); 362 } 363 } 364 365 public String getActivitiesExtendedAttributeValue (String procId,String actId,String extAttrName) throws BaseException { 366 String ret = null; 367 SharkTransaction t = null; 368 try { 369 t = SharkUtilities.createTransaction(); 370 ret = getActivitiesExtendedAttributeValue(t,procId,actId,extAttrName); 371 } catch (RootException e) { 373 SharkUtilities.emptyCaches(t); 375 if (e instanceof BaseException) 376 throw (BaseException)e; 377 else 378 throw new BaseException(e); 379 } finally { 380 SharkUtilities.releaseTransaction(t); 381 } 382 return ret; 383 } 384 385 public String getActivitiesExtendedAttributeValue (SharkTransaction t,String procId,String actId,String extAttrName) throws BaseException{ 386 try { 387 return SharkUtilities.getActivitiesExtendedAttributeValue(t,procId,actId,extAttrName); 388 } catch (Exception ex) { 389 throw new BaseException(ex); 390 } 391 } 392 393 394 public String [][] getDefVariableExtendedAttributeNameValuePairs (String mgrName,String variableId) throws BaseException { 395 String [][] ret = null; 396 SharkTransaction t = null; 397 try { 398 t = SharkUtilities.createTransaction(); 399 ret = getDefVariableExtendedAttributeNameValuePairs(t,mgrName,variableId); 400 } catch (RootException e) { 402 SharkUtilities.emptyCaches(t); 404 if (e instanceof BaseException) 405 throw (BaseException)e; 406 else 407 throw new BaseException(e); 408 } finally { 409 SharkUtilities.releaseTransaction(t); 410 } 411 return ret; 412 } 413 414 public String [][] getDefVariableExtendedAttributeNameValuePairs (SharkTransaction t,String mgrName,String variableId) throws BaseException { 415 try { 416 return SharkUtilities.getDefVariableExtendedAttributeNameValuePairs(t,mgrName,variableId); 417 } catch (Exception ex) { 418 throw new BaseException(ex); 419 } 420 } 421 422 public String [] getDefVariableExtendedAttributeNames (String mgrName,String variableId) throws BaseException { 423 String [] ret = null; 424 SharkTransaction t = null; 425 try { 426 t = SharkUtilities.createTransaction(); 427 ret = getDefVariableExtendedAttributeNames(t,mgrName,variableId); 428 } catch (RootException e) { 430 SharkUtilities.emptyCaches(t); 432 if (e instanceof BaseException) 433 throw (BaseException)e; 434 else 435 throw new BaseException(e); 436 } finally { 437 SharkUtilities.releaseTransaction(t); 438 } 439 return ret; 440 } 441 442 public String [] getDefVariableExtendedAttributeNames (SharkTransaction t,String mgrName,String variableId) throws BaseException { 443 try { 444 return SharkUtilities.getDefVariableExtendedAttributeNames(t,mgrName,variableId); 445 } catch (Exception ex) { 446 throw new BaseException(ex); 447 } 448 } 449 450 public String getDefVariableExtendedAttributeValue (String mgrName,String variableId,String extAttrName) throws BaseException { 451 String ret = null; 452 SharkTransaction t = null; 453 try { 454 t = SharkUtilities.createTransaction(); 455 ret = getDefVariableExtendedAttributeValue(t,mgrName,variableId,extAttrName); 456 } catch (RootException e) { 458 SharkUtilities.emptyCaches(t); 460 if (e instanceof BaseException) 461 throw (BaseException)e; 462 else 463 throw new BaseException(e); 464 } finally { 465 SharkUtilities.releaseTransaction(t); 466 } 467 return ret; 468 } 469 470 public String getDefVariableExtendedAttributeValue (SharkTransaction t,String mgrName,String variableId,String extAttrName) throws BaseException{ 471 try { 472 return SharkUtilities.getDefVariableExtendedAttributeValue(t,mgrName,variableId,extAttrName); 473 } catch (Exception ex) { 474 throw new BaseException(ex); 475 } 476 } 477 478 public String [][] getVariableExtendedAttributeNameValuePairs (String procId,String variableId) throws BaseException { 479 String [][] ret = null; 480 SharkTransaction t = null; 481 try { 482 t = SharkUtilities.createTransaction(); 483 ret = getVariableExtendedAttributeNameValuePairs(t,procId,variableId); 484 } catch (RootException e) { 486 SharkUtilities.emptyCaches(t); 488 if (e instanceof BaseException) 489 throw (BaseException)e; 490 else 491 throw new BaseException(e); 492 } finally { 493 SharkUtilities.releaseTransaction(t); 494 } 495 return ret; 496 } 497 498 public String [][] getVariableExtendedAttributeNameValuePairs (SharkTransaction t,String procId,String variableId) throws BaseException { 499 try { 500 return SharkUtilities.getVariableExtendedAttributeNameValuePairs(t,procId,variableId); 501 } catch (Exception ex) { 502 throw new BaseException(ex); 503 } 504 } 505 506 public String [] getVariableExtendedAttributeNames (String procId,String variableId) throws BaseException { 507 String [] ret = null; 508 SharkTransaction t = null; 509 try { 510 t = SharkUtilities.createTransaction(); 511 ret = getVariableExtendedAttributeNames(t,procId,variableId); 512 } catch (RootException e) { 514 SharkUtilities.emptyCaches(t); 516 if (e instanceof BaseException) 517 throw (BaseException)e; 518 else 519 throw new BaseException(e); 520 } finally { 521 SharkUtilities.releaseTransaction(t); 522 } 523 return ret; 524 } 525 526 public String [] getVariableExtendedAttributeNames (SharkTransaction t,String procId,String variableId) throws BaseException { 527 try { 528 return SharkUtilities.getVariableExtendedAttributeNames(t,procId,variableId); 529 } catch (Exception ex) { 530 throw new BaseException(ex); 531 } 532 } 533 534 public String getVariableExtendedAttributeValue (String procId,String variableId,String extAttrName) throws BaseException { 535 String ret = null; 536 SharkTransaction t = null; 537 try { 538 t = SharkUtilities.createTransaction(); 539 ret = getVariableExtendedAttributeValue(t,procId,variableId,extAttrName); 540 } catch (RootException e) { 542 SharkUtilities.emptyCaches(t); 544 if (e instanceof BaseException) 545 throw (BaseException)e; 546 else 547 throw new BaseException(e); 548 } finally { 549 SharkUtilities.releaseTransaction(t); 550 } 551 return ret; 552 } 553 554 public String getVariableExtendedAttributeValue (SharkTransaction t,String procId,String variableId,String extAttrName) throws BaseException{ 555 try { 556 return SharkUtilities.getVariableExtendedAttributeValue(t,procId,variableId,extAttrName); 557 } catch (Exception ex) { 558 throw new BaseException(ex); 559 } 560 } 561 562 public String [][] getParticipantExtendedAttributeNameValuePairs (String pkgId,String pDefId,String participantId) throws BaseException { 563 String [][] ret = null; 564 SharkTransaction t = null; 565 try { 566 t = SharkUtilities.createTransaction(); 567 ret = getParticipantExtendedAttributeNameValuePairs(t,pkgId,pDefId,participantId); 568 } catch (RootException e) { 570 SharkUtilities.emptyCaches(t); 572 if (e instanceof BaseException) 573 throw (BaseException)e; 574 else 575 throw new BaseException(e); 576 } finally { 577 SharkUtilities.releaseTransaction(t); 578 } 579 return ret; 580 } 581 582 public String [][] getParticipantExtendedAttributeNameValuePairs (SharkTransaction t,String pkgId,String pDefId,String participantId) throws BaseException { 583 try { 584 return SharkUtilities.getParticipantExtendedAttributeNameValuePairs(t,pkgId,pDefId,participantId); 585 } catch (Exception ex) { 586 throw new BaseException(ex); 587 } 588 } 589 590 public String [] getParticipantExtendedAttributeNames (String pkgId,String pDefId,String participantId) throws BaseException { 591 String [] ret = null; 592 SharkTransaction t = null; 593 try { 594 t = SharkUtilities.createTransaction(); 595 ret = getParticipantExtendedAttributeNames(t,pkgId,pDefId,participantId); 596 } catch (RootException e) { 598 SharkUtilities.emptyCaches(t); 600 if (e instanceof BaseException) 601 throw (BaseException)e; 602 else 603 throw new BaseException(e); 604 } finally { 605 SharkUtilities.releaseTransaction(t); 606 } 607 return ret; 608 } 609 610 public String [] getParticipantExtendedAttributeNames (SharkTransaction t,String pkgId,String pDefId,String participantId) throws BaseException { 611 try { 612 return SharkUtilities.getParticipantExtendedAttributeNames(t,pkgId,pDefId,participantId); 613 } catch (Exception ex) { 614 throw new BaseException(ex); 615 } 616 } 617 618 public String getParticipantExtendedAttributeValue (String pkgId,String pDefId,String participantId,String extAttrName) throws BaseException { 619 String ret = null; 620 SharkTransaction t = null; 621 try { 622 t = SharkUtilities.createTransaction(); 623 ret = getParticipantExtendedAttributeValue(t,pkgId,pDefId,participantId,extAttrName); 624 } catch (RootException e) { 626 SharkUtilities.emptyCaches(t); 628 if (e instanceof BaseException) 629 throw (BaseException)e; 630 else 631 throw new BaseException(e); 632 } finally { 633 SharkUtilities.releaseTransaction(t); 634 } 635 return ret; 636 } 637 638 public String getParticipantExtendedAttributeValue (SharkTransaction t,String pkgId,String pDefId,String participantId,String extAttrName) throws BaseException{ 639 try { 640 return SharkUtilities.getParticipantExtendedAttributeValue(t,pkgId,pDefId,participantId,extAttrName); 641 } catch (Exception ex) { 642 throw new BaseException(ex); 643 } 644 } 645 646 public String [][] getApplicationExtendedAttributeNameValuePairs (String pkgId,String pDefId,String applicationId) throws BaseException { 647 String [][] ret = null; 648 SharkTransaction t = null; 649 try { 650 t = SharkUtilities.createTransaction(); 651 ret = getApplicationExtendedAttributeNameValuePairs(t,pkgId,pDefId,applicationId); 652 } catch (RootException e) { 654 SharkUtilities.emptyCaches(t); 656 if (e instanceof BaseException) 657 throw (BaseException)e; 658 else 659 throw new BaseException(e); 660 } finally { 661 SharkUtilities.releaseTransaction(t); 662 } 663 return ret; 664 } 665 666 public String [][] getApplicationExtendedAttributeNameValuePairs (SharkTransaction t,String pkgId,String pDefId,String applicationId) throws BaseException { 667 try { 668 return SharkUtilities.getApplicationExtendedAttributeNameValuePairs(t,pkgId,pDefId,applicationId); 669 } catch (Exception ex) { 670 throw new BaseException(ex); 671 } 672 } 673 674 public String [] getApplicationExtendedAttributeNames (String pkgId,String pDefId,String applicationId) throws BaseException { 675 String [] ret = null; 676 SharkTransaction t = null; 677 try { 678 t = SharkUtilities.createTransaction(); 679 ret = getApplicationExtendedAttributeNames(t,pkgId,pDefId,applicationId); 680 } catch (RootException e) { 682 SharkUtilities.emptyCaches(t); 684 if (e instanceof BaseException) 685 throw (BaseException)e; 686 else 687 throw new BaseException(e); 688 } finally { 689 SharkUtilities.releaseTransaction(t); 690 } 691 return ret; 692 } 693 694 public String [] getApplicationExtendedAttributeNames (SharkTransaction t,String pkgId,String pDefId,String applicationId) throws BaseException { 695 try { 696 return SharkUtilities.getApplicationExtendedAttributeNames(t,pkgId,pDefId,applicationId); 697 } catch (Exception ex) { 698 throw new BaseException(ex); 699 } 700 } 701 702 public String getApplicationExtendedAttributeValue (String pkgId,String pDefId,String applicationId,String extAttrName) throws BaseException { 703 String ret = null; 704 SharkTransaction t = null; 705 try { 706 t = SharkUtilities.createTransaction(); 707 ret = getApplicationExtendedAttributeValue(t,pkgId,pDefId,applicationId,extAttrName); 708 } catch (RootException e) { 710 SharkUtilities.emptyCaches(t); 712 if (e instanceof BaseException) 713 throw (BaseException)e; 714 else 715 throw new BaseException(e); 716 } finally { 717 SharkUtilities.releaseTransaction(t); 718 } 719 return ret; 720 } 721 722 public String getApplicationExtendedAttributeValue (SharkTransaction t,String pkgId,String pDefId,String applicationId,String extAttrName) throws BaseException{ 723 try { 724 return SharkUtilities.getApplicationExtendedAttributeValue(t,pkgId,pDefId,applicationId,extAttrName); 725 } catch (Exception ex) { 726 throw new BaseException(ex); 727 } 728 } 729 730 public String getBlockActivityId (String procId,String actId) throws BaseException { 731 String ret = null; 732 SharkTransaction t = null; 733 try { 734 t = SharkUtilities.createTransaction(); 735 ret = getBlockActivityId(t,procId,actId); 736 } catch (RootException e) { 738 SharkUtilities.emptyCaches(t); 740 if (e instanceof BaseException) 741 throw (BaseException)e; 742 else 743 throw new BaseException(e); 744 } finally { 745 SharkUtilities.releaseTransaction(t); 746 } 747 return ret; 748 } 749 750 public String getBlockActivityId (SharkTransaction t,String procId,String actId) throws BaseException{ 751 try { 752 return SharkUtilities.getActivity(t,procId,actId).block_activity_id(t); 753 } catch (Exception ex) { 754 throw new BaseException(ex); 755 } 756 } 757 758 public String getActivityDefinitionId (String procId,String actId) throws BaseException { 759 String ret = null; 760 SharkTransaction t = null; 761 try { 762 t = SharkUtilities.createTransaction(); 763 ret = getActivityDefinitionId(t,procId,actId); 764 } catch (RootException e) { 766 SharkUtilities.emptyCaches(t); 768 if (e instanceof BaseException) 769 throw (BaseException)e; 770 else 771 throw new BaseException(e); 772 } finally { 773 SharkUtilities.releaseTransaction(t); 774 } 775 return ret; 776 } 777 778 public String getActivityDefinitionId (SharkTransaction t,String procId,String actId) throws BaseException{ 779 try { 780 return SharkUtilities.getActivity(t,procId,actId).activity_definition_id(t); 781 } catch (Exception ex) { 782 throw new BaseException(ex); 783 } 784 } 785 786 public String getProcessDefinitionId (String procId) throws BaseException{ 787 String ret = null; 788 SharkTransaction t = null; 789 try { 790 t = SharkUtilities.createTransaction(); 791 ret = getProcessDefinitionId(t,procId); 792 } catch (RootException e) { 794 SharkUtilities.emptyCaches(t); 796 if (e instanceof BaseException) 797 throw (BaseException)e; 798 else 799 throw new BaseException(e); 800 } finally { 801 SharkUtilities.releaseTransaction(t); 802 } 803 return ret; 804 } 805 806 public String getProcessDefinitionId (SharkTransaction t,String procId) throws BaseException{ 807 try { 808 return SharkUtilities.getProcess(t,procId).process_definition_id(t); 809 } catch (Exception ex) { 810 throw new BaseException(ex); 811 } 812 } 813 814 public String getDefVariableName (String mgrName,String variableId) throws BaseException { 815 String ret = null; 816 SharkTransaction t = null; 817 try { 818 t = SharkUtilities.createTransaction(); 819 ret = getDefVariableName(t,mgrName,variableId); 820 } catch (RootException e) { 822 SharkUtilities.emptyCaches(t); 824 if (e instanceof BaseException) 825 throw (BaseException)e; 826 else 827 throw new BaseException(e); 828 } finally { 829 SharkUtilities.releaseTransaction(t); 830 } 831 return ret; 832 } 833 834 public String getDefVariableName (SharkTransaction t,String mgrName,String variableId) throws BaseException { 835 try { 836 return SharkUtilities.getDefVariableName(t,mgrName,variableId); 837 } catch (Exception ex) { 838 throw new BaseException(ex); 839 } 840 } 841 842 public String getDefVariableDescription (String mgrName,String variableId) throws BaseException{ 843 String ret = null; 844 SharkTransaction t = null; 845 try { 846 t = SharkUtilities.createTransaction(); 847 ret = getDefVariableDescription(t,mgrName,variableId); 848 } catch (RootException e) { 850 SharkUtilities.emptyCaches(t); 852 if (e instanceof BaseException) 853 throw (BaseException)e; 854 else 855 throw new BaseException(e); 856 } finally { 857 SharkUtilities.releaseTransaction(t); 858 } 859 return ret; 860 } 861 862 public String getDefVariableDescription (SharkTransaction t,String mgrName,String variableId) throws BaseException{ 863 try { 864 return SharkUtilities.getDefVariableDescription(t,mgrName,variableId); 865 } catch (Exception ex) { 866 throw new BaseException(ex); 867 } 868 } 869 870 public String getDefVariableJavaClassName (String mgrName,String variableId) throws BaseException { 871 String ret = null; 872 SharkTransaction t = null; 873 try { 874 t = SharkUtilities.createTransaction(); 875 ret = getDefVariableJavaClassName(t,mgrName,variableId); 876 } catch (RootException e) { 878 SharkUtilities.emptyCaches(t); 880 if (e instanceof BaseException) 881 throw (BaseException)e; 882 else 883 throw new BaseException(e); 884 } finally { 885 SharkUtilities.releaseTransaction(t); 886 } 887 return ret; 888 } 889 890 public String getDefVariableJavaClassName (SharkTransaction t,String mgrName,String variableId) throws BaseException { 891 try { 892 return SharkUtilities.getDefVariableJavaClassName(t,mgrName,variableId); 893 } catch (Exception ex) { 894 throw new BaseException(ex); 895 } 896 } 897 898 public String getVariableName (String procId,String variableId) throws BaseException { 899 String ret = null; 900 SharkTransaction t = null; 901 try { 902 t = SharkUtilities.createTransaction(); 903 ret = getVariableName(t,procId,variableId); 904 } catch (RootException e) { 906 SharkUtilities.emptyCaches(t); 908 if (e instanceof BaseException) 909 throw (BaseException)e; 910 else 911 throw new BaseException(e); 912 } finally { 913 SharkUtilities.releaseTransaction(t); 914 } 915 return ret; 916 } 917 918 public String getVariableName (SharkTransaction t,String procId,String variableId) throws BaseException { 919 try { 920 return SharkUtilities.getVariableName(t,procId,variableId); 921 } catch (Exception ex) { 922 throw new BaseException(ex); 923 } 924 } 925 926 public String getVariableDescription (String procId,String variableId) throws BaseException{ 927 String ret = null; 928 SharkTransaction t = null; 929 try { 930 t = SharkUtilities.createTransaction(); 931 ret = getVariableDescription(t,procId,variableId); 932 } catch (RootException e) { 934 SharkUtilities.emptyCaches(t); 936 if (e instanceof BaseException) 937 throw (BaseException)e; 938 else 939 throw new BaseException(e); 940 } finally { 941 SharkUtilities.releaseTransaction(t); 942 } 943 return ret; 944 } 945 946 public String getVariableDescription (SharkTransaction t,String procId,String variableId) throws BaseException{ 947 try { 948 return SharkUtilities.getVariableDescription(t,procId,variableId); 949 } catch (Exception ex) { 950 throw new BaseException(ex); 951 } 952 } 953 954 public String getVariableJavaClassName (String procId,String variableId) throws BaseException { 955 String ret = null; 956 SharkTransaction t = null; 957 try { 958 t = SharkUtilities.createTransaction(); 959 ret = getVariableJavaClassName(t,procId,variableId); 960 } catch (RootException e) { 962 SharkUtilities.emptyCaches(t); 964 if (e instanceof BaseException) 965 throw (BaseException)e; 966 else 967 throw new BaseException(e); 968 } finally { 969 SharkUtilities.releaseTransaction(t); 970 } 971 return ret; 972 } 973 974 public String getVariableJavaClassName (SharkTransaction t,String procId,String variableId) throws BaseException { 975 try { 976 return SharkUtilities.getVariableJavaClassName(t,procId,variableId); 977 } catch (Exception ex) { 978 throw new BaseException(ex); 979 } 980 } 981 982 public String getParticipantName (String pkgId,String pDefId,String participantId) throws BaseException { 983 String ret = null; 984 SharkTransaction t = null; 985 try { 986 t = SharkUtilities.createTransaction(); 987 ret = getParticipantName(t,pkgId,pDefId,participantId); 988 } catch (RootException e) { 990 SharkUtilities.emptyCaches(t); 992 if (e instanceof BaseException) 993 throw (BaseException)e; 994 else 995 throw new BaseException(e); 996 } finally { 997 SharkUtilities.releaseTransaction(t); 998 } 999 return ret; 1000 } 1001 1002 public String getParticipantName (SharkTransaction t,String pkgId,String pDefId,String participantId) throws BaseException { 1003 try { 1004 return SharkUtilities.getParticipantName(t,pkgId,pDefId,participantId); 1005 } catch (Exception ex) { 1006 throw new BaseException(ex); 1007 } 1008 } 1009 1010 public String getApplicationName (String pkgId,String pDefId,String participantId) throws BaseException { 1011 String ret = null; 1012 SharkTransaction t = null; 1013 try { 1014 t = SharkUtilities.createTransaction(); 1015 ret = getApplicationName(t,pkgId,pDefId,participantId); 1016 } catch (RootException e) { 1018 SharkUtilities.emptyCaches(t); 1020 if (e instanceof BaseException) 1021 throw (BaseException)e; 1022 else 1023 throw new BaseException(e); 1024 } finally { 1025 SharkUtilities.releaseTransaction(t); 1026 } 1027 return ret; 1028 } 1029 1030 public String getApplicationName (SharkTransaction t,String pkgId,String pDefId,String participantId) throws BaseException { 1031 try { 1032 return SharkUtilities.getApplicationName(t,pkgId,pDefId,participantId); 1033 } catch (Exception ex) { 1034 throw new BaseException(ex); 1035 } 1036 } 1037 1038 public String getProcessMgrPkgId (String name) throws BaseException{ 1039 String ret = null; 1040 SharkTransaction t = null; 1041 try { 1042 t = SharkUtilities.createTransaction(); 1043 ret = getProcessMgrPkgId(t,name); 1044 } catch (RootException e) { 1046 SharkUtilities.emptyCaches(t); 1048 if (e instanceof BaseException) 1049 throw (BaseException)e; 1050 else 1051 throw new BaseException(e); 1052 } finally { 1053 SharkUtilities.releaseTransaction(t); 1054 } 1055 return ret; 1056 } 1057 1058 public String getProcessMgrPkgId (SharkTransaction t,String name) throws BaseException{ 1059 try { 1060 return SharkUtilities.getProcessMgr(t,name).package_id(t); 1061 } catch (Exception ex) { 1062 throw new BaseException(ex); 1063 } 1064 } 1065 1066 public String getProcessMgrProcDefId (String name) throws BaseException{ 1067 String ret = null; 1068 SharkTransaction t = null; 1069 try { 1070 t = SharkUtilities.createTransaction(); 1071 ret = getProcessMgrProcDefId(t,name); 1072 } catch (RootException e) { 1074 SharkUtilities.emptyCaches(t); 1076 if (e instanceof BaseException) 1077 throw (BaseException)e; 1078 else 1079 throw new BaseException(e); 1080 } finally { 1081 SharkUtilities.releaseTransaction(t); 1082 } 1083 return ret; 1084 } 1085 1086 public String getProcessMgrProcDefId (SharkTransaction t,String name) throws BaseException{ 1087 try { 1088 return SharkUtilities.getProcessMgr(t,name).process_definition_id(t); 1089 } catch (Exception ex) { 1090 throw new BaseException(ex); 1091 } 1092 } 1093 1094 public String getProcessMgrProcDefName (String name) throws BaseException{ 1095 String ret = null; 1096 SharkTransaction t = null; 1097 try { 1098 t = SharkUtilities.createTransaction(); 1099 ret = getProcessMgrProcDefName(t,name); 1100 } catch (RootException e) { 1102 SharkUtilities.emptyCaches(t); 1104 if (e instanceof BaseException) 1105 throw (BaseException)e; 1106 else 1107 throw new BaseException(e); 1108 } finally { 1109 SharkUtilities.releaseTransaction(t); 1110 } 1111 return ret; 1112 } 1113 1114 public String getProcessMgrProcDefName (SharkTransaction t,String name) throws BaseException{ 1115 try { 1116 return SharkUtilities.getProcessMgr(t,name).process_definition_name(t); 1117 } catch (Exception ex) { 1118 throw new BaseException(ex); 1119 } 1120 } 1121 1122 public String getProcessRequesterUsername (String procId) throws BaseException { 1123 String ret = null; 1124 SharkTransaction t = null; 1125 try { 1126 t = SharkUtilities.createTransaction(); 1127 ret = getProcessRequesterUsername(t,procId); 1128 } catch (RootException e) { 1130 SharkUtilities.emptyCaches(t); 1132 if (e instanceof BaseException) 1133 throw (BaseException)e; 1134 else 1135 throw new BaseException(e); 1136 } finally { 1137 SharkUtilities.releaseTransaction(t); 1138 } 1139 return ret; 1140 } 1141 1142 public String getProcessRequesterUsername (SharkTransaction t,String procId) throws BaseException { 1143 try { 1144 return SharkUtilities.getProcess(t,procId).requester(t).getResourceRequesterUsername(t); 1145 } catch (Exception ex) { 1146 throw new BaseException(ex); 1147 } 1148 } 1149 1150 public String getActivityResourceUsername (String procId,String actId) throws BaseException { 1151 String ret = null; 1152 SharkTransaction t = null; 1153 try { 1154 t = SharkUtilities.createTransaction(); 1155 ret = getActivityResourceUsername(t,procId,actId); 1156 } catch (RootException e) { 1158 SharkUtilities.emptyCaches(t); 1160 if (e instanceof BaseException) 1161 throw (BaseException)e; 1162 else 1163 throw new BaseException(e); 1164 } finally { 1165 SharkUtilities.releaseTransaction(t); 1166 } 1167 return ret; 1168 } 1169 1170 public String getActivityResourceUsername (SharkTransaction t,String procId,String actId) throws BaseException { 1171 try { 1172 return SharkUtilities.getActivity(t,procId,actId).getResourceUsername(t); 1173 } catch (Exception ex) { 1174 throw new BaseException(ex); 1175 } 1176 } 1177 1178 public String getAssignmentActivityId (String procId,String assId) throws BaseException { 1179 String ret = null; 1180 SharkTransaction t = null; 1181 try { 1182 t = SharkUtilities.createTransaction(); 1183 ret = getAssignmentActivityId(t,procId,assId); 1184 } catch (RootException e) { 1186 SharkUtilities.emptyCaches(t); 1188 if (e instanceof BaseException) 1189 throw (BaseException)e; 1190 else 1191 throw new BaseException(e); 1192 } finally { 1193 SharkUtilities.releaseTransaction(t); 1194 } 1195 return ret; 1196 } 1197 1198 public String getAssignmentActivityId (SharkTransaction t,String procId,String assId) throws BaseException { 1199 try { 1200 return SharkUtilities.getAssignmentActivityId(assId); 1201 } catch (Exception ex) { 1202 throw new BaseException(ex); 1203 } 1204 } 1205 1206 public String getAssignmentResourceUsername (String procId,String assId) throws BaseException { 1207 String ret = null; 1208 SharkTransaction t = null; 1209 try { 1210 t = SharkUtilities.createTransaction(); 1211 ret = getAssignmentResourceUsername(t,procId,assId); 1212 } catch (RootException e) { 1214 SharkUtilities.emptyCaches(t); 1216 if (e instanceof BaseException) 1217 throw (BaseException)e; 1218 else 1219 throw new BaseException(e); 1220 } finally { 1221 SharkUtilities.releaseTransaction(t); 1222 } 1223 return ret; 1224 } 1225 1226 public String getAssignmentResourceUsername (SharkTransaction t,String procId,String assId) throws BaseException { 1227 try { 1228 return SharkUtilities.getAssignmentUsername(assId); 1229 } catch (Exception ex) { 1230 throw new BaseException(ex); 1231 } 1232 } 1233 1234 public long getProcessCreatedTime (String procId) throws BaseException { 1235 long ret = -1; 1236 SharkTransaction t = null; 1237 try { 1238 t = SharkUtilities.createTransaction(); 1239 ret = getProcessCreatedTime(t,procId); 1240 } catch (RootException e) { 1242 SharkUtilities.emptyCaches(t); 1244 if (e instanceof BaseException) 1245 throw (BaseException)e; 1246 else 1247 throw new BaseException(e); 1248 } finally { 1249 SharkUtilities.releaseTransaction(t); 1250 } 1251 return ret; 1252 } 1253 1254 public long getProcessCreatedTime (SharkTransaction t,String procId) throws BaseException { 1255 try { 1256 WfProcessInternal proc=SharkUtilities.getProcess(t,procId); 1257 return proc.getCreationTime(t); 1258 } catch (Exception ex) { 1259 throw new BaseException(ex); 1260 } 1261 } 1262 1263 public long getProcessStartedTime (String procId) throws BaseException { 1264 long ret = -1; 1265 SharkTransaction t = null; 1266 try { 1267 t = SharkUtilities.createTransaction(); 1268 ret = getProcessStartedTime(t,procId); 1269 } catch (RootException e) { 1271 SharkUtilities.emptyCaches(t); 1273 if (e instanceof BaseException) 1274 throw (BaseException)e; 1275 else 1276 throw new BaseException(e); 1277 } finally { 1278 SharkUtilities.releaseTransaction(t); 1279 } 1280 return ret; 1281 } 1282 1283 public long getProcessStartedTime (SharkTransaction t,String procId) throws BaseException { 1284 try { 1285 WfProcessInternal proc=SharkUtilities.getProcess(t,procId); 1286 return proc.getStartTime(t); 1287 } catch (Exception ex) { 1288 throw new BaseException(ex); 1289 } 1290 } 1291 1292 public long getProcessFinishTime (String procId) throws BaseException { 1293 long ret = -1; 1294 SharkTransaction t = null; 1295 try { 1296 t = SharkUtilities.createTransaction(); 1297 ret = getProcessFinishTime(t,procId); 1298 } catch (RootException e) { 1300 SharkUtilities.emptyCaches(t); 1302 if (e instanceof BaseException) 1303 throw (BaseException)e; 1304 else 1305 throw new BaseException(e); 1306 } finally { 1307 SharkUtilities.releaseTransaction(t); 1308 } 1309 return ret; 1310 } 1311 1312 public long getProcessFinishTime (SharkTransaction t,String procId) throws BaseException { 1313 try { 1314 WfProcessInternal proc=SharkUtilities.getProcess(t,procId); 1315 if (proc.state(t).startsWith(SharkConstants.STATEPREFIX_CLOSED)) { 1316 return proc.last_state_time(t).time; 1317 } else { 1318 return Long.MAX_VALUE/2; 1319 } 1320 } catch (Exception ex) { 1321 throw new BaseException(ex); 1322 } 1323 } 1324 1325 public long getActivityCreatedTime (String procId,String actId) throws BaseException { 1326 long ret = -1; 1327 SharkTransaction t = null; 1328 try { 1329 t = SharkUtilities.createTransaction(); 1330 ret = getActivityCreatedTime(t,procId,actId); 1331 } catch (RootException e) { 1333 SharkUtilities.emptyCaches(t); 1335 if (e instanceof BaseException) 1336 throw (BaseException)e; 1337 else 1338 throw new BaseException(e); 1339 } finally { 1340 SharkUtilities.releaseTransaction(t); 1341 } 1342 return ret; 1343 } 1344 1345 public long getActivityCreatedTime (SharkTransaction t,String procId,String actId) throws BaseException { 1346 try { 1347 WfActivityInternal act=SharkUtilities.getActivity(t,procId,actId); 1348 return act.getCreationTime(t); 1349 } catch (Exception ex) { 1350 throw new BaseException(ex); 1351 } 1352 } 1353 1354 public long getActivityStartedTime (String procId,String actId) throws BaseException { 1355 long ret = -1; 1356 SharkTransaction t = null; 1357 try { 1358 t = SharkUtilities.createTransaction(); 1359 ret = getActivityStartedTime(t,procId,actId); 1360 } catch (RootException e) { 1362 SharkUtilities.emptyCaches(t); 1364 if (e instanceof BaseException) 1365 throw (BaseException)e; 1366 else 1367 throw new BaseException(e); 1368 } finally { 1369 SharkUtilities.releaseTransaction(t); 1370 } 1371 return ret; 1372 } 1373 1374 public long getActivityStartedTime (SharkTransaction t,String procId,String actId) throws BaseException { 1375 try { 1376 WfActivityInternal act=SharkUtilities.getActivity(t,procId,actId); 1377 return act.getStartTime(t); 1378 } catch (Exception ex) { 1379 throw new BaseException(ex); 1380 } 1381 } 1382 1383 public long getActivityFinishTime (String procId,String actId) throws BaseException { 1384 long ret = -1; 1385 SharkTransaction t = null; 1386 try { 1387 t = SharkUtilities.createTransaction(); 1388 ret = getActivityFinishTime(t,procId,actId); 1389 } catch (RootException e) { 1391 SharkUtilities.emptyCaches(t); 1393 if (e instanceof BaseException) 1394 throw (BaseException)e; 1395 else 1396 throw new BaseException(e); 1397 } finally { 1398 SharkUtilities.releaseTransaction(t); 1399 } 1400 return ret; 1401 } 1402 1403 public long getActivityFinishTime (SharkTransaction t,String procId,String actId) throws BaseException { 1404 try { 1405 WfActivityInternal act=SharkUtilities.getActivity(t,procId,actId); 1406 if (act.state(t).startsWith(SharkConstants.STATEPREFIX_CLOSED)) { 1407 return act.last_state_time(t).time; 1408 } else { 1409 return Long.MAX_VALUE/2; 1410 } 1411 } catch (Exception ex) { 1412 throw new BaseException(ex); 1413 } 1414 } 1415 1416} 1417 | Popular Tags |