Package com.jalios.jcms
Class WFState
- java.lang.Object
-
- com.jalios.jcms.WFState
-
- All Implemented Interfaces:
java.lang.Comparable
public class WFState extends java.lang.Object implements java.lang.ComparableThis class represents a state in a Workflow- Since:
- jcms-2.1
- Author:
- Olivier Dedieu
-
-
Constructor Summary
Constructors Constructor Description WFState(int pstatus, int duration, int targetPstatus, int reminderDuration, java.lang.String color)WFState(int pstatus, java.util.Map<java.lang.String,java.lang.String> labelMap, java.util.Map<java.lang.String,java.lang.String> descriptionMap)WFState(int pstatus, java.util.Map<java.lang.String,java.lang.String> labelMap, java.util.Map<java.lang.String,java.lang.String> descriptionMap, int duration, int targetPstatus, int reminderDuration, java.lang.String color, java.lang.String wfId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionIn(WFAction action)Adds an incoming action (ie an action triggered when a publication comes in this state)voidaddActionOut(WFAction action)Adds an outgoing action (ie an action triggered when a publication leaves this state)voidaddTransition(WFState target, WFRole role)Adds an outgoing transition from this statebooleancheckTransition(int targetPstatus, ObjectIntTreeMap grpVoteMap, java.util.TreeSet<Member> mbrVoteSet, Publication pub, Member mbr)Check if there exists at least one transition matching the given criteria and which can be performedjava.lang.Objectclone()intcompareTo(java.lang.Object obj)WFActiongetActionIn(java.lang.String type)Get the incoming action of a given typejava.util.Set<WFAction>getActionInSet()WFActiongetActionOut(java.lang.String type)Get the outgoing action of a given typejava.util.Set<WFAction>getActionOutSet()java.lang.StringgetColor()java.lang.StringgetDescription(java.lang.String lang)Returns a localized description.java.util.Map<java.lang.String,java.lang.String>getDescriptionMap()Returns the map of localized description.intgetDuration()java.lang.StringgetLabel(java.lang.String lang)Returns a localized label.java.lang.StringgetLabelHtml(java.lang.String lang)Returns the HTML code for the localized labeljava.util.Map<java.lang.String,java.lang.String>getLabelMap()Returns the map of localized label.intgetPstatus()Get the value of pstatus.intgetReminder()Returns the reminder duration (in seconds).java.util.TreeSet<WFRole>getRoleSet()intgetTargetPstatus()java.util.Set<WFTransition>getTransitionSet()booleanhasOpenRole(Workspace ws)booleanhasReminder()Returns true if a reminder has been set for this state.booleanisActionIn(java.lang.String type)Checks if an incoming action of a given type exists.booleanisActionOut(java.lang.String type)Checks if an outgoing action of a given type exists.booleanisExpress()booleanisNew()booleanisSpecialState()booleanisUpdated()booleanisVisible()Returns true if publications in this state are visible in front-office.voidperformActionIn(Publication pub, boolean isReminder)Triggers all the incoming actions for a given publicationvoidperformActionOut(Publication pub)Triggers all the outgoing actions for a given publicationvoidreloadI18N()Reload all I18N informations for this WFState.voidremoveAllActions()Removes all the incoming and outgoind action of this statevoidremoveAllTransitions()Removes all the transitions of this statevoidremoveTransition(WFState target, WFRole role)Remove an outgoing transition from this statevoidsetColor(java.lang.String color)Set the color.voidsetDescriptionMap(java.util.Map<java.lang.String,java.lang.String> descriptionMap)Sets the map of localized description.voidsetDuration(int duration)voidsetLabelMap(java.util.Map<java.lang.String,java.lang.String> labelMap)Sets the map of localized label.voidsetNew(boolean isNew)voidsetPstatus(int v)Set the value of pstatus.voidsetReminder(int reminder)Set the reminder.voidsetTargetPstatus(int targetPstatus)voidsetUpdated(boolean isUpdated)java.lang.StringtoString()
-
-
-
Constructor Detail
-
WFState
public WFState(int pstatus, java.util.Map<java.lang.String,java.lang.String> labelMap, java.util.Map<java.lang.String,java.lang.String> descriptionMap)
-
WFState
public WFState(int pstatus, java.util.Map<java.lang.String,java.lang.String> labelMap, java.util.Map<java.lang.String,java.lang.String> descriptionMap, int duration, int targetPstatus, int reminderDuration, java.lang.String color, java.lang.String wfId)
-
WFState
public WFState(int pstatus, int duration, int targetPstatus, int reminderDuration, java.lang.String color)
-
-
Method Detail
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
reloadI18N
public void reloadI18N()
Reload all I18N informations for this WFState. This includes : label and description.- Since:
- jcms-8.0.2
-
getLabel
public java.lang.String getLabel(java.lang.String lang)
Returns a localized label.- Parameters:
lang- the language- Returns:
- a localized label.
- Since:
- jcms-5.7.0
-
getLabelHtml
public java.lang.String getLabelHtml(java.lang.String lang)
Returns the HTML code for the localized label- Parameters:
lang- the language- Returns:
- an HTML code for the label
- Since:
- jcms-7.0.0
-
getDescription
public java.lang.String getDescription(java.lang.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 staterole- 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 staterole- the role that can perform this transition- Since:
- jcms-5.5.0
-
getTransitionSet
public java.util.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, java.util.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 pstatusgrpVoteMap- the group vote mapmbrVoteSet- the member vote setpub- the publicationmbr- the member who performs this transition- Returns:
- true if the transition exists
- Since:
- jcms-5.5.0
-
getRoleSet
public java.util.TreeSet<WFRole> getRoleSet()
- Returns:
- the set of role bound to this state
- Since:
- jcms-5.5.0
-
hasOpenRole
public boolean hasOpenRole(Workspace ws)
- Parameters:
ws- the current workspace- Returns:
- true if there is at least one open role in the role set for this workspace
- Since:
- jcms-6.1.2
-
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 java.util.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 java.util.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 alarmisReminder- 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(java.lang.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(java.lang.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(java.lang.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(java.lang.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
-
isVisible
public boolean isVisible()
Returns true if publications in this state are visible in front-office.- Returns:
- true if publications in this state are visible in front-office.
- Since:
- jcms-9.0.0
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object obj)
- Specified by:
compareToin interfacejava.lang.Comparable
-
getLabelMap
public java.util.Map<java.lang.String,java.lang.String> getLabelMap()
Returns the map of localized label.- Returns:
- the map of localized label.
- Since:
- jcms-5.7.0
-
setLabelMap
public void setLabelMap(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.String> getDescriptionMap()
Returns the map of localized description.- Returns:
- the map of localized description.
- Since:
- jcms-5.7.0
-
setDescriptionMap
public void setDescriptionMap(java.util.Map<java.lang.String,java.lang.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
-
getColor
public java.lang.String getColor()
- Returns:
- the color (or null if default color)
- Since:
- jcms-10.0.5
-
setColor
public void setColor(java.lang.String color)
Set the color.- Parameters:
color- the color- Since:
- jcms-10.0.5
-
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
-
-