/*
* This file is part of the WfMOpen project.
* Copyright (C) 2001-2003 Danet GmbH (www.danet.de), GS-AN.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: ActivityBase.java 2368 2007-05-03 21:58:25Z mlipp $
*
* $Log$
* Revision 1.14 2007/02/27 14:34:15 drmlipp
* Some refactoring to reduce cyclic dependencies.
*
* Revision 1.13 2007/01/30 11:56:15 drmlipp
* Merged Wf-XML branch.
*
* Revision 1.12 2006/12/14 16:05:51 drmlipp
* Changed handling of conditions in exception transitions.
*
* Revision 1.11 2006/10/17 22:58:39 mlipp
* Continuing implementation of suspended exception handling.
*
* Revision 1.10 2006/10/13 11:41:58 drmlipp
* New attribute for saving exception name.
*
* Revision 1.9 2006/09/29 12:32:08 drmlipp
* Consistently using WfMOpen as projct name now.
*
* Revision 1.8 2006/03/08 14:46:43 drmlipp
* Synchronized with 1.3.3p5.
*
* Revision 1.7 2005/10/15 21:19:38 mlipp
* Added support for providing WfAssignment
* implementations based purely on methods of Activity.
*
* Revision 1.6 2005/08/25 13:24:22 drmlipp
* Synchronized with 1.3.1p6.
*
* Revision 1.5 2005/02/04 14:25:26 drmlipp
* Synchronized with 1.3rc2.
*
* Revision 1.4.2.3 2005/02/01 21:15:52 drmlipp
* Fixed audit event generation for deferred choice.
*
* Revision 1.4.2.2 2005/02/01 16:08:44 drmlipp
* Implemented deferred choice.
*
* Revision 1.4.2.1 2005/01/31 15:41:12 drmlipp
* Started implementation of deferred choice.
*
* Revision 1.4 2005/01/09 21:32:42 mlipp
* Added support for debugging exceptions and deadlines.
*
* Revision 1.3 2005/01/05 21:29:22 mlipp
* Added method to retrieve handled exceptions.
*
* Revision 1.2 2005/01/02 20:49:13 mlipp
* First version of debug mode.
*
* Revision 1.1.1.1 2004/08/18 15:17:38 drmlipp
* Update to 1.2
*
* Revision 1.2 2004/06/14 19:37:20 lipp
* Fixed assignment functions and cleaned up assignment related
* interfaces.
*
* Revision 1.1 2004/05/06 19:39:18 lipp
* Restructured block activity handling.
*
*/
package de.danet.an.workflow.domain;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import de.danet.an.workflow.internalapi.ExtActivityLocal;
import de.danet.an.workflow.internalapi.ExtApplication;
import de.danet.an.workflow.internalapi.ThreadInfo;
import de.danet.an.workflow.localapi.ProcessLocal;
import de.danet.an.workflow.localcoreapi.WfProcessLocal;
import de.danet.an.workflow.omgcore.AlreadyRunningException;
import de.danet.an.workflow.omgcore.AlreadySuspendedException;
import de.danet.an.workflow.omgcore.CannotCompleteException;
import de.danet.an.workflow.omgcore.CannotResumeException;
import de.danet.an.workflow.omgcore.CannotStopException;
import de.danet.an.workflow.omgcore.CannotSuspendException;
import de.danet.an.workflow.omgcore.HistoryNotAvailableException;
import de.danet.an.workflow.omgcore.InvalidDataException;
import de.danet.an.workflow.omgcore.InvalidPerformerException;
import de.danet.an.workflow.omgcore.InvalidPriorityException;
import de.danet.an.workflow.omgcore.InvalidResourceException;
import de.danet.an.workflow.omgcore.InvalidStateException;
import de.danet.an.workflow.omgcore.NotAssignedException;
import de.danet.an.workflow.omgcore.NotRunningException;
import de.danet.an.workflow.omgcore.NotSuspendedException;
import de.danet.an.workflow.omgcore.ProcessData;
import de.danet.an.workflow.omgcore.ResultNotAvailableException;
import de.danet.an.workflow.omgcore.TransitionNotAllowedException;
import de.danet.an.workflow.omgcore.UpdateNotAllowedException;
import de.danet.an.workflow.omgcore.WfAssignment;
import de.danet.an.workflow.omgcore.WfAuditEvent;
import de.danet.an.workflow.omgcore.WfProcess;
import de.danet.an.workflow.omgcore.WfResource;
import de.danet.an.workflow.omgcore.WfExecutionObject.State;
import de.danet.an.workflow.api.Activity;
import de.danet.an.workflow.api.ActivityUniqueKey;
import de.danet.an.workflow.api.AlreadyAssignedException;
import de.danet.an.workflow.api.Activity.DeadlineInfo;
import de.danet.an.workflow.api.Activity.Implementation;
import de.danet.an.workflow.api.Activity.Info;
import de.danet.an.workflow.api.Activity.JoinAndSplitMode;
import de.danet.an.workflow.spis.aii.ResultProvider.ExceptionResult;
import de.danet.an.workflow.spis.ras.ActivityFinder;
/**
* This class provides an implementation of <code>ExtActivity</code>
* with all methods except <code>key()</code> throwing
* <code>UnsupportedOprationException</code>. This class can be used
* as a base class for incomplete activity implementations.
*
* @author <a href="mailto:mnl@mnl.de">Michael N. Lipp</a>
* @version $Revision: 2368 $
*/
public abstract class ActivityBase implements ExtActivityLocal, Serializable {
private String key;
/**
* Creates an instance of <code>ActivityBase</code>
* with all attributes initialized to given values.
* @param key activity key
*/
public ActivityBase (String key) {
this.key = key;
}
// Code for implementing de.danet.an.workflow.omgcore.WfRequester
/* Comment copied from interface. */
public Collection performers() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public Date startTime() throws NotRunningException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public boolean isMemberOfPerformers(WfProcess member) {
throw new UnsupportedOperationException ();
}
// Code for implementing de.danet.an.workflow.api.Activity methods to ref
/* Comment copied from interface. */
public ActivityUniqueKey uniqueKey() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public ActivityFinder activityFinder () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public Implementation[] implementation() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public DeadlineInfo[] deadlines() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void invokeTool (ExtApplication appl, Map params) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void abortRequester () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public String performer() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public Implementation executor() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void setJoinMode(JoinAndSplitMode joinMode) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public JoinAndSplitMode joinMode() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void setSplitMode(JoinAndSplitMode splitMode) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public JoinAndSplitMode splitMode() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void setDebugEnabled(boolean debug) throws InvalidStateException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public boolean debugEnabled () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public boolean deferChoiceOnSplit () {
return false;
}
/* Comment copied from interface. */
public boolean preliminarilyChosen () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void withdrawPreliminaryChoice (boolean reset)
throws TransitionNotAllowedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public List nextActivities () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public Info activityInfo () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void receiveEvent (WfAuditEvent evt)
throws InvalidPerformerException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public WfResource getResource (WfAssignment asnmnt) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void changeAssignment
(WfResource oldResource, WfResource newResource)
throws InvalidResourceException,
AlreadyAssignedException, NotAssignedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void removeAssignment (WfResource resource)
throws InvalidResourceException,
NotAssignedException {
throw new UnsupportedOperationException ();
}
// Code for implementing de.danet.an.workflow.omgcore.WfActivity
/* Comment copied from interface. */
public Collection assignments() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public boolean isMemberOfAssignments (WfAssignment member) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public WfProcessLocal containerLocal() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public ProcessData result()
throws ResultNotAvailableException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void setResult (ProcessData result)
throws InvalidDataException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void complete() throws CannotCompleteException {
throw new UnsupportedOperationException ();
}
// Code for implementing de.danet.an.workflow.api.ExecutionObject
/* Comment copied from interface. */
public State typedState () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void changeState (State newState)
throws InvalidStateException,
TransitionNotAllowedException {
throw new UnsupportedOperationException ();
}
// Code for implementing de.danet.an.workflow.omgcore.WfExecutionObject
/* Comment copied from interface. */
public State workflowState () {
return typedState().workflowState();
}
/* Comment copied from interface. */
public State whileOpen () {
return typedState().whileOpenState();
}
/* Comment copied from interface. */
public State whyNotRunning () {
return typedState().whyNotRunningState();
}
/* Comment copied from interface. */
public State howClosed () {
return typedState().howClosedState();
}
/* Comment copied from interface. */
public Collection validStates () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public String state () {
return typedState().toString ();
}
/* Comment copied from interface. */
public void changeState (String newState) throws
InvalidStateException, TransitionNotAllowedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void doCloseActivity (State closedState) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public String name () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void setName (String newValue) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public String key () {
return key;
}
/* Comment copied from interface. */
public String description () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void setDescription (String newValue) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public ProcessData processContext () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void setProcessContext (ProcessData newValue)
throws InvalidDataException,
UpdateNotAllowedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public int priority () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void setPriority (int newValue)
throws InvalidPriorityException,
UpdateNotAllowedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public Date lastStateTime () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void resume ()
throws CannotResumeException,
NotRunningException, NotSuspendedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void suspend ()
throws CannotSuspendException,
NotRunningException, AlreadySuspendedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void terminate ()
throws CannotStopException, NotRunningException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void abort ()
throws CannotStopException, NotRunningException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public boolean initiateAbandoning
(boolean blockException, String exceptionName) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public Collection history ()
throws HistoryNotAvailableException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void start () throws AlreadyRunningException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void setStartable (Collection triggers, boolean preliminaryChoice) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void reset (boolean preserveThreadInfo, boolean publishChange) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public ThreadInfo threadInfo () {
return new ThreadInfo (null);
}
/* Comment copied from interface. */
public WfAuditEvent auditEventBase () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void handleAuditEvent (WfAuditEvent event) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void updateProcessName (String newName) {
throw new UnsupportedOperationException ();
}
/* Coment copied from interface. */
public String[] handledExceptions() {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public String blockActivity () {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void abandon(String exception)
throws TransitionNotAllowedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void abandon(ExceptionResult result)
throws TransitionNotAllowedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public boolean choose ()
throws TransitionNotAllowedException {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public void waitOnChannel (ProcessLocal proc, String channel) {
throw new UnsupportedOperationException ();
}
/* Comment copied from interface. */
public Activity toActivity () {
throw new UnsupportedOperationException ();
}
/**
* Return string representation for debugging purposes.
* @return a string representation.
*/
public String toString() {
return "ActivityBase[" + key + "]";
}
}