com.silverpeas.workflow.engine.model
Class StateImpl

java.lang.Object
  extended by com.silverpeas.workflow.engine.AbstractReferrableObject
      extended by com.silverpeas.workflow.engine.model.StateImpl
All Implemented Interfaces:
AbstractDescriptor, State, ReferrableObjectIntf, Serializable

public class StateImpl
extends AbstractReferrableObject
implements State, AbstractDescriptor, Serializable

Class implementing the representation of the <state> element of a Process Model.

See Also:
Serialized Form

Constructor Summary
StateImpl()
          Constructor
StateImpl(String name)
          Constructor
 
Method Summary
 void addActivity(ContextualDesignation label)
          Add an activity Method needed primarily by Castor
 void addDescription(ContextualDesignation description)
          Add a description Method needed primarily by Castor
 void addLabel(ContextualDesignation label)
          Add a label Method needed primarily by Castor
 String castor_getTimeoutInterval()
          Get the timeout interval of this state
 void castor_setTimeoutInterval(String timeoutInterval)
          Set the timeout interval of this state
 AllowedActions createAllowedActions()
          Create and return an object implementing AllowedActions
 ContextualDesignation createDesignation()
          Create an object implementing ContextualDesignation Method needed primarily by Castor
 QualifiedUsers createQualifiedUsers()
          Create and return an object implementing QalifiedUsers
 TimeOutActions createTimeOutActions()
          Create and return an object implementing TimeOutActions
 ContextualDesignations getActivities()
          Get all the activities
 String getActivity(String role, String language)
          Get activity in specific language for the given role
 Action[] getAllowedActions()
          Get actions available in this state
 AllowedActions getAllowedActionsEx()
          Get all the allowed actions
 String getDescription(String role, String language)
          Get description in specific language for the given role
 ContextualDesignations getDescriptions()
          Get all the descriptions
 Action[] getFilteredActions()
           
 int getId()
           
 QualifiedUsers getInterestedUsers()
          Get all the users interested by this state
 QualifiedUsers getInterestedUsersEx()
          Get all the users interested by this state
 String getKey()
          Get the unique key, used by equals method
 String getLabel(String role, String language)
          Get label in specific language for the given role
 ContextualDesignations getLabels()
          Get all the labels
 String getName()
          Get the name of this state
 AbstractDescriptor getParent()
           
 Action getTimeoutAction()
          Get the timeout action of this state Action that will played if timeout is triggered
 TimeOutAction[] getTimeOutActions()
          Get timeout actions for this state
 TimeOutActions getTimeOutActionsEx()
          Get all the timeout actions
 int getTimeoutInterval()
          Get the timeout interval of this state
 boolean getTimeoutNotifyAdmin()
          Get flag for admin notification if true, the timeout manager will send a notification to all supervisors
 QualifiedUsers getWorkingUsers()
          Get the pre-conditions to enter this state
 QualifiedUsers getWorkingUsersEx()
          Get all the users who can act in this state
 boolean hasId()
           
 Iterator<ContextualDesignation> iterateActivity()
          Iterate through the activities
 Iterator<ContextualDesignation> iterateDescription()
          Iterate through the descriptions
 Iterator<ContextualDesignation> iterateLabel()
          Iterate through the Labels
 void setAllowedActions(AllowedActions allowedActions)
          Set the allowed actions
 void setFilteredActions(AllowedActions allowedActions)
           
 void setId(int id)
          Implemented methods
 void setInterestedUsers(QualifiedUsers interestedUsers)
          Set all the users interested by this state
 void setName(String name)
          Set the name of this state
 void setParent(AbstractDescriptor parent)
           
 void setTimeoutAction(Action timeoutAction)
          Set the timeout action of this state Action that will played if timeout is trigerred
 void setTimeOutActions(TimeOutActions timeOutActions)
          Set the timeout actions
 void setTimeoutInterval(int hours)
          Set the timeout interval of this state
 void setTimeoutNotifyAdmin(boolean timeoutAction)
          Set flag for admin notification if true, the timeout manager will send a notification to all supervisors
 void setWorkingUsers(QualifiedUsers workingUsers)
          Set all the users who can act in this state
 
Methods inherited from class com.silverpeas.workflow.engine.AbstractReferrableObject
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateImpl

public StateImpl()
Constructor


StateImpl

public StateImpl(String name)
Constructor

Parameters:
name - state name
Method Detail

getLabels

public ContextualDesignations getLabels()
Description copied from interface: State
Get all the labels

Specified by:
getLabels in interface State
Returns:
an object containing the collection of the labels

getLabel

public String getLabel(String role,
                       String language)
Description copied from interface: State
Get label in specific language for the given role

Specified by:
getLabel in interface State
Parameters:
role - role for which the label is
Returns:
wanted label as a String object. If label is not found, search label with given role and default language, if not found again, return the default label in given language, if not found again, return the default label in default language, if not found again, return empty string.

addLabel

public void addLabel(ContextualDesignation label)
Description copied from interface: State
Add a label Method needed primarily by Castor

Specified by:
addLabel in interface State

iterateLabel

public Iterator<ContextualDesignation> iterateLabel()
Description copied from interface: State
Iterate through the Labels

Specified by:
iterateLabel in interface State
Returns:
an iterator

getActivities

public ContextualDesignations getActivities()
Description copied from interface: State
Get all the activities

Specified by:
getActivities in interface State
Returns:
an object containing the collection of the activities

getActivity

public String getActivity(String role,
                          String language)
Description copied from interface: State
Get activity in specific language for the given role

Specified by:
getActivity in interface State
Parameters:
role - role for which the activity is
Returns:
wanted activity as a String object. If activity is not found, search activity with given role and default language, if not found again, return the default activity in given language, if not found again, return the default activity in default language, if not found again, return empty string.

addActivity

public void addActivity(ContextualDesignation label)
Description copied from interface: State
Add an activity Method needed primarily by Castor

Specified by:
addActivity in interface State

iterateActivity

public Iterator<ContextualDesignation> iterateActivity()
Description copied from interface: State
Iterate through the activities

Specified by:
iterateActivity in interface State
Returns:
an iterator

getDescriptions

public ContextualDesignations getDescriptions()
Description copied from interface: State
Get all the descriptions

Specified by:
getDescriptions in interface State
Returns:
an object containing the collection of the descriptions

getDescription

public String getDescription(String role,
                             String language)
Description copied from interface: State
Get description in specific language for the given role

Specified by:
getDescription in interface State
Parameters:
role - role for which the description is
Returns:
wanted description as a String object. If description is not found, search description with given role and default language, if not found again, return the default description in given language, if not found again, return the default description in default language, if not found again, return empty string.

addDescription

public void addDescription(ContextualDesignation description)
Description copied from interface: State
Add a description Method needed primarily by Castor

Specified by:
addDescription in interface State

iterateDescription

public Iterator<ContextualDesignation> iterateDescription()
Description copied from interface: State
Iterate through the descriptions

Specified by:
iterateDescription in interface State
Returns:
an iterator

createDesignation

public ContextualDesignation createDesignation()
Description copied from interface: State
Create an object implementing ContextualDesignation Method needed primarily by Castor

Specified by:
createDesignation in interface State

getAllowedActions

public Action[] getAllowedActions()
Get actions available in this state

Specified by:
getAllowedActions in interface State
Returns:
allowedActions allowed actions

getTimeOutActions

public TimeOutAction[] getTimeOutActions()
Get timeout actions for this state

Specified by:
getTimeOutActions in interface State
Returns:
timeout actions

getTimeOutActionsEx

public TimeOutActions getTimeOutActionsEx()
Description copied from interface: State
Get all the timeout actions

Specified by:
getTimeOutActionsEx in interface State
Returns:
an object containing the collection of the timeout actions

getAllowedActionsEx

public AllowedActions getAllowedActionsEx()
Description copied from interface: State
Get all the allowed actions

Specified by:
getAllowedActionsEx in interface State
Returns:
an object containing the collection of the allowed actions

createAllowedActions

public AllowedActions createAllowedActions()
Description copied from interface: State
Create and return an object implementing AllowedActions

Specified by:
createAllowedActions in interface State

createTimeOutActions

public TimeOutActions createTimeOutActions()
Description copied from interface: State
Create and return an object implementing TimeOutActions

Specified by:
createTimeOutActions in interface State

getFilteredActions

public Action[] getFilteredActions()
Specified by:
getFilteredActions in interface State

setFilteredActions

public void setFilteredActions(AllowedActions allowedActions)
Specified by:
setFilteredActions in interface State

getInterestedUsers

public QualifiedUsers getInterestedUsers()
Description copied from interface: State
Get all the users interested by this state

Specified by:
getInterestedUsers in interface State
Returns:
QualifiedUsers object containing interested users, or an empty QualifiedUsers object but never null

getInterestedUsersEx

public QualifiedUsers getInterestedUsersEx()
Description copied from interface: State
Get all the users interested by this state

Specified by:
getInterestedUsersEx in interface State
Returns:
QualifiedUsers object containing interested users, or null if none are defined

getName

public String getName()
Get the name of this state

Specified by:
getName in interface State
Returns:
state's name

getWorkingUsers

public QualifiedUsers getWorkingUsers()
Get the pre-conditions to enter this state

Specified by:
getWorkingUsers in interface State
Returns:
state's Preconditions object containing re-conditions

getWorkingUsersEx

public QualifiedUsers getWorkingUsersEx()
Description copied from interface: State
Get all the users who can act in this state

Specified by:
getWorkingUsersEx in interface State
Returns:
QualifiedUsers object containing theses users, or null if none are defined

setTimeOutActions

public void setTimeOutActions(TimeOutActions timeOutActions)
Description copied from interface: State
Set the timeout actions

Specified by:
setTimeOutActions in interface State

setAllowedActions

public void setAllowedActions(AllowedActions allowedActions)
Description copied from interface: State
Set the allowed actions

Specified by:
setAllowedActions in interface State

createQualifiedUsers

public QualifiedUsers createQualifiedUsers()
Description copied from interface: State
Create and return an object implementing QalifiedUsers

Specified by:
createQualifiedUsers in interface State

setInterestedUsers

public void setInterestedUsers(QualifiedUsers interestedUsers)
Set all the users interested by this state

Specified by:
setInterestedUsers in interface State
Parameters:
QualifiedUsers - object containing interested users

setName

public void setName(String name)
Description copied from interface: State
Set the name of this state

Specified by:
setName in interface State

setWorkingUsers

public void setWorkingUsers(QualifiedUsers workingUsers)
Set all the users who can act in this state

Specified by:
setWorkingUsers in interface State
Parameters:
QualifiedUsers - object containing these users

getTimeoutInterval

public int getTimeoutInterval()
Description copied from interface: State
Get the timeout interval of this state

Specified by:
getTimeoutInterval in interface State
Returns:
timeoutInterval interval in hours (as a int)

setTimeoutInterval

public void setTimeoutInterval(int hours)
Description copied from interface: State
Set the timeout interval of this state

Specified by:
setTimeoutInterval in interface State
Parameters:
hours - interval in hours (as a int)

castor_getTimeoutInterval

public String castor_getTimeoutInterval()
Get the timeout interval of this state

Returns:
timeoutInterval interval in hours (as a String)

castor_setTimeoutInterval

public void castor_setTimeoutInterval(String timeoutInterval)
Set the timeout interval of this state

Parameters:
timeoutInterval - interval in hours

getTimeoutAction

public Action getTimeoutAction()
Get the timeout action of this state Action that will played if timeout is triggered

Specified by:
getTimeoutAction in interface State
Returns:
timeout action

setTimeoutAction

public void setTimeoutAction(Action timeoutAction)
Description copied from interface: State
Set the timeout action of this state Action that will played if timeout is trigerred

Specified by:
setTimeoutAction in interface State
Parameters:
timeoutAction - timeout action

getTimeoutNotifyAdmin

public boolean getTimeoutNotifyAdmin()
Get flag for admin notification if true, the timeout manager will send a notification to all supervisors

Specified by:
getTimeoutNotifyAdmin in interface State
Returns:
admin notification flag

setTimeoutNotifyAdmin

public void setTimeoutNotifyAdmin(boolean timeoutAction)
Description copied from interface: State
Set flag for admin notification if true, the timeout manager will send a notification to all supervisors

Specified by:
setTimeoutNotifyAdmin in interface State

getKey

public String getKey()
Get the unique key, used by equals method

Specified by:
getKey in interface ReferrableObjectIntf
Specified by:
getKey in class AbstractReferrableObject
Returns:
unique key
See Also:
equals, hashCode

setId

public void setId(int id)
Implemented methods

Specified by:
setId in interface AbstractDescriptor

getId

public int getId()
Specified by:
getId in interface AbstractDescriptor

setParent

public void setParent(AbstractDescriptor parent)
Specified by:
setParent in interface AbstractDescriptor

getParent

public AbstractDescriptor getParent()
Specified by:
getParent in interface AbstractDescriptor

hasId

public boolean hasId()
Specified by:
hasId in interface AbstractDescriptor


Copyright © 2016 Silverpeas. All Rights Reserved.