org.apache.lenya.workflow
Interface WorkflowInstance

All Known Implementing Classes:
WorkflowDocument, WorkflowInstanceImpl

public interface WorkflowInstance

A workflow instance is an incarnation of a workflow schema. It consists of


Method Summary
 void addWorkflowListener(WorkflowListener listener)
          Adds a workflow listener.
 State getCurrentState()
          Returns the current state of this WorkflowInstance.
 Event[] getExecutableEvents(Situation situation)
          Returns the executable events in a certain situation.
 boolean getValue(java.lang.String variableName)
          Returns the current value of a variable.
 Workflow getWorkflow()
          Returns the workflow this instance belongs to.
 void invoke(Situation situation, Event event)
          Indicates that the user invoked an event.
 boolean isSynchronized(Event event)
          Returns if the transition for a certain event is synchronized.
 void removeWorkflowListener(WorkflowListener listener)
          Removes a workflow listener.
 

Method Detail

getWorkflow

Workflow getWorkflow()
Returns the workflow this instance belongs to.

Returns:
A Workflow object.

getCurrentState

State getCurrentState()
Returns the current state of this WorkflowInstance.

Returns:
the current state

getExecutableEvents

Event[] getExecutableEvents(Situation situation)
                            throws WorkflowException
Returns the executable events in a certain situation.

Parameters:
situation - The situation.
Returns:
An array of events.
Throws:
WorkflowException - when something went wrong.

invoke

void invoke(Situation situation,
            Event event)
            throws WorkflowException
Indicates that the user invoked an event.

Parameters:
situation - The situation in which the event was invoked.
event - The event that was invoked.
Throws:
WorkflowException - when something went wrong.

getValue

boolean getValue(java.lang.String variableName)
                 throws WorkflowException
Returns the current value of a variable.

Parameters:
variableName - A variable name.
Returns:
A boolean value.
Throws:
WorkflowException - when the variable does not exist.

addWorkflowListener

void addWorkflowListener(WorkflowListener listener)
Adds a workflow listener.

Parameters:
listener - The listener to add.

removeWorkflowListener

void removeWorkflowListener(WorkflowListener listener)
Removes a workflow listener.

Parameters:
listener - The listener to remove.

isSynchronized

boolean isSynchronized(Event event)
                       throws WorkflowException
Returns if the transition for a certain event is synchronized.

Parameters:
event - An event.
Returns:
A boolean value.
Throws:
WorkflowException


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.