com.jalios.jcms
Class WFState

java.lang.Object
  extended by com.jalios.jcms.WFState
All Implemented Interfaces:
Comparable

public class WFState
extends Object
implements Comparable

This class represents a state in a Workflow

Since:
jcms-2.1
Version:
$Revision: 21407 $
Author:
Olivier Dedieu

Field Summary
static String REVISION
           
 
Constructor Summary
WFState(int pstatus, Map<String,String> labelMap, Map<String,String> descriptionMap)
           
WFState(int pstatus, Map<String,String> labelMap, Map<String,String> descriptionMap, int duration, int targetPstatus, int reminderDuration)
           
 
Method Summary
 void addActionIn(WFAction action)
          Adds an incoming action (ie an action triggered when a publication comes in this state)
 void addActionOut(WFAction action)
          Adds an outgoing action (ie an action triggered when a publication leaves this state)
 void addTransition(WFState target, WFRole role)
          Adds an outgoing transition from this state
 boolean checkTransition(int targetPstatus, ObjectIntTreeMap grpVoteMap, TreeSet<Member> mbrVoteSet, Publication pub, Member mbr)
          Check if there exists at least one transition matching the given criteria and which can be performed
 Object clone()
           
 int compareTo(Object obj)
           
 WFAction getActionIn(String type)
          Get the incoming action of a given type
 Set<WFAction> getActionInSet()
           
 WFAction getActionOut(String type)
          Get the outgoing action of a given type
 Set<WFAction> getActionOutSet()
           
 String getDescription(String lang)
          Returns a localized description.
 Map<String,String> getDescriptionMap()
          Returns the map of localized description.
 int getDuration()
           
 String getLabel(String lang)
          Returns a localized label.
 Map<String,String> getLabelMap()
          Returns the map of localized label.
 int getPstatus()
          Get the value of pstatus.
 int getReminder()
          Returns the reminder duration (in seconds).
 TreeSet<WFRole> getRoleSet()
           
 int getTargetPstatus()
           
 Set<WFTransition> getTransitionSet()
           
 boolean hasReminder()
          Returns true if a reminder has been set for this state.
 boolean isActionIn(String type)
          Checks if an incoming action of a given type exists.
 boolean isActionOut(String type)
          Checks if an outgoing action of a given type exists.
 boolean isExpress()
           
 boolean isNew()
           
 boolean isSpecialState()
           
 boolean isUpdated()
           
 void performActionIn(Publication pub, boolean isReminder)
          Triggers all the incoming actions for a given publication
 void performActionOut(Publication pub)
          Triggers all the outgoing actions for a given publication
 void removeAllActions()
          Removes all the incoming and outgoind action of this state
 void removeAllTransitions()
          Removes all the transitions of this state
 void removeTransition(WFState target, WFRole role)
          Remove an outgoing transition from this state
 void setDescriptionMap(Map<String,String> descriptionMap)
          Sets the map of localized description.
 void setDuration(int duration)
           
 void setLabelMap(Map<String,String> labelMap)
          Sets the map of localized label.
 void setNew(boolean isNew)
           
 void setPstatus(int v)
          Set the value of pstatus.
 void setReminder(int reminder)
          Set the reminder.
 void setTargetPstatus(int targetPstatus)
           
 void setUpdated(boolean isUpdated)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

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

WFState

public WFState(int pstatus,
               Map<String,String> labelMap,
               Map<String,String> descriptionMap)

WFState

public WFState(int pstatus,
               Map<String,String> labelMap,
               Map<String,String> descriptionMap,
               int duration,
               int targetPstatus,
               int reminderDuration)
Method Detail

clone

public Object clone()
Overrides:
clone in class Object

getLabel

public String getLabel(String lang)
Returns a localized label.

Parameters:
lang - the language
Returns:
a localized label.
Since:
jcms-5.7.0

getDescription

public String getDescription(String lang)
Returns a localized description.

Parameters:
lang - the language
Returns:
a localized description.
Since:
jcms-5.7.0

isSpecialState

public boolean isSpecialState()
Returns:
true if this state is a special state (i.e. SCHEDULED, PUBLISHED or EXPIRED)
Since:
jcms-2.1

addTransition

public void addTransition(WFState target,
                          WFRole role)
Adds an outgoing transition from this state

Parameters:
target - the target state
role - the role that can perform this transition
Since:
jcms-4.0.2

removeTransition

public void removeTransition(WFState target,
                             WFRole role)
Remove an outgoing transition from this state

Parameters:
target - the target state
role - the role that can perform this transition
Since:
jcms-5.5.0

getTransitionSet

public Set<WFTransition> getTransitionSet()
Returns:
the set of outgoing transition from this state
Since:
jcms-2.1

removeAllTransitions

public void removeAllTransitions()
Removes all the transitions of this state

Since:
jcms-2.1

checkTransition

public boolean checkTransition(int targetPstatus,
                               ObjectIntTreeMap grpVoteMap,
                               TreeSet<Member> mbrVoteSet,
                               Publication pub,
                               Member mbr)
Check if there exists at least one transition matching the given criteria and which can be performed

Parameters:
targetPstatus - the target pstatus
grpVoteMap - the group vote map
mbrVoteSet - the member vote set
pub - the publication
mbr - the member who performs this transition
Returns:
true if the transition exists
Since:
jcms-5.5.0

getRoleSet

public TreeSet<WFRole> getRoleSet()
Returns:
the set of role bound to this state
Since:
jcms-5.5.0

addActionIn

public void addActionIn(WFAction action)
Adds an incoming action (ie an action triggered when a publication comes in this state)

Parameters:
action - the incomming action
Since:
jcms-2.1

getActionInSet

public Set<WFAction> getActionInSet()
Returns:
the set of incoming actions
Since:
jcms-2.1

addActionOut

public void addActionOut(WFAction action)
Adds an outgoing action (ie an action triggered when a publication leaves this state)

Parameters:
action - the outgoing action
Since:
jcms-2.1

getActionOutSet

public Set<WFAction> getActionOutSet()
Returns:
the set of outgoing actions
Since:
jcms-2.1

removeAllActions

public void removeAllActions()
Removes all the incoming and outgoind action of this state

Since:
jcms-2.1

performActionIn

public void performActionIn(Publication pub,
                            boolean isReminder)
Triggers all the incoming actions for a given publication

Parameters:
pub - the publication that triggers the alarm
isReminder - indicates if this is a reminder
Since:
jcms-2.1

performActionOut

public void performActionOut(Publication pub)
Triggers all the outgoing actions for a given publication

Parameters:
pub - the publication that triggers the alarm
Since:
jcms-2.1

getActionIn

public WFAction getActionIn(String type)
Get the incoming action of a given type

Parameters:
type - the action type
Returns:
the action looked for.
Since:
jcms-2.1

getActionOut

public WFAction getActionOut(String type)
Get the outgoing action of a given type

Parameters:
type - the action type
Returns:
the action looked for.
Since:
jcms-2.1

isActionIn

public boolean isActionIn(String type)
Checks if an incoming action of a given type exists.

Parameters:
type - the action type
Returns:
true if the action exists.
Since:
jcms-2.1

isActionOut

public boolean isActionOut(String type)
Checks if an outgoing action of a given type exists.

Parameters:
type - the action type
Returns:
true if the action exists.
Since:
jcms-2.1

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Object obj)
Specified by:
compareTo in interface Comparable

getLabelMap

public Map<String,String> getLabelMap()
Returns the map of localized label.

Returns:
the map of localized label.
Since:
jcms-5.7.0

setLabelMap

public void setLabelMap(Map<String,String> labelMap)
Sets the map of localized label.

Parameters:
labelMap - the map of localized label.
Since:
jcms-5.7.0

getPstatus

public int getPstatus()
Get the value of pstatus.

Returns:
Value of pstatus.
Since:
jcms-2.1

setPstatus

public void setPstatus(int v)
Set the value of pstatus.

Parameters:
v - Value to assign to pstatus.
Since:
jcms-2.1

getDescriptionMap

public Map<String,String> getDescriptionMap()
Returns the map of localized description.

Returns:
the map of localized description.
Since:
jcms-5.7.0

setDescriptionMap

public void setDescriptionMap(Map<String,String> descriptionMap)
Sets the map of localized description.

Parameters:
descriptionMap - the map of localized description.
Since:
jcms-5.7.0

isExpress

public boolean isExpress()
Returns:
true if this State has a WorkFlow Express
Since:
jcms-4.0.2

setDuration

public void setDuration(int duration)
Parameters:
duration - define the duration in minute of the Workflow Express (in minutes)
Since:
jcms-4.0.2

getDuration

public int getDuration()
Returns:
the duration in minutes of the workflow Express (in minutes)
Since:
jcms-4.0.2

setTargetPstatus

public void setTargetPstatus(int targetPstatus)
Parameters:
targetPstatus - the target Pstatus value
Since:
jcms-4.0.2

getTargetPstatus

public int getTargetPstatus()
Returns:
the target Pstatus value
Since:
jcms-4.0.2

getReminder

public int getReminder()
Returns the reminder duration (in seconds).

Returns:
the reminder duration (in seconds).
Since:
jcms-5.5.0

setReminder

public void setReminder(int reminder)
Set the reminder.

Parameters:
reminder - the reminder duration (in seconds).
Since:
jcms-5.5.0

hasReminder

public boolean hasReminder()
Returns true if a reminder has been set for this state.

Returns:
true if a reminder has been set for this state.
Since:
jcms-5.5.0

isNew

public boolean isNew()
Returns:
Returns the isNew.
Since:
jcms-5.5.0

setNew

public void setNew(boolean isNew)
Parameters:
isNew - The isNew to set.
Since:
jcms-5.5.0

isUpdated

public boolean isUpdated()
Returns:
Returns the isUpdated.
Since:
jcms-5.5.0

setUpdated

public void setUpdated(boolean isUpdated)
Parameters:
isUpdated - The isUpdated to set.
Since:
jcms-5.5.0


Copyright © 2001-2007 Jalios SA. All Rights Reserved.