com.arsdigita.workflow.simple
Class WorkflowTemplate

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.auditing.AuditedACSObject
                  extended bycom.arsdigita.workflow.simple.Task
                      extended bycom.arsdigita.workflow.simple.Workflow
                          extended bycom.arsdigita.workflow.simple.WorkflowTemplate
All Implemented Interfaces:
Audited, Cloneable

public class WorkflowTemplate
extends Workflow


Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String versionId
           
 
Fields inherited from class com.arsdigita.workflow.simple.Workflow
DELETED, INIT, NONE, STARTED, STOPPED
 
Fields inherited from class com.arsdigita.workflow.simple.Task
DISABLED, ENABLED, FINISHED, INACTIVE
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
  WorkflowTemplate()
          Creates a new workflow process definition with the properties label and description set to null.
  WorkflowTemplate(BigDecimal id)
          Restores a workflow process definition with a BigDecimal.
  WorkflowTemplate(DataObject workflowTemplateDataObject)
          Restores a workflow process definition from task data object.
protected WorkflowTemplate(ObjectType type)
          Constructor for setting the object type name.
  WorkflowTemplate(OID oid)
          Restores a workflow process definition with an OID.
protected WorkflowTemplate(String typeName)
           
  WorkflowTemplate(String label, String description)
          Creates a new workflow process definition.
 
Method Summary
 void addTask(Task task)
          Adds a task to this process.
 void extendWorkflow(Workflow workflow)
          Extends the workflow by appending the tasks from the workflow template
 Iterator getEnabledTasks()
          Returns an iterator over all enabled tasks in the process.
 Iterator getFinishedTasks()
          Returns an iterator over all finished tasks in the process.
 OID getObjectOID()
          Returns the object associated with the process.
 Iterator getOverdueTasks()
           
 int getProcessState()
          Retrieves the state of the process.
 Workflow instantiateNewWorkflow()
          Creates a workflow based on the supplied workflow definition ID.
 void setObject(ACSObject o)
          Sets the Object that this workflow is applied to.
 void start(User user)
          Starts the process.
 void stop(User user)
          Stops the process.
 
Methods inherited from class com.arsdigita.workflow.simple.Workflow
clone, cloneTasks, disableEvt, enable, getBaseDataObjectType, getItemID, getItemID, getObject, getObjectWorkflow, getObjectWorkflow, getObjectWorkflowID, getObjectWorkflowID, getTaskCollection, getTaskCount, getTasks, getWorkflowTemplate, initialize, removeAllTasks, removeTask, removeTask, save, setObjectID, setWorkflowTemplate, startInternal
 
Methods inherited from class com.arsdigita.workflow.simple.Task
addComment, addComment, addComment, addDependency, addFinishedListener, copyAttributes, delete, disable, enableEvt, equals, finish, finishEvt, getComments, getCommentsSize, getDependencies, getDependencyCount, getDescription, getDisplayName, getFinishedListeners, getFinishedListenersCount, getFinishedListenersInternal, getLabel, getLastComment, getLastCommentInWorkflow, getParentID, getRequiredTasks, getState, getStateMapping, getStateString, getStateString, getWorkflow, initAttributes, isActive, isDependency, isEnabled, isFinished, notifyFinished, removeAllDependencies, removeAllFinishedListeners, removeComment, removeDependency, removeFinishedListener, rollbackEvt, setActive, setDescription, setLabel, setState, toString
 
Methods inherited from class com.arsdigita.auditing.AuditedACSObject
getCreationDate, getCreationIP, getCreationUser, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, isContainerModified, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, disconnect, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values
Constructor Detail

WorkflowTemplate

public WorkflowTemplate(String label,
                        String description)
Creates a new workflow process definition. Properties of this object are not made persistent until the save() method is called.

Parameters:
label - the label
description - the description

WorkflowTemplate

public WorkflowTemplate()
Creates a new workflow process definition with the properties label and description set to null. Properties of this object are not made persistent until the save method is called. If save() is called without setting these properties, an IllegalArgumentException will be thrown.


WorkflowTemplate

public WorkflowTemplate(DataObject workflowTemplateDataObject)
Restores a workflow process definition from task data object.

Parameters:
workflowTemplateDataObject - the template object to restore the process from

WorkflowTemplate

protected WorkflowTemplate(ObjectType type)
Constructor for setting the object type name.

Parameters:
type - the type name

WorkflowTemplate

protected WorkflowTemplate(String typeName)

WorkflowTemplate

public WorkflowTemplate(OID oid)
                 throws DataObjectNotFoundException
Restores a workflow process definition with an OID.

Parameters:
oid - the OID

WorkflowTemplate

public WorkflowTemplate(BigDecimal id)
                 throws DataObjectNotFoundException
Restores a workflow process definition with a BigDecimal.

Parameters:
id - the BigDecimal ID of this object. An OID will be created implicitly with the BASE_DATA_OBJECT_TYPE constant specified in this file.
Method Detail

instantiateNewWorkflow

public Workflow instantiateNewWorkflow()
Creates a workflow based on the supplied workflow definition ID.

Returns:
the workflow

extendWorkflow

public void extendWorkflow(Workflow workflow)
Extends the workflow by appending the tasks from the workflow template


addTask

public void addTask(Task task)
Adds a task to this process. (persistent operation)

Overrides:
addTask in class Workflow
Parameters:
task - the task to add to this process TODO: change this to use role relations. right now we just change the parent of the task manually. This should be donevia the PDL file.
See Also:
Task

stop

public void stop(User user)
Description copied from class: Workflow
Stops the process. (persistent operation)

Overrides:
stop in class Workflow
Parameters:
user - the user that stopped the process

start

public void start(User user)
Description copied from class: Workflow
Starts the process. This method marks all the tasks as active when called the first time. (persistent operation)

Overrides:
start in class Workflow
Parameters:
user - the user that starts the process

getProcessState

public int getProcessState()
Description copied from class: Workflow
Retrieves the state of the process.

Overrides:
getProcessState in class Workflow
Returns:
The process state

setObject

public void setObject(ACSObject o)
Description copied from class: Workflow
Sets the Object that this workflow is applied to.

Overrides:
setObject in class Workflow
Parameters:
o - the object to which to apply this workflow.

getEnabledTasks

public Iterator getEnabledTasks()
Description copied from class: Workflow
Returns an iterator over all enabled tasks in the process.

Overrides:
getEnabledTasks in class Workflow
Returns:
an interator over enabled tasks.

getFinishedTasks

public Iterator getFinishedTasks()
Description copied from class: Workflow
Returns an iterator over all finished tasks in the process.

Overrides:
getFinishedTasks in class Workflow
Returns:
an iterator over finished tasks.

getOverdueTasks

public Iterator getOverdueTasks()
Overrides:
getOverdueTasks in class Workflow
Returns:
an iterator over all overdue tasks in the process.

getObjectOID

public OID getObjectOID()
Description copied from class: Workflow
Returns the object associated with the process.

Overrides:
getObjectOID in class Workflow
Returns:
the ACS object that this process is based on.


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC