Package com.jalios.jcms
Class WFState
java.lang.Object
com.jalios.jcms.WFState
- All Implemented Interfaces:
Comparable
This class represents a state in a Workflow
- Since:
- jcms-2.1
- Author:
- Olivier Dedieu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionIn(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, TreeSet<Member> mbrVoteSet, Publication pub, Member mbr) Check if there exists at least one transition matching the given criteria and which can be performedclone()intgetActionIn(String type) Get the incoming action of a given typegetActionOut(String type) Get the outgoing action of a given typegetColor()getDescription(String lang) Returns a localized description.Returns the map of localized description.intReturns a localized label.Returns the css classes for the localized labelgetLabelHtml(String lang) Returns the HTML code for the localized labelReturns the map of localized label.Returns the Style for the localized labelintGet the value of pstatus.intReturns the reminder duration (in seconds).intbooleanhasOpenRole(Workspace ws) booleanReturns true if a reminder has been set for this state.booleanisActionIn(String type) Checks if an incoming action of a given type exists.booleanisActionOut(String type) Checks if an outgoing action of a given type exists.booleanbooleanisNew()booleanbooleanbooleanReturns true if publications in this state are visible in front-office.voidperformActionIn(Publication pub, boolean isReminder) Triggers all the incoming actions for a given publicationvoidTriggers all the outgoing actions for a given publicationvoidReload all I18N informations for this WFState.voidRemoves all the incoming and outgoind action of this statevoidRemoves all the transitions of this statevoidremoveTransition(WFState target, WFRole role) Remove an outgoing transition from this statevoidSet the color.voidsetDescriptionMap(Map<String, String> descriptionMap) Sets the map of localized description.voidsetDuration(int duration) voidsetLabelMap(Map<String, 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) toString()
-
Constructor Details
-
WFState
-
WFState
-
WFState
-
-
Method Details
-
clone
-
reloadI18N
public void reloadI18N()Reload all I18N informations for this WFState. This includes : label and description.- Since:
- jcms-8.0.2
-
getLabel
Returns a localized label.- Parameters:
lang- the language- Returns:
- a localized label.
- Since:
- jcms-5.7.0
-
getLabelHtml
Returns the HTML code for the localized label- Parameters:
lang- the language- Returns:
- an HTML code for the label
- Since:
- jcms-7.0.0
-
getLabelCss
Returns the css classes for the localized label- Returns:
- the css classes for the localized label
- Since:
- jcms-11.0.0
-
getLabelStyle
Returns the Style for the localized label- Returns:
- the Style for the localized label
- Since:
- jcms-11.0.0
-
getDescription
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
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
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
- 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 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
- Returns:
- the set of role bound to this state
- Since:
- jcms-5.5.0
-
hasOpenRole
- 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
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
- Returns:
- the set of incoming actions
- Since:
- jcms-2.1
-
addActionOut
Adds an outgoing action (ie an action triggered when a publication leaves this state)- Parameters:
action- the outgoing action- Since:
- jcms-2.1
-
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
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
Triggers all the outgoing actions for a given publication- Parameters:
pub- the publication that triggers the alarm- Since:
- jcms-2.1
-
getActionIn
Get the incoming action of a given type- Parameters:
type- the action type- Returns:
- the action looked for.
- Since:
- jcms-2.1
-
getActionOut
Get the outgoing action of a given type- Parameters:
type- the action type- Returns:
- the action looked for.
- Since:
- jcms-2.1
-
isActionIn
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
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
-
compareTo
- Specified by:
compareToin interfaceComparable
-
getLabelMap
Returns the map of localized label.- Returns:
- the map of localized label.
- Since:
- jcms-5.7.0
-
setLabelMap
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
Returns the map of localized description.- Returns:
- the map of localized description.
- Since:
- jcms-5.7.0
-
setDescriptionMap
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
- Returns:
- the color (or null if default color)
- Since:
- jcms-10.0.5
-
setColor
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
-