001: /*
002: * This file is part of the WfMOpen project.
003: * Copyright (C) 2001-2006 Danet GmbH (www.danet.de), BU BTS.
004: * All rights reserved.
005: *
006: * This program is free software; you can redistribute it and/or modify
007: * it under the terms of the GNU General Public License as published by
008: * the Free Software Foundation; either version 2 of the License, or
009: * (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: *
020: * $Id: ActivityRemoteWrapper.java,v 1.1 2007/05/03 21:58:24 mlipp Exp $
021: *
022: * $Log: ActivityRemoteWrapper.java,v $
023: * Revision 1.1 2007/05/03 21:58:24 mlipp
024: * Internal refactoring for making better use of local EJBs.
025: *
026: */
027: package domain;
028:
029: import java.io.Serializable;
030: import java.rmi.RemoteException;
031: import java.util.Collection;
032: import java.util.Date;
033: import java.util.List;
034: import java.util.Map;
035:
036: import de.danet.an.workflow.api.Activity;
037: import de.danet.an.workflow.api.ActivityUniqueKey;
038: import de.danet.an.workflow.api.AlreadyAssignedException;
039: import de.danet.an.workflow.apix.ExtActivity;
040: import de.danet.an.workflow.internalapi.ExtApplication;
041: import de.danet.an.workflow.internalapi.ThreadInfo;
042: import de.danet.an.workflow.omgcore.AlreadyRunningException;
043: import de.danet.an.workflow.omgcore.AlreadySuspendedException;
044: import de.danet.an.workflow.omgcore.CannotCompleteException;
045: import de.danet.an.workflow.omgcore.CannotResumeException;
046: import de.danet.an.workflow.omgcore.CannotStopException;
047: import de.danet.an.workflow.omgcore.CannotSuspendException;
048: import de.danet.an.workflow.omgcore.InvalidDataException;
049: import de.danet.an.workflow.omgcore.InvalidPerformerException;
050: import de.danet.an.workflow.omgcore.InvalidPriorityException;
051: import de.danet.an.workflow.omgcore.InvalidResourceException;
052: import de.danet.an.workflow.omgcore.InvalidStateException;
053: import de.danet.an.workflow.omgcore.NotAssignedException;
054: import de.danet.an.workflow.omgcore.NotRunningException;
055: import de.danet.an.workflow.omgcore.NotSuspendedException;
056: import de.danet.an.workflow.omgcore.ProcessData;
057: import de.danet.an.workflow.omgcore.ResultNotAvailableException;
058: import de.danet.an.workflow.omgcore.TransitionNotAllowedException;
059: import de.danet.an.workflow.omgcore.UpdateNotAllowedException;
060: import de.danet.an.workflow.omgcore.WfAssignment;
061: import de.danet.an.workflow.omgcore.WfAuditEvent;
062: import de.danet.an.workflow.omgcore.WfProcess;
063: import de.danet.an.workflow.omgcore.WfResource;
064: import de.danet.an.workflow.omgcore.WfExecutionObject.State;
065: import de.danet.an.workflow.spis.aii.ResultProvider.ExceptionResult;
066: import de.danet.an.workflow.spis.ras.ActivityFinder;
067:
068: /**
069: * This class provides ...
070: *
071: * @author mnl
072: *
073: */
074: public class ActivityRemoteWrapper implements ExtActivity {
075:
076: private VolatileActivity activity;
077:
078: /**
079: * Create a new instance with all attributes initialized
080: * to defaults or the given values.
081: *
082: * @param activity
083: */
084: public ActivityRemoteWrapper(VolatileActivity activity) {
085: this .activity = activity;
086: }
087:
088: /**
089: * @param result
090: * @throws TransitionNotAllowedException
091: * @see de.danet.an.workflow.domain.AbstractActivity#abandon(de.danet.an.workflow.spis.aii.ResultProvider.ExceptionResult)
092: */
093: public void abandon(ExceptionResult result)
094: throws TransitionNotAllowedException {
095: activity.abandon(result);
096: }
097:
098: /**
099: * @param exception
100: * @throws TransitionNotAllowedException
101: * @see de.danet.an.workflow.domain.AbstractActivity#abandon(java.lang.String)
102: */
103: public void abandon(String exception)
104: throws TransitionNotAllowedException {
105: activity.abandon(exception);
106: }
107:
108: /**
109: * @throws CannotStopException
110: * @throws NotRunningException
111: * @see de.danet.an.workflow.domain.AbstractActivity#abort()
112: */
113: public void abort() throws CannotStopException, NotRunningException {
114: activity.abort();
115: }
116:
117: /**
118: *
119: * @see de.danet.an.workflow.domain.AbstractActivity#abortRequester()
120: */
121: public void abortRequester() {
122: activity.abortRequester();
123: }
124:
125: /**
126: * @return
127: * @see domain.VolatileActivity#activityFinder()
128: */
129: public ActivityFinder activityFinder() {
130: return activity.activityFinder();
131: }
132:
133: /**
134: * @return
135: * @see de.danet.an.workflow.domain.AbstractActivity#activityInfo()
136: */
137: public Info activityInfo() {
138: return activity.activityInfo();
139: }
140:
141: /**
142: * @return
143: * @see de.danet.an.workflow.domain.AbstractActivity#assignments()
144: */
145: public Collection assignments() {
146: return activity.assignments();
147: }
148:
149: /**
150: * @return
151: * @see domain.VolatileActivity#auditEventBase()
152: */
153: public WfAuditEvent auditEventBase() {
154: return activity.auditEventBase();
155: }
156:
157: /**
158: * @return
159: * @see de.danet.an.workflow.domain.AbstractActivity#blockActivity()
160: */
161: public String blockActivity() {
162: return activity.blockActivity();
163: }
164:
165: /**
166: * @param oldResource
167: * @param newResource
168: * @throws InvalidResourceException
169: * @throws AlreadyAssignedException
170: * @throws NotAssignedException
171: * @see de.danet.an.workflow.domain.AbstractActivity#changeAssignment(de.danet.an.workflow.omgcore.WfResource, de.danet.an.workflow.omgcore.WfResource)
172: */
173: public void changeAssignment(WfResource oldResource,
174: WfResource newResource) throws InvalidResourceException,
175: AlreadyAssignedException, NotAssignedException {
176: activity.changeAssignment(oldResource, newResource);
177: }
178:
179: /**
180: * @param newState
181: * @throws InvalidStateException
182: * @throws TransitionNotAllowedException
183: * @see de.danet.an.workflow.domain.AbstractActivity#changeState(de.danet.an.workflow.omgcore.WfExecutionObject.State)
184: */
185: public void changeState(State newState)
186: throws InvalidStateException, TransitionNotAllowedException {
187: activity.changeState(newState);
188: }
189:
190: /**
191: * @param newState
192: * @throws InvalidStateException
193: * @throws TransitionNotAllowedException
194: * @see de.danet.an.workflow.domain.AbstractExecutionObject#changeState(java.lang.String)
195: */
196: public void changeState(String newState)
197: throws InvalidStateException, TransitionNotAllowedException {
198: activity.changeState(newState);
199: }
200:
201: /**
202: * @return
203: * @throws TransitionNotAllowedException
204: * @see de.danet.an.workflow.domain.AbstractActivity#choose()
205: */
206: public boolean choose() throws TransitionNotAllowedException {
207: return activity.choose();
208: }
209:
210: /**
211: * @throws CannotCompleteException
212: * @see de.danet.an.workflow.domain.AbstractActivity#complete()
213: */
214: public void complete() throws CannotCompleteException {
215: activity.complete();
216: }
217:
218: /**
219: * @return
220: * @see domain.VolatileActivity#container()
221: */
222: public WfProcess container() {
223: return activity.container();
224: }
225:
226: /**
227: * @return
228: * @see de.danet.an.workflow.domain.AbstractActivity#deadlines()
229: */
230: public DeadlineInfo[] deadlines() {
231: return activity.deadlines();
232: }
233:
234: /**
235: * @return
236: * @see de.danet.an.workflow.domain.AbstractExecutionObject#debugEnabled()
237: */
238: public boolean debugEnabled() {
239: return activity.debugEnabled();
240: }
241:
242: /**
243: * @return
244: * @see de.danet.an.workflow.domain.AbstractActivity#deferChoiceOnSplit()
245: */
246: public boolean deferChoiceOnSplit() {
247: return activity.deferChoiceOnSplit();
248: }
249:
250: /**
251: * @return
252: * @see de.danet.an.workflow.domain.AbstractExecutionObject#description()
253: */
254: public String description() {
255: return activity.description();
256: }
257:
258: /**
259: * @param closedState
260: * @see de.danet.an.workflow.domain.AbstractActivity#doCloseActivity(de.danet.an.workflow.omgcore.WfExecutionObject.State)
261: */
262: public void doCloseActivity(State closedState) {
263: activity.doCloseActivity(closedState);
264: }
265:
266: /**
267: * @param obj
268: * @return
269: * @see de.danet.an.workflow.domain.AbstractExecutionObject#equals(java.lang.Object)
270: */
271: public boolean equals(Object obj) {
272: return activity.equals(obj);
273: }
274:
275: /**
276: * @return
277: * @see de.danet.an.workflow.domain.AbstractActivity#executor()
278: */
279: public Implementation executor() {
280: return activity.executor();
281: }
282:
283: /**
284: * @param asnmnt
285: * @return
286: * @see de.danet.an.workflow.domain.AbstractActivity#getResource(de.danet.an.workflow.omgcore.WfAssignment)
287: */
288: public WfResource getResource(WfAssignment asnmnt) {
289: return activity.getResource(asnmnt);
290: }
291:
292: /**
293: * @param event
294: * @see de.danet.an.workflow.domain.AbstractExecutionObject#handleAuditEvent(de.danet.an.workflow.omgcore.WfAuditEvent)
295: */
296: public void handleAuditEvent(WfAuditEvent event) {
297: activity.handleAuditEvent(event);
298: }
299:
300: /**
301: * @return
302: * @see de.danet.an.workflow.domain.AbstractActivity#handledExceptions()
303: */
304: public String[] handledExceptions() {
305: return activity.handledExceptions();
306: }
307:
308: /**
309: * @param info
310: * @see de.danet.an.workflow.domain.AbstractActivity#handleTimeout(java.io.Serializable)
311: */
312: public void handleTimeout(Serializable info) {
313: activity.handleTimeout(info);
314: }
315:
316: /**
317: * @return
318: * @see de.danet.an.workflow.domain.AbstractExecutionObject#hashCode()
319: */
320: public int hashCode() {
321: return activity.hashCode();
322: }
323:
324: /**
325: * @return
326: * @see domain.VolatileActivity#history()
327: */
328: public Collection history() {
329: return activity.history();
330: }
331:
332: /**
333: * @return
334: * @see de.danet.an.workflow.domain.AbstractExecutionObject#howClosed()
335: */
336: public State howClosed() {
337: return activity.howClosed();
338: }
339:
340: /**
341: * @return
342: * @see de.danet.an.workflow.domain.AbstractActivity#implementation()
343: */
344: public Implementation[] implementation() {
345: return activity.implementation();
346: }
347:
348: /**
349: * @param blockException
350: * @param exceptionName
351: * @return
352: * @see de.danet.an.workflow.domain.AbstractActivity#initiateAbandoning(boolean, java.lang.String)
353: */
354: public boolean initiateAbandoning(boolean blockException,
355: String exceptionName) {
356: return activity.initiateAbandoning(blockException,
357: exceptionName);
358: }
359:
360: /**
361: * @param appl
362: * @param params
363: * @see de.danet.an.workflow.domain.AbstractActivity#invokeTool(de.danet.an.workflow.internalapi.ExtApplication, java.util.Map)
364: */
365: public void invokeTool(ExtApplication appl, Map params) {
366: activity.invokeTool(appl, params);
367: }
368:
369: /**
370: * @param member
371: * @return
372: * @see de.danet.an.workflow.domain.AbstractActivity#isMemberOfAssignments(de.danet.an.workflow.omgcore.WfAssignment)
373: */
374: public boolean isMemberOfAssignments(WfAssignment member) {
375: return activity.isMemberOfAssignments(member);
376: }
377:
378: /**
379: * @param member
380: * @return
381: * @throws RemoteException
382: * @see de.danet.an.workflow.omgcore.WfRequester#isMemberOfPerformers(de.danet.an.workflow.omgcore.WfProcess)
383: */
384: public boolean isMemberOfPerformers(WfProcess member)
385: throws RemoteException {
386: return activity.isMemberOfPerformers(member);
387: }
388:
389: /**
390: * @return
391: * @see de.danet.an.workflow.domain.AbstractActivity#joinMode()
392: */
393: public JoinAndSplitMode joinMode() {
394: return activity.joinMode();
395: }
396:
397: /**
398: * @return
399: * @see de.danet.an.workflow.domain.AbstractExecutionObject#key()
400: */
401: public String key() {
402: return activity.key();
403: }
404:
405: /**
406: * @return
407: * @see de.danet.an.workflow.domain.AbstractExecutionObject#lastStateTime()
408: */
409: public Date lastStateTime() {
410: return activity.lastStateTime();
411: }
412:
413: /**
414: * @return
415: * @see de.danet.an.workflow.domain.AbstractExecutionObject#name()
416: */
417: public String name() {
418: return activity.name();
419: }
420:
421: /**
422: * @return
423: * @see domain.VolatileActivity#nextActivities()
424: */
425: public List nextActivities() {
426: return activity.nextActivities();
427: }
428:
429: /**
430: * @return
431: * @see de.danet.an.workflow.domain.AbstractActivity#performer()
432: */
433: public String performer() {
434: return activity.performer();
435: }
436:
437: /**
438: * @return
439: * @see de.danet.an.workflow.domain.AbstractActivity#performers()
440: */
441: public Collection performers() {
442: return activity.performers();
443: }
444:
445: /**
446: * @return
447: * @see de.danet.an.workflow.domain.AbstractActivity#preliminarilyChosen()
448: */
449: public boolean preliminarilyChosen() {
450: return activity.preliminarilyChosen();
451: }
452:
453: /**
454: * @return
455: * @see de.danet.an.workflow.domain.AbstractExecutionObject#priority()
456: */
457: public int priority() {
458: return activity.priority();
459: }
460:
461: /**
462: * @return
463: * @see de.danet.an.workflow.domain.AbstractActivity#processContext()
464: */
465: public ProcessData processContext() {
466: return activity.processContext();
467: }
468:
469: /**
470: * @param e
471: * @throws InvalidPerformerException
472: * @see de.danet.an.workflow.domain.AbstractActivity#receiveEvent(de.danet.an.workflow.omgcore.WfAuditEvent)
473: */
474: public void receiveEvent(WfAuditEvent e)
475: throws InvalidPerformerException {
476: activity.receiveEvent(e);
477: }
478:
479: /**
480: * @param resource
481: * @throws InvalidResourceException
482: * @throws NotAssignedException
483: * @see de.danet.an.workflow.domain.AbstractActivity#removeAssignment(de.danet.an.workflow.omgcore.WfResource)
484: */
485: public void removeAssignment(WfResource resource)
486: throws InvalidResourceException, NotAssignedException {
487: activity.removeAssignment(resource);
488: }
489:
490: /**
491: * @param preserveThreadInfo
492: * @param publishChange
493: * @see de.danet.an.workflow.domain.AbstractActivity#reset(boolean, boolean)
494: */
495: public void reset(boolean preserveThreadInfo, boolean publishChange) {
496: activity.reset(preserveThreadInfo, publishChange);
497: }
498:
499: /**
500: * @return
501: * @throws ResultNotAvailableException
502: * @see de.danet.an.workflow.domain.AbstractActivity#result()
503: */
504: public ProcessData result() throws ResultNotAvailableException {
505: return activity.result();
506: }
507:
508: /**
509: * @throws CannotResumeException
510: * @throws NotRunningException
511: * @throws NotSuspendedException
512: * @see de.danet.an.workflow.domain.AbstractActivity#resume()
513: */
514: public void resume() throws CannotResumeException,
515: NotRunningException, NotSuspendedException {
516: activity.resume();
517: }
518:
519: /**
520: * @param debug
521: * @throws InvalidStateException
522: * @see de.danet.an.workflow.domain.AbstractExecutionObject#setDebugEnabled(boolean)
523: */
524: public void setDebugEnabled(boolean debug)
525: throws InvalidStateException {
526: activity.setDebugEnabled(debug);
527: }
528:
529: /**
530: * @param newValue
531: * @see de.danet.an.workflow.domain.AbstractExecutionObject#setDescription(java.lang.String)
532: */
533: public void setDescription(String newValue) {
534: activity.setDescription(newValue);
535: }
536:
537: /**
538: * @param joinMode
539: * @see de.danet.an.workflow.domain.AbstractActivity#setJoinMode(de.danet.an.workflow.api.Activity.JoinAndSplitMode)
540: */
541: public void setJoinMode(JoinAndSplitMode joinMode) {
542: activity.setJoinMode(joinMode);
543: }
544:
545: /**
546: * @param newValue
547: * @see de.danet.an.workflow.domain.AbstractExecutionObject#setName(java.lang.String)
548: */
549: public void setName(String newValue) {
550: activity.setName(newValue);
551: }
552:
553: /**
554: * @param newValue
555: * @throws InvalidPriorityException
556: * @throws UpdateNotAllowedException
557: * @see de.danet.an.workflow.domain.AbstractExecutionObject#setPriority(int)
558: */
559: public void setPriority(int newValue)
560: throws InvalidPriorityException, UpdateNotAllowedException {
561: activity.setPriority(newValue);
562: }
563:
564: /**
565: * @param newValue
566: * @throws InvalidDataException
567: * @throws UpdateNotAllowedException
568: * @see de.danet.an.workflow.domain.AbstractActivity#setProcessContext(de.danet.an.workflow.omgcore.ProcessData)
569: */
570: public void setProcessContext(ProcessData newValue)
571: throws InvalidDataException, UpdateNotAllowedException {
572: activity.setProcessContext(newValue);
573: }
574:
575: /**
576: * @param result
577: * @throws InvalidDataException
578: * @see de.danet.an.workflow.domain.AbstractActivity#setResult(de.danet.an.workflow.omgcore.ProcessData)
579: */
580: public void setResult(ProcessData result)
581: throws InvalidDataException {
582: activity.setResult(result);
583: }
584:
585: /**
586: * @param splitMode
587: * @see de.danet.an.workflow.domain.AbstractActivity#setSplitMode(de.danet.an.workflow.api.Activity.JoinAndSplitMode)
588: */
589: public void setSplitMode(JoinAndSplitMode splitMode) {
590: activity.setSplitMode(splitMode);
591: }
592:
593: /**
594: * @param triggers
595: * @param preliminarilyChosen
596: * @see de.danet.an.workflow.domain.AbstractActivity#setStartable(java.util.Collection, boolean)
597: */
598: public void setStartable(Collection triggers,
599: boolean preliminarilyChosen) {
600: activity.setStartable(triggers, preliminarilyChosen);
601: }
602:
603: /**
604: * @param mode
605: * @see domain.VolatileActivity#setStartMode(de.danet.an.workflow.api.Activity.StartFinishMode)
606: */
607: public void setStartMode(StartFinishMode mode) {
608: activity.setStartMode(mode);
609: }
610:
611: /**
612: * @return
613: * @see de.danet.an.workflow.domain.AbstractActivity#splitMode()
614: */
615: public JoinAndSplitMode splitMode() {
616: return activity.splitMode();
617: }
618:
619: /**
620: * @throws AlreadyRunningException
621: * @see de.danet.an.workflow.domain.AbstractActivity#start()
622: */
623: public void start() throws AlreadyRunningException {
624: activity.start();
625: }
626:
627: /**
628: * @return
629: * @throws NotRunningException
630: * @see de.danet.an.workflow.domain.AbstractActivity#startTime()
631: */
632: public Date startTime() throws NotRunningException {
633: return activity.startTime();
634: }
635:
636: /**
637: * @param due
638: * @param info
639: * @see domain.VolatileActivity#startTimer(java.util.Date, java.io.Serializable)
640: */
641: public void startTimer(Date due, Serializable info) {
642: activity.startTimer(due, info);
643: }
644:
645: /**
646: * @return
647: * @see de.danet.an.workflow.domain.AbstractExecutionObject#state()
648: */
649: public String state() {
650: return activity.state();
651: }
652:
653: /**
654: *
655: * @see domain.VolatileActivity#stopTimers()
656: */
657: public void stopTimers() {
658: activity.stopTimers();
659: }
660:
661: /**
662: * @throws CannotSuspendException
663: * @throws NotRunningException
664: * @throws AlreadySuspendedException
665: * @see de.danet.an.workflow.domain.AbstractActivity#suspend()
666: */
667: public void suspend() throws CannotSuspendException,
668: NotRunningException, AlreadySuspendedException {
669: activity.suspend();
670: }
671:
672: /**
673: * @throws CannotStopException
674: * @throws NotRunningException
675: * @see de.danet.an.workflow.domain.AbstractActivity#terminate()
676: */
677: public void terminate() throws CannotStopException,
678: NotRunningException {
679: activity.terminate();
680: }
681:
682: /**
683: * @return
684: * @see de.danet.an.workflow.domain.AbstractActivity#threadInfo()
685: */
686: public ThreadInfo threadInfo() {
687: return activity.threadInfo();
688: }
689:
690: /**
691: * @return
692: * @see domain.VolatileActivity#toActivity()
693: */
694: public Activity toActivity() {
695: return activity.toActivity();
696: }
697:
698: /**
699: * @return
700: * @see de.danet.an.workflow.domain.AbstractActivity#toString()
701: */
702: public String toString() {
703: return activity.toString();
704: }
705:
706: /**
707: * @return
708: * @see de.danet.an.workflow.domain.AbstractExecutionObject#typedState()
709: */
710: public State typedState() {
711: return activity.typedState();
712: }
713:
714: /**
715: * @return
716: * @see de.danet.an.workflow.domain.AbstractActivity#uniqueKey()
717: */
718: public ActivityUniqueKey uniqueKey() {
719: return activity.uniqueKey();
720: }
721:
722: /**
723: * @param newName
724: * @see domain.VolatileActivity#updateProcessName(java.lang.String)
725: */
726: public void updateProcessName(String newName) {
727: activity.updateProcessName(newName);
728: }
729:
730: /**
731: * @return
732: * @see de.danet.an.workflow.domain.AbstractExecutionObject#validStates()
733: */
734: public Collection validStates() {
735: return activity.validStates();
736: }
737:
738: /**
739: * @return
740: * @see de.danet.an.workflow.domain.AbstractExecutionObject#whileOpen()
741: */
742: public State whileOpen() {
743: return activity.whileOpen();
744: }
745:
746: /**
747: * @return
748: * @see de.danet.an.workflow.domain.AbstractExecutionObject#whyNotRunning()
749: */
750: public State whyNotRunning() {
751: return activity.whyNotRunning();
752: }
753:
754: /**
755: * @param reset
756: * @throws TransitionNotAllowedException
757: * @see de.danet.an.workflow.domain.AbstractActivity#withdrawPreliminaryChoice(boolean)
758: */
759: public void withdrawPreliminaryChoice(boolean reset)
760: throws TransitionNotAllowedException {
761: activity.withdrawPreliminaryChoice(reset);
762: }
763:
764: /**
765: * @return
766: * @see de.danet.an.workflow.domain.AbstractExecutionObject#workflowState()
767: */
768: public State workflowState() {
769: return activity.workflowState();
770: }
771:
772: /**
773: * @param procKey
774: * @param channel
775: * @see de.danet.an.workflow.domain.AbstractActivity#waitOnChannel(java.lang.String, java.lang.String)
776: */
777: public void waitOnChannel(String procKey, String channel) {
778: activity.waitOnChannel(procKey, channel);
779: }
780:
781: }
|