|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.lenya.workflow.impl.History
public abstract class History
The history of a workflow instance contains a list of all versions of the instance. A version contains
| Field Summary | |
|---|---|
static java.lang.String |
DATE_ATTRIBUTE
|
static java.lang.String |
EVENT_ATTRIBUTE
|
static java.lang.String |
HISTORY_ELEMENT
|
static java.lang.String |
NAME_ATTRIBUTE
|
static java.lang.String |
STATE_ATTRIBUTE
|
static java.lang.String |
VALUE_ATTRIBUTE
|
static java.lang.String |
VARIABLE_ELEMENT
|
static java.lang.String |
VERSION_ELEMENT
|
static java.lang.String |
WORKFLOW_ATTRIBUTE
|
| Constructor Summary | |
|---|---|
protected |
History()
Creates a new history object for a workflow instance. |
| Method Summary | |
|---|---|
protected org.w3c.dom.Element |
createInitialVersionElement(NamespaceHelper helper,
Situation situation,
java.lang.String workflowId)
Creates a new version element. |
protected abstract WorkflowInstanceImpl |
createInstance()
Factory method to create a workflow instance object. |
protected org.w3c.dom.Element |
createVersionElement(NamespaceHelper helper,
Situation situation)
Creates a version element based on a situation. |
protected org.w3c.dom.Element |
createVersionElement(NamespaceHelper helper,
StateImpl state,
Situation situation,
Event event)
Creates a new version element. |
void |
delete()
Deletes the history. |
protected abstract java.io.File |
getHistoryFile()
Factory method to obtain the history file. |
WorkflowInstanceImpl |
getInstance()
Restores the workflow, state and variables of a workflow instance from this history. |
protected NamespaceHelper |
getNamespaceHelper()
Returns the namespace helper for the history file. |
Version[] |
getVersions()
Returns the versions of this history. |
protected java.lang.String |
getWorkflowId()
Returns the workflow ID for this history. |
protected java.lang.String |
getWorkflowId(NamespaceHelper helper)
Returns the workflow ID for this history. |
void |
initialize(java.lang.String workflowId,
Situation situation)
Creates a new history object. |
boolean |
isInitialized()
Returns if the history has been initialized. |
protected void |
move(java.io.File newFile)
Moves this history to a new file. |
protected void |
restoreState(WorkflowInstanceImpl instance,
NamespaceHelper helper)
Restores the state of a workflow instance. |
protected void |
restoreVariables(WorkflowInstanceImpl instance,
NamespaceHelper helper)
Restores the state variables of a workflow instance. |
protected Version |
restoreVersion(NamespaceHelper helper,
org.w3c.dom.Element element)
Restores a version from an XML element. |
protected void |
saveVariables(NamespaceHelper helper)
Saves the state variables as children of the document element. |
void |
setInstance(WorkflowInstanceImpl impl)
Sets the workflow instance. |
void |
transitionFired(WorkflowInstance instance,
Situation situation,
Event event)
Advances the workflow history when a tranistion was invoked. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String WORKFLOW_ATTRIBUTE
public static final java.lang.String HISTORY_ELEMENT
public static final java.lang.String VERSION_ELEMENT
public static final java.lang.String STATE_ATTRIBUTE
public static final java.lang.String EVENT_ATTRIBUTE
public static final java.lang.String VARIABLE_ELEMENT
public static final java.lang.String NAME_ATTRIBUTE
public static final java.lang.String VALUE_ATTRIBUTE
public static final java.lang.String DATE_ATTRIBUTE
| Constructor Detail |
|---|
protected History()
| Method Detail |
|---|
public void initialize(java.lang.String workflowId,
Situation situation)
throws WorkflowException
workflowId - The workflow ID.situation - The current situation.
WorkflowException - when something went wrong.
protected NamespaceHelper getNamespaceHelper()
throws WorkflowException
WorkflowException - It the helper could not be obtained.
protected java.lang.String getWorkflowId()
throws WorkflowException
WorkflowException - when something went wrong.
protected java.lang.String getWorkflowId(NamespaceHelper helper)
throws WorkflowException
helper - The namespace helper for the history document.
WorkflowException - when something went wrong.
public WorkflowInstanceImpl getInstance()
throws WorkflowException
WorkflowException - if something goes wrong.public boolean isInitialized()
protected abstract java.io.File getHistoryFile()
protected abstract WorkflowInstanceImpl createInstance()
throws WorkflowException
WorkflowException - if something goes wrong.
protected org.w3c.dom.Element createInitialVersionElement(NamespaceHelper helper,
Situation situation,
java.lang.String workflowId)
throws WorkflowException
helper - The namespace helper of the history document.situation - The current situation.workflowId - The workflow ID.
WorkflowException - when something went wrong.
protected org.w3c.dom.Element createVersionElement(NamespaceHelper helper,
StateImpl state,
Situation situation,
Event event)
helper - The namespace helper of the history document.state - The state of the new version.situation - The current situation.event - The event that was invoked.
protected org.w3c.dom.Element createVersionElement(NamespaceHelper helper,
Situation situation)
helper - The namespace helper of the history document.situation - The current situation.
public void transitionFired(WorkflowInstance instance,
Situation situation,
Event event)
throws WorkflowException
transitionFired in interface WorkflowListenerinstance - The workflow instance.situation - The situation before the transition.event - The invoked event.
WorkflowException - when something went wrong.public void setInstance(WorkflowInstanceImpl impl)
impl - A workflow instance implementation.
protected void saveVariables(NamespaceHelper helper)
throws WorkflowException
helper - The helper that holds the document.
WorkflowException - when something went wrong.
protected void restoreVariables(WorkflowInstanceImpl instance,
NamespaceHelper helper)
throws WorkflowException
instance - The instance to restore.helper - The helper that wraps the history document.
WorkflowException - when something went wrong.
protected void restoreState(WorkflowInstanceImpl instance,
NamespaceHelper helper)
throws WorkflowException
instance - The instance to restore.helper - The helper that wraps the history document.
WorkflowException - when something went wrong.
protected void move(java.io.File newFile)
throws WorkflowException
newFile - The new file.
WorkflowException - when something went wrong.
protected Version restoreVersion(NamespaceHelper helper,
org.w3c.dom.Element element)
throws WorkflowException
helper - The namespace helper.element - An XML element.
WorkflowException - when something went wrong.
public Version[] getVersions()
throws WorkflowException
WorkflowException - when something went wrong.
public void delete()
throws WorkflowException
WorkflowException - when something went wrong.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||