com.silverpeas.workflow.engine.model
Class ConsequenceImpl

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

public class ConsequenceImpl
extends AbstractReferrableObject
implements Consequence, AbstractDescriptor, Serializable

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

See Also:
Serialized Form

Constructor Summary
ConsequenceImpl()
          Constructor
 
Method Summary
 void addNotifiedUsers(QualifiedUsers notifyUsers)
          Add a new notifiedUser to the collection
 void addTargetState(StateSetter stateSetter)
          Add a new Target State to the collection
 void addUnsetState(StateSetter stateSetter)
          Add a new Unset State to the collection
 QualifiedUsers createQualifiedUsers()
          Create and return an object implementing QalifiedUsers
 StateSetter createStateSetter()
          Create a new state Setter object
 Triggers createTriggers()
           
 int getId()
           
 String getItem()
          Get the item on which the comparison will be processed
 String getKey()
          This method has to be implemented by the referrable object it has to compute the unique key
 boolean getKill()
          Get the flag that specifies if instance has to be removed
 List<QualifiedUsers> getNotifiedUsers()
          Get all the users that have to be notified
 String getOperator()
          Get the operator used to compare item and value
 AbstractDescriptor getParent()
           
 int getStep()
           
 State getTargetState(String strStateName)
          Get the target state with the given state name
 State[] getTargetStates()
          Get the target states
 Triggers getTriggers()
           
 State getUnsetState(String strStateName)
          Get the state to un-set with the given state name
 State[] getUnsetStates()
          Get the states to unset
 String getValue()
          Get the value to compare with item
 boolean hasId()
           
 boolean isVerified(String itemValue)
          Check if the consequence is verified or not
 Iterator<QualifiedUsers> iterateNotifiedUsers()
           
 Iterator<StateSetter> iterateTargetState()
          Iterate through Target States.
 Iterator<StateSetter> iterateUnsetState()
          Iterate through Unset States.
 void setId(int id)
          *********** Implemented methods ****************************************
 void setItem(String string)
          Set the item on which the comparison will be processed
 void setKill(boolean kill)
          Set the flag that specifies if instance has to be removed
 void setNotifiedUsers(List<QualifiedUsers> notifiedUsersList)
          Set all the users that have to be notified
 void setOperator(String string)
          Set the operator used to compare item and value
 void setParent(AbstractDescriptor parent)
           
 void setStep(int id)
           
 void setTriggers(Triggers triggers)
           
 void setValue(String string)
          Set the value to compare with item
 
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

ConsequenceImpl

public ConsequenceImpl()
Constructor

Method Detail

getTargetState

public State getTargetState(String strStateName)
Description copied from interface: Consequence
Get the target state with the given state name

Specified by:
getTargetState in interface Consequence
Parameters:
strStateName - the name of the state
Returns:
the target state or null if not found

getTargetStates

public State[] getTargetStates()
Get the target states

Specified by:
getTargetStates in interface Consequence
Returns:
the target states as a Vector

addTargetState

public void addTargetState(StateSetter stateSetter)
Description copied from interface: Consequence
Add a new Target State to the collection

Specified by:
addTargetState in interface Consequence
Parameters:
stateSetter - object to be added

createStateSetter

public StateSetter createStateSetter()
Description copied from interface: Consequence
Create a new state Setter object

Specified by:
createStateSetter in interface Consequence
Returns:
a StateSetter object

iterateTargetState

public Iterator<StateSetter> iterateTargetState()
Description copied from interface: Consequence
Iterate through Target States.

Specified by:
iterateTargetState in interface Consequence
Returns:
an Iterator

iterateNotifiedUsers

public Iterator<QualifiedUsers> iterateNotifiedUsers()

getUnsetState

public State getUnsetState(String strStateName)
Description copied from interface: Consequence
Get the state to un-set with the given state name

Specified by:
getUnsetState in interface Consequence
Parameters:
strStateName - the name of the state
Returns:
the state to un-set or null if not found

getUnsetStates

public State[] getUnsetStates()
Get the states to unset

Specified by:
getUnsetStates in interface Consequence
Returns:
the states to unset as a Vector

addUnsetState

public void addUnsetState(StateSetter stateSetter)
Description copied from interface: Consequence
Add a new Unset State to the collection

Specified by:
addUnsetState in interface Consequence
Parameters:
stateSetter - object to be added

iterateUnsetState

public Iterator<StateSetter> iterateUnsetState()
Description copied from interface: Consequence
Iterate through Unset States.

Specified by:
iterateUnsetState in interface Consequence
Returns:
an Iterator

getKill

public boolean getKill()
Get the flag that specifies if instance has to be removed

Specified by:
getKill in interface Consequence
Returns:
true if instance has to be removed

setKill

public void setKill(boolean kill)
Set the flag that specifies if instance has to be removed

Specified by:
setKill in interface Consequence
Parameters:
kill - true if instance has to be removed

getNotifiedUsers

public List<QualifiedUsers> getNotifiedUsers()
Get all the users that have to be notified

Specified by:
getNotifiedUsers in interface Consequence
Returns:
QualifiedUsers object containing notified users

setNotifiedUsers

public void setNotifiedUsers(List<QualifiedUsers> notifiedUsersList)
Set all the users that have to be notified

Specified by:
setNotifiedUsers in interface Consequence
Parameters:
QualifiedUsers - object containing notified users

createQualifiedUsers

public QualifiedUsers createQualifiedUsers()
Create and return an object implementing QalifiedUsers


getItem

public String getItem()
Description copied from interface: Consequence
Get the item on which the comparison will be processed

Specified by:
getItem in interface Consequence
Returns:
the item name

getOperator

public String getOperator()
Description copied from interface: Consequence
Get the operator used to compare item and value

Specified by:
getOperator in interface Consequence
Returns:
an operator (ie : =, >, >=, <, <=, !=)

getValue

public String getValue()
Description copied from interface: Consequence
Get the value to compare with item

Specified by:
getValue in interface Consequence
Returns:
the value

isVerified

public boolean isVerified(String itemValue)
Check if the consequence is verified or not

Specified by:
isVerified in interface Consequence
Parameters:
itemValue - - the value of the folder item (specified in xml attribute 'item'
Returns:
true if the consequence is verified

setItem

public void setItem(String string)
Description copied from interface: Consequence
Set the item on which the comparison will be processed

Specified by:
setItem in interface Consequence

setOperator

public void setOperator(String string)
Description copied from interface: Consequence
Set the operator used to compare item and value

Specified by:
setOperator in interface Consequence

setValue

public void setValue(String string)
Description copied from interface: Consequence
Set the value to compare with item

Specified by:
setValue in interface Consequence

setStep

public void setStep(int id)

getStep

public int getStep()

createTriggers

public Triggers createTriggers()
Specified by:
createTriggers in interface Consequence

getTriggers

public Triggers getTriggers()
Specified by:
getTriggers in interface Consequence

setTriggers

public void setTriggers(Triggers triggers)

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

getKey

public String getKey()
Description copied from class: AbstractReferrableObject
This method has to be implemented by the referrable object it has to compute the unique key

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

addNotifiedUsers

public void addNotifiedUsers(QualifiedUsers notifyUsers)
Description copied from interface: Consequence
Add a new notifiedUser to the collection

Specified by:
addNotifiedUsers in interface Consequence


Copyright © 2016 Silverpeas. All Rights Reserved.