Class WFState

java.lang.Object
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
Author:
Olivier Dedieu
  • Constructor Details

    • 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, String color, String wfId)
    • WFState

      public WFState(int pstatus, int duration, int targetPstatus, int reminderDuration, String color)
  • Method Details

    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • reloadI18N

      public void reloadI18N()
      Reload all I18N informations for this WFState. This includes : label and description.
      Since:
      jcms-8.0.2
    • getLabel

      public String getLabel(String lang)
      Returns a localized label.
      Parameters:
      lang - the language
      Returns:
      a localized label.
      Since:
      jcms-5.7.0
    • getLabelHtml

      public String getLabelHtml(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
    • getLabelCss

      public String getLabelCss()
      Returns the css classes for the localized label
      Returns:
      the css classes for the localized label
      Since:
      jcms-11.0.0
    • getLabelStyle

      public String getLabelStyle()
      Returns the Style for the localized label
      Returns:
      the Style for the localized label
      Since:
      jcms-11.0.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
    • 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 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
    • 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 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
    • getColor

      public String getColor()
      Returns:
      the color (or null if default color)
      Since:
      jcms-10.0.5
    • setColor

      public void setColor(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