Class ProcessInstanceImpl
- java.lang.Object
-
- org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity<E,I>
-
- org.silverpeas.core.persistence.datasource.model.jpa.BasicJpaEntity<ProcessInstanceImpl,UniqueIntegerIdentifier>
-
- org.silverpeas.core.workflow.engine.instance.ProcessInstanceImpl
-
- All Implemented Interfaces:
Serializable
,IdentifiableEntity
,ProcessInstance
,UpdatableProcessInstance
@Entity public class ProcessInstanceImpl extends BasicJpaEntity<ProcessInstanceImpl,UniqueIntegerIdentifier> implements UpdatableProcessInstance
This class is one implementation of interface UpdatableProcessInstance.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProcessInstanceImpl()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addActiveState(State state)
Adds the specified state as an active one in this process instance.void
addActiveState(ActiveState activeState)
Add active state to the process instancevoid
addHistoryStep(HistoryStep step)
Add a step in the history of actions performed in this process instance.void
addInterestedUser(Actor actor, State state)
void
addInterestedUser(User user, State state, String role)
Add an user in the interested user listState
addQuestion(String content, String stepId, State fromState, User fromUser)
Add a questionvoid
addQuestion(Question question)
Add a question to this instancevoid
addTimeout(State state)
Adds a timeout to the specified active state.void
addWorkingUser(Actor actor, State state)
Adds the specified actor to the given state.void
addWorkingUser(User user, State state, String role)
Adds the specified working user to the given state with the specified role.State
answerQuestion(String content, String questionId)
Answer a questionvoid
cancelQuestion(Question question)
Cancel a question without responsevoid
computeValid()
boolean
equals(Object obj)
DataRecord
getActionRecord(String actionName)
Gets the data that were provided to the specified action when it was was performed.String[]
getActiveStates()
Gets all the active states of this process instance.Actor[]
getActors(QualifiedUsers qualifiedUsers, State state)
Computes tuples role/user (stored in an Actor object) from a QualifiedUsers objectString[]
getAllAssignedStates(User user)
Gets all the states that are assigned to the specified user.DataRecord
getAllDataRecord(String role, String lang)
String[]
getAssignedStates(User user, String roleName)
Gets all the states that are assigned to the specified user with given role.HistoryStep[]
getBackSteps(User user, String roleName, String stateName)
Get all the steps where given user (with given role) can go back from the given stateboolean
getErrorStatus()
Is this process instance in error by an action?Field
getField(String fieldName)
Gets the specified field.DataRecord
getFolder()
Gets the folder of this process instance.DataRecord
getFormRecord(String formName, String role, String lang)
Gets the data record of the specified form for the given role and written in the specified language.HistoryStep
getHistoryStep(String stepId)
Gets the step with the specified identifier in the history of this process instance.HistoryStep[]
getHistorySteps()
Gets the different steps in the history of this process instance.String
getInstanceId()
Get the workflow instance idLockingUser
getLockingUser(String state)
Gets the user that has locked the specified state.String
getModelId()
Get the workflow model idHistoryStep
getMostRecentStep(String actionName)
Recent the most recent step where the named action has been performed.DataRecord
getNewActionRecord(String actionName, String language)
Gets a new data record associated with the given action.Participant
getParticipant(String resolvedState)
Get the last user who resolved the given stateList<Participant>
getParticipants()
Gets all the participants in this process instance.Question[]
getPendingQuestions(String stateName)
Get all the questions asked in the given stateProcessModel
getProcessModel()
Gets the model of the process from which it was spawned.Question[]
getQuestions()
Get all the questions asked in this processInstanceQuestion[]
getRelevantQuestions(String stateName)
Get all the questions asked from the given state and that have been answeredDataRecord
getRowDataRecord(String role, String lang)
Gets a data record which will be used to render this process instance as a row in a list of process instances.HistoryStep
getSavedStep(String userId)
Get step saved by given user id.Question[]
getSentQuestions(String stateName)
Get all the questions asked from the given stateActionAndState
getTimeOutAction(Date dateRef)
Gets the timeout action to be launched after the given datetime.boolean
getTimeoutStatus()
Gets the timeout status of this instanceString
getTitle(String role, String lang)
Returns this instance title.List<User>
getUsersInGroup(String groupId)
Gets concrete users affected to given group at runtimeList<User>
getUsersInRole(String role)
Gets concrete users affected to given role at runtimeActor[]
getWorkingUsers()
Gets all the users working on this process instance.Actor[]
getWorkingUsers(String state)
Gets all the users working on the specified state of this instance state.Actor[]
getWorkingUsers(String state, String role)
Gets all the users working on the specified state of this instance state with the given role.int
hashCode()
boolean
isLockedByAdmin()
Is this process instance has been locked by the supervisor?boolean
isStateInBackStatus(String stateName)
Test is a active state is in back statusboolean
isValid()
Is this process instance valid?void
lock()
Lock this instance by admin for all statesvoid
lock(State state, User user)
Locks this instance for the given instance and statevoid
reDoState(String state, Date actionDate)
Cancel all the atomic operations since the step where first action had occurredvoid
removeActiveState(State state)
Removes the specified state as an active one.void
removeInterestedUser(User user, State state, String role)
Remove an user from the interested user listvoid
removeInterestedUsers(State state)
Remove all interested users for given statevoid
removeTimeout(State state)
Removes the timeout from the specified active state.void
removeWorkingUser(User user, State state, String role)
Removes the specified user from the working users of the specified state and with the given role.void
removeWorkingUsers(State state)
Remove all working users for given statevoid
saveActionRecord(HistoryStep step, DataRecord actionData)
Save a new version of given form (including values)void
setErrorStatus(boolean errorStatus)
Set the error status of this instancevoid
setField(String fieldName, Field copiedField)
Sets the specified field in the process instance.void
setInstanceId(String instanceId)
Set the workflow instance idvoid
setLockedByAdmin(boolean locked)
Set the lock Admin status of this instancevoid
setModelId(String modelId)
Set the workflow model idvoid
setTimeoutStatus(boolean timeoutStatus)
Set the timeout status of this instancevoid
unLock()
Lock this instance by admin for all statesvoid
unLock(State state, User user)
Un-locks this instance for the given instance and statevoid
updateFolder(DataRecord actionData)
Updates the folder of this process instance with the specified one.void
updateHistoryStep(HistoryStep step)
Update the related history step by the given one.-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.BasicJpaEntity
performBeforePersist, performBeforeRemove, performBeforeUpdate
-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity
getId, getNativeId, isPersisted, setId
-
-
-
-
Method Detail
-
getInstanceId
public String getInstanceId()
Description copied from interface:ProcessInstance
Get the workflow instance id- Specified by:
getInstanceId
in interfaceProcessInstance
- Returns:
- instance id
-
setInstanceId
public void setInstanceId(String instanceId)
Description copied from interface:UpdatableProcessInstance
Set the workflow instance id- Specified by:
setInstanceId
in interfaceUpdatableProcessInstance
- Parameters:
instanceId
- instance id
-
getModelId
public String getModelId()
Description copied from interface:ProcessInstance
Get the workflow model id- Specified by:
getModelId
in interfaceProcessInstance
- Returns:
- model id
-
setModelId
public void setModelId(String modelId)
Description copied from interface:UpdatableProcessInstance
Set the workflow model id- Specified by:
setModelId
in interfaceUpdatableProcessInstance
- Parameters:
modelId
- model id
-
addHistoryStep
public void addHistoryStep(HistoryStep step)
Description copied from interface:UpdatableProcessInstance
Add a step in the history of actions performed in this process instance.- Specified by:
addHistoryStep
in interfaceUpdatableProcessInstance
- Parameters:
step
- a step in the workflow process history.
-
updateHistoryStep
public void updateHistoryStep(HistoryStep step)
Description copied from interface:UpdatableProcessInstance
Update the related history step by the given one.- Specified by:
updateHistoryStep
in interfaceUpdatableProcessInstance
- Parameters:
step
- a step in the workflow process history.
-
addActiveState
public void addActiveState(State state)
Description copied from interface:UpdatableProcessInstance
Adds the specified state as an active one in this process instance. An active state is the current state of the process instance; that is to say a state that is currently waiting for actions by working users. A process instance can have several active states in parallel.- Specified by:
addActiveState
in interfaceUpdatableProcessInstance
- Parameters:
state
- the active state.
-
removeActiveState
public void removeActiveState(State state)
Description copied from interface:UpdatableProcessInstance
Removes the specified state as an active one. An active state is the current state of the process instance; that is to say a state that is currently waiting for actions by working users. A process instance can have several active states in parallel.- Specified by:
removeActiveState
in interfaceUpdatableProcessInstance
- Parameters:
state
- the active state.
-
addTimeout
public void addTimeout(State state)
Description copied from interface:UpdatableProcessInstance
Adds a timeout to the specified active state. A timeout is a way to avoid a long time state. The time out is defined by aTimeOutAction
provided by the specified state.- Specified by:
addTimeout
in interfaceUpdatableProcessInstance
- Parameters:
state
- the state for which a time out has to be added.
-
removeTimeout
public void removeTimeout(State state)
Description copied from interface:UpdatableProcessInstance
Removes the timeout from the specified active state. A timeout is a way to avoid a long time state.- Specified by:
removeTimeout
in interfaceUpdatableProcessInstance
- Parameters:
state
- the state for which a time out has to be removed.
-
addWorkingUser
public void addWorkingUser(User user, State state, String role)
Description copied from interface:UpdatableProcessInstance
Adds the specified working user to the given state with the specified role.- Specified by:
addWorkingUser
in interfaceUpdatableProcessInstance
- Parameters:
user
- the working user to addstate
- the state on which the user will workrole
- the role the user will play in the above state
-
addWorkingUser
public void addWorkingUser(Actor actor, State state)
Description copied from interface:UpdatableProcessInstance
Adds the specified actor to the given state.- Specified by:
addWorkingUser
in interfaceUpdatableProcessInstance
- Parameters:
actor
- the actor to addstate
- the state for which the actor has to be defined
-
removeWorkingUser
public void removeWorkingUser(User user, State state, String role)
Description copied from interface:UpdatableProcessInstance
Removes the specified user from the working users of the specified state and with the given role.- Specified by:
removeWorkingUser
in interfaceUpdatableProcessInstance
- Parameters:
user
- the user to remove.state
- the state from which the user has to be removedrole
- the role the user plays in the above state
-
addInterestedUser
public void addInterestedUser(User user, State state, String role)
Description copied from interface:UpdatableProcessInstance
Add an user in the interested user list- Specified by:
addInterestedUser
in interfaceUpdatableProcessInstance
- Parameters:
user
- user to addstate
- state for which the user is interestedrole
- role name under which the user is interested
-
addInterestedUser
public void addInterestedUser(Actor actor, State state)
- Specified by:
addInterestedUser
in interfaceUpdatableProcessInstance
-
removeInterestedUser
public void removeInterestedUser(User user, State state, String role)
Description copied from interface:UpdatableProcessInstance
Remove an user from the interested user list- Specified by:
removeInterestedUser
in interfaceUpdatableProcessInstance
- Parameters:
user
- user to removestate
- state for which the user is interestedrole
- role name under which the user is interested
-
addQuestion
public void addQuestion(Question question)
Add a question to this instance- Parameters:
question
- the question to add
-
computeValid
public void computeValid()
- Specified by:
computeValid
in interfaceUpdatableProcessInstance
-
getProcessModel
public ProcessModel getProcessModel() throws WorkflowException
Description copied from interface:ProcessInstance
Gets the model of the process from which it was spawned.- Specified by:
getProcessModel
in interfaceProcessInstance
- Returns:
- the
ProcessModel
of this process instance. - Throws:
WorkflowException
-
getHistorySteps
public HistoryStep[] getHistorySteps()
Description copied from interface:ProcessInstance
Gets the different steps in the history of this process instance. A history step defines the change of a state by an action performed by a given working user.- Specified by:
getHistorySteps
in interfaceProcessInstance
- Returns:
- an array of
HistoryStep
objects.
-
getHistoryStep
public HistoryStep getHistoryStep(String stepId) throws WorkflowException
Description copied from interface:ProcessInstance
Gets the step with the specified identifier in the history of this process instance.- Specified by:
getHistoryStep
in interfaceProcessInstance
- Parameters:
stepId
- the unique identifier of a history step.- Returns:
- the asked history step.
- Throws:
WorkflowException
- if no such history step can be found.
-
getParticipants
public List<Participant> getParticipants() throws WorkflowException
Description copied from interface:ProcessInstance
Gets all the participants in this process instance.- Specified by:
getParticipants
in interfaceProcessInstance
- Returns:
- the list of participants in this process instance.
- Throws:
WorkflowException
- if an error occurs.
-
getParticipant
public Participant getParticipant(String resolvedState) throws WorkflowException
Description copied from interface:ProcessInstance
Get the last user who resolved the given state- Specified by:
getParticipant
in interfaceProcessInstance
- Parameters:
resolvedState
- the resolved state- Returns:
- the user as a
Participant
object - Throws:
WorkflowException
- if an error occurs.
-
getFolder
public DataRecord getFolder() throws WorkflowException
Description copied from interface:ProcessInstance
Gets the folder of this process instance.- Specified by:
getFolder
in interfaceProcessInstance
- Returns:
- the folder as a
DataRecord
object. - Throws:
WorkflowException
- if an error occurs.
-
getAllDataRecord
public DataRecord getAllDataRecord(String role, String lang) throws WorkflowException
- Specified by:
getAllDataRecord
in interfaceProcessInstance
- Parameters:
role
- a role a user can play in this process instance.lang
- the ISO-631 code of a language in which data have to be.- Returns:
- a record with all the data.
- Throws:
WorkflowException
- if an error occurs.
-
getRowDataRecord
public DataRecord getRowDataRecord(String role, String lang) throws WorkflowException
Description copied from interface:ProcessInstance
Gets a data record which will be used to render this process instance as a row in a list of process instances. The information set in the record are filtered by what is allowed to be rendered for the given role.- Specified by:
getRowDataRecord
in interfaceProcessInstance
- Parameters:
role
- a role a user can play in this process instance.lang
- the ISO-631 code of the language in which data have to be.- Throws:
WorkflowException
- if an error occurs.
-
updateFolder
public void updateFolder(DataRecord actionData) throws WorkflowException
Description copied from interface:ProcessInstance
Updates the folder of this process instance with the specified one.- Specified by:
updateFolder
in interfaceProcessInstance
- Parameters:
actionData
- the data record with which the folder has to be updated.- Throws:
WorkflowException
- if the update fails.
-
getField
public Field getField(String fieldName) throws WorkflowException
Description copied from interface:ProcessInstance
Gets the specified field.- Specified by:
getField
in interfaceProcessInstance
- Parameters:
fieldName
- the name that identifies a field in this process instance.- Returns:
- the corresponding field.
- Throws:
WorkflowException
- if the field cannot be found or if an error occurs.
-
setField
public void setField(String fieldName, Field copiedField) throws WorkflowException
Description copied from interface:UpdatableProcessInstance
Sets the specified field in the process instance.- Specified by:
setField
in interfaceUpdatableProcessInstance
- Parameters:
fieldName
- the name of the fieldcopiedField
- the field to set- Throws:
WorkflowException
-
getActionRecord
public DataRecord getActionRecord(String actionName) throws WorkflowException
Description copied from interface:ProcessInstance
Gets the data that were provided to the specified action when it was was performed. The most recent data is returned in the case the action has been done several times.- Specified by:
getActionRecord
in interfaceProcessInstance
- Parameters:
actionName
- action name the name of the performed action.- Returns:
- the data record.
- Throws:
WorkflowException
-
getFormRecord
public DataRecord getFormRecord(String formName, String role, String lang) throws WorkflowException
Description copied from interface:ProcessInstance
Gets the data record of the specified form for the given role and written in the specified language. The information set in the record are filtered by what is allowed to be accessed for the given role.- Specified by:
getFormRecord
in interfaceProcessInstance
- Parameters:
formName
- the name of the form to get.role
- a role a user can play in this process instance.lang
- the ISO-631 code of the language in which data have to be.- Returns:
- DataRecord or null if no such form can be found.
- Throws:
WorkflowException
- if an error occurs.
-
getNewActionRecord
public DataRecord getNewActionRecord(String actionName, String language) throws WorkflowException
Description copied from interface:ProcessInstance
Gets a new data record associated with the given action.- Specified by:
getNewActionRecord
in interfaceProcessInstance
- Parameters:
actionName
- action namelanguage
- the ISO-631 code of the language in which the data will be.- Returns:
- the new empty data record.
- Throws:
WorkflowException
-
saveActionRecord
public void saveActionRecord(HistoryStep step, DataRecord actionData) throws WorkflowException
Description copied from interface:UpdatableProcessInstance
Save a new version of given form (including values)- Specified by:
saveActionRecord
in interfaceUpdatableProcessInstance
- Parameters:
step
- the new stepactionData
- Form's values as a DataRecord object- Throws:
WorkflowException
-
getMostRecentStep
public HistoryStep getMostRecentStep(String actionName)
Description copied from interface:ProcessInstance
Recent the most recent step where the named action has been performed.- Specified by:
getMostRecentStep
in interfaceProcessInstance
-
getSavedStep
public HistoryStep getSavedStep(String userId) throws WorkflowException
Description copied from interface:ProcessInstance
Get step saved by given user id.- Specified by:
getSavedStep
in interfaceProcessInstance
- Returns:
- the history step or null if there is no such step.
- Throws:
WorkflowException
- if an error occurs.
-
getActiveStates
public String[] getActiveStates()
Description copied from interface:ProcessInstance
Gets all the active states of this process instance. An active state is the current state at which the process is and waiting for actions.- Specified by:
getActiveStates
in interfaceProcessInstance
- Returns:
- an array with the name of all the active states.
-
isStateInBackStatus
public boolean isStateInBackStatus(String stateName)
Description copied from interface:ProcessInstance
Test is a active state is in back status- Specified by:
isStateInBackStatus
in interfaceProcessInstance
- Parameters:
stateName
- name of active state- Returns:
- true if resolution of active state involves a cancel of actions
-
getWorkingUsers
public Actor[] getWorkingUsers() throws WorkflowException
Description copied from interface:ProcessInstance
Gets all the users working on this process instance.- Specified by:
getWorkingUsers
in interfaceProcessInstance
- Returns:
- an array of
Actor
objects. - Throws:
WorkflowException
- if an error occurs.
-
getWorkingUsers
public Actor[] getWorkingUsers(String state) throws WorkflowException
Description copied from interface:ProcessInstance
Gets all the users working on the specified state of this instance state.- Specified by:
getWorkingUsers
in interfaceProcessInstance
- Parameters:
state
- the name of a state in this process instance.- Returns:
- an array of
Actor
objects. - Throws:
WorkflowException
-
removeWorkingUsers
public void removeWorkingUsers(State state)
Description copied from interface:UpdatableProcessInstance
Remove all working users for given state- Specified by:
removeWorkingUsers
in interfaceUpdatableProcessInstance
- Parameters:
state
- state for which the user is interested
-
removeInterestedUsers
public void removeInterestedUsers(State state)
Description copied from interface:UpdatableProcessInstance
Remove all interested users for given state- Specified by:
removeInterestedUsers
in interfaceUpdatableProcessInstance
- Parameters:
state
- state for which the user is interested
-
getWorkingUsers
public Actor[] getWorkingUsers(String state, String role) throws WorkflowException
Description copied from interface:ProcessInstance
Gets all the users working on the specified state of this instance state with the given role.- Specified by:
getWorkingUsers
in interfaceProcessInstance
- Parameters:
state
- the name of a state in this process instance.- Returns:
- an array of
Actor
objects. - Throws:
WorkflowException
-
getAssignedStates
public String[] getAssignedStates(User user, String roleName)
Description copied from interface:ProcessInstance
Gets all the states that are assigned to the specified user with given role.- Specified by:
getAssignedStates
in interfaceProcessInstance
- Parameters:
user
- a user in the workflow.roleName
- a role the user has to play in this process instance.- Returns:
- an array with the name of all the states assigned to the given user with the given role name.
-
getAllAssignedStates
public String[] getAllAssignedStates(User user)
Description copied from interface:ProcessInstance
Gets all the states that are assigned to the specified user.- Specified by:
getAllAssignedStates
in interfaceProcessInstance
- Parameters:
user
- a user in the workflow.- Returns:
- an array with the name of all the states assigned to the given user
-
getLockingUser
public LockingUser getLockingUser(String state)
Description copied from interface:ProcessInstance
Gets the user that has locked the specified state.- Specified by:
getLockingUser
in interfaceProcessInstance
- Parameters:
state
- the name of a state in this process instance.- Returns:
- the user as a
LockingUser
instance.
-
lock
public void lock(State state, User user) throws WorkflowException
Description copied from interface:ProcessInstance
Locks this instance for the given instance and state- Specified by:
lock
in interfaceProcessInstance
- Parameters:
state
- state that have to be lockeduser
- the locking user- Throws:
WorkflowException
-
unLock
public void unLock(State state, User user) throws WorkflowException
Description copied from interface:ProcessInstance
Un-locks this instance for the given instance and state- Specified by:
unLock
in interfaceProcessInstance
- Parameters:
state
- state that have to be un-lockeduser
- the unlocking user- Throws:
WorkflowException
-
lock
public void lock() throws WorkflowException
Description copied from interface:UpdatableProcessInstance
Lock this instance by admin for all states- Specified by:
lock
in interfaceUpdatableProcessInstance
- Throws:
WorkflowException
-
unLock
public void unLock()
Description copied from interface:UpdatableProcessInstance
Lock this instance by admin for all states- Specified by:
unLock
in interfaceUpdatableProcessInstance
-
isValid
public boolean isValid()
Description copied from interface:ProcessInstance
Is this process instance valid?- Specified by:
isValid
in interfaceProcessInstance
- Returns:
- true is this instance is valid. False otherwise.
-
isLockedByAdmin
public boolean isLockedByAdmin()
Description copied from interface:ProcessInstance
Is this process instance has been locked by the supervisor?- Specified by:
isLockedByAdmin
in interfaceProcessInstance
- Returns:
- true is this instance is locked by admin, false otherwise.
-
setLockedByAdmin
public void setLockedByAdmin(boolean locked)
Set the lock Admin status of this instance- Parameters:
locked
- true is this instance is locked by admin
-
getErrorStatus
public boolean getErrorStatus()
Description copied from interface:ProcessInstance
Is this process instance in error by an action?- Specified by:
getErrorStatus
in interfaceProcessInstance
- Returns:
- true if this instance is in error, false otherwise.
-
setErrorStatus
public void setErrorStatus(boolean errorStatus)
Description copied from interface:UpdatableProcessInstance
Set the error status of this instance- Specified by:
setErrorStatus
in interfaceUpdatableProcessInstance
- Parameters:
errorStatus
- true if this instance is in error
-
getTimeoutStatus
public boolean getTimeoutStatus()
Description copied from interface:ProcessInstance
Gets the timeout status of this instance- Specified by:
getTimeoutStatus
in interfaceProcessInstance
- Returns:
- true if this instance is in an active state for a long long time. False otherwise.
-
setTimeoutStatus
public void setTimeoutStatus(boolean timeoutStatus)
Description copied from interface:UpdatableProcessInstance
Set the timeout status of this instance- Specified by:
setTimeoutStatus
in interfaceUpdatableProcessInstance
- Parameters:
timeoutStatus
- true if this instance is in an active state for a long long time
-
getUsersInRole
public List<User> getUsersInRole(String role)
Description copied from interface:ProcessInstance
Gets concrete users affected to given role at runtime- Specified by:
getUsersInRole
in interfaceProcessInstance
- Parameters:
role
- the name of the role- Returns:
- users affected to given role
-
getUsersInGroup
public List<User> getUsersInGroup(String groupId)
Description copied from interface:ProcessInstance
Gets concrete users affected to given group at runtime- Specified by:
getUsersInGroup
in interfaceProcessInstance
- Parameters:
groupId
- the id of the group- Returns:
- users in given group
-
getActors
public Actor[] getActors(QualifiedUsers qualifiedUsers, State state) throws WorkflowException
Description copied from interface:ProcessInstance
Computes tuples role/user (stored in an Actor object) from a QualifiedUsers object- Specified by:
getActors
in interfaceProcessInstance
- Parameters:
qualifiedUsers
- Users defined by their role or by a relation with a participantstate
- state for which these user were/may be actors- Returns:
- tuples role/user as an array of Actor objects
- Throws:
WorkflowException
- if an error occurs
-
reDoState
public void reDoState(String state, Date actionDate) throws WorkflowException
Description copied from interface:UpdatableProcessInstance
Cancel all the atomic operations since the step where first action had occurred- Specified by:
reDoState
in interfaceUpdatableProcessInstance
- Parameters:
state
- the name of state where ac action has been discussedactionDate
- date of state re-resolving- Throws:
WorkflowException
-
getBackSteps
public HistoryStep[] getBackSteps(User user, String roleName, String stateName) throws WorkflowException
Description copied from interface:ProcessInstance
Get all the steps where given user (with given role) can go back from the given state- Specified by:
getBackSteps
in interfaceProcessInstance
- Parameters:
user
- user that can do the back actionsroleName
- role name of this userstateName
- name of state where user want to go back from- Returns:
- an array of HistoryStep objects
- Throws:
WorkflowException
-
addQuestion
public State addQuestion(String content, String stepId, State fromState, User fromUser) throws WorkflowException
Description copied from interface:ProcessInstance
Add a question- Specified by:
addQuestion
in interfaceProcessInstance
- Parameters:
content
- question textstepId
- id of destination step for the questionfromState
- the state where the question was askedfromUser
- the user who asked the question- Returns:
- The state to which the question is
- Throws:
WorkflowException
-
answerQuestion
public State answerQuestion(String content, String questionId) throws WorkflowException
Description copied from interface:ProcessInstance
Answer a question- Specified by:
answerQuestion
in interfaceProcessInstance
- Parameters:
content
- response textquestionId
- id of question corresponding to this response- Returns:
- The state where the question was asked
- Throws:
WorkflowException
-
getPendingQuestions
public Question[] getPendingQuestions(String stateName)
Description copied from interface:ProcessInstance
Get all the questions asked in the given state- Specified by:
getPendingQuestions
in interfaceProcessInstance
- Parameters:
stateName
- given state name- Returns:
- all the questions (not yet answered) asked in the given state
-
getSentQuestions
public Question[] getSentQuestions(String stateName)
Description copied from interface:ProcessInstance
Get all the questions asked from the given state- Specified by:
getSentQuestions
in interfaceProcessInstance
- Parameters:
stateName
- given state name- Returns:
- all the questions (not yet answered) asked from the given state
-
getRelevantQuestions
public Question[] getRelevantQuestions(String stateName)
Description copied from interface:ProcessInstance
Get all the questions asked from the given state and that have been answered- Specified by:
getRelevantQuestions
in interfaceProcessInstance
- Parameters:
stateName
- given state name- Returns:
- all the answered questions asked from the given state
-
cancelQuestion
public void cancelQuestion(Question question) throws WorkflowException
Description copied from interface:UpdatableProcessInstance
Cancel a question without response- Specified by:
cancelQuestion
in interfaceUpdatableProcessInstance
- Parameters:
question
- the question to cancel- Throws:
WorkflowException
-
getQuestions
public Question[] getQuestions()
Description copied from interface:ProcessInstance
Get all the questions asked in this processInstance- Specified by:
getQuestions
in interfaceProcessInstance
- Returns:
- all the questions
-
addActiveState
public void addActiveState(ActiveState activeState)
Add active state to the process instance- Parameters:
activeState
- state to add.
-
getTitle
public String getTitle(String role, String lang)
Description copied from interface:ProcessInstance
Returns this instance title.- Specified by:
getTitle
in interfaceProcessInstance
-
getTimeOutAction
public ActionAndState getTimeOutAction(Date dateRef) throws WorkflowException
Description copied from interface:ProcessInstance
Gets the timeout action to be launched after the given datetime.- Specified by:
getTimeOutAction
in interfaceProcessInstance
- Returns:
- the asked
ActionAndState
or null if no such action is found. - Throws:
WorkflowException
- if an error occurs
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractJpaEntity<ProcessInstanceImpl,UniqueIntegerIdentifier>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractJpaEntity<ProcessInstanceImpl,UniqueIntegerIdentifier>
-
-