org.jwarp.flow.state
Interface IStateManager

All Superinterfaces:
IConfigurable, IWorkflowSystemAware

public interface IStateManager
extends IWorkflowSystemAware, IConfigurable

The state manager is the manager object which actually handles all state related stuff. States can created, removed and managed here. This class actually encapsulate the underlying communication to an actual implementation such as an EJB server containing the state definitions.


Method Summary
 IState createState(java.lang.String name, java.lang.String description, ITicket user)
          This creates a new global state within the given workflow system.
 IState createState(java.lang.String name, java.lang.String description, IWorkflowModel model, ITicket user)
          This creates a new state within the given workflow model.
 java.util.Iterator getGlobalStates(ITicket user)
          Return the global states of a flow system.
 IState getState(int id, ITicket user)
          Get a state.
 java.util.Iterator getStates(IWorkflowModel model, ITicket user)
          Return all the states valid for a model.
 void removeState(IState state, ITicket user)
          Removes a state from the db.
 java.util.Iterator searchStates(java.lang.String name, IWorkflowModel model, IWorkflow flow, ITicket admin)
          Search for states.
 void updateState(int id, java.lang.String name, java.lang.String description, ITicket user)
          Update a state value.
 
Methods inherited from interface org.jwarp.flow.IWorkflowSystemAware
getWorkflowSystem, setWorkflowSystem
 
Methods inherited from interface org.jwarp.service.configuration.IConfigurable
configure
 

Method Detail

getStates

public java.util.Iterator getStates(IWorkflowModel model,
                                    ITicket user)
                             throws java.lang.SecurityException
Return all the states valid for a model. This method returns the model specific states as also the flow system globally defined roles.
Parameters:
model - The model
user - The user ticket
Returns:
The states for according to the model
Throws:
java.lang.SecurityException - If access was denied.

getGlobalStates

public java.util.Iterator getGlobalStates(ITicket user)
                                   throws java.lang.SecurityException
Return the global states of a flow system.
Parameters:
system - The system
user - The user ticket
Returns:
The states for according to the model
Throws:
java.lang.SecurityException - If access was denied.

createState

public IState createState(java.lang.String name,
                          java.lang.String description,
                          ITicket user)
                   throws InitializationException,
                          java.lang.SecurityException
This creates a new global state within the given workflow system.
Parameters:
name - The name of the new role
description - The roles description
system - The system
user - The user ticket
Returns:
The newly created state
Throws:
InitializationException - If the state could not be created.
java.lang.SecurityException - If access was denied.

createState

public IState createState(java.lang.String name,
                          java.lang.String description,
                          IWorkflowModel model,
                          ITicket user)
                   throws InitializationException,
                          java.lang.SecurityException
This creates a new state within the given workflow model.
Parameters:
name - The name of the new state
description - The roles description
system - The system
user - The user ticket
Returns:
The newly created state
Throws:
InitializationException - If the state could not be created.
java.lang.SecurityException - If access was denied.

updateState

public void updateState(int id,
                        java.lang.String name,
                        java.lang.String description,
                        ITicket user)
                 throws NotFoundException,
                        java.lang.SecurityException
Update a state value.
Parameters:
id - The state's id
name - The new state's name
description - The new state's description
user - The user ticket
Returns:
The newly created role
Throws:
java.lang.SecurityException - If access was denied.
NotFoundException - If the state could not be located.

removeState

public void removeState(IState state,
                        ITicket user)
                 throws NotFoundException,
                        java.lang.SecurityException
Removes a state from the db. Note that a state can only be removed if all dependencies are also removed. Dependencies are transitions that depend on this state.
Parameters:
state - The role
user - The user
Throws:
NotFoundException - If the state could not be located.
java.lang.SecurityException - If access was denied.

getState

public IState getState(int id,
                       ITicket user)
                throws java.lang.SecurityException
Get a state.
Parameters:
id - The state's id number
user - The user ticket
Returns:
The state
Throws:
java.lang.SecurityException - If access was denied.

searchStates

public java.util.Iterator searchStates(java.lang.String name,
                                       IWorkflowModel model,
                                       IWorkflow flow,
                                       ITicket admin)
                                throws java.lang.SecurityException
Search for states.
Parameters:
name - The state's name
system - The workflow system
model - The workflow model
flow - The workflow
admin - The user ticket
Returns:
The states
Throws:
java.lang.SecurityException - If access was denied.

©   O R C A   S y s t e m s