Interface ProcessInstance
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
UpdatableProcessInstance
- All Known Implementing Classes:
ProcessInstanceImpl
public interface ProcessInstance extends Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description State
addQuestion(String content, String stepId, State fromState, User fromUser)
Add a questionState
answerQuestion(String content, String questionId)
Answer a questionDataRecord
getActionRecord(String actionName)
Returns the data which was given when the action was performed.String[]
getActiveStates()
Actor[]
getActors(QualifiedUsers qualifiedUsers, State state)
Computes tuples role/user (stored in an Actor object) from a QualifiedUsers objectDataRecord
getAllDataRecord(String role, String lang)
String[]
getAssignedStates(User user, String roleName)
Returns all the state name assigned to the user with given roleHistoryStep[]
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()
Get the error status of this instanceField
getField(String fieldName)
DataRecord
getFolder()
DataRecord
getFormRecord(String formName, String role, String lang)
HistoryStep
getHistoryStep(String stepId)
HistoryStep[]
getHistorySteps()
String
getInstanceId()
Get the workflow instance idLockingUser
getLockingUser(String 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)
Get a new data record associated to the given actionParticipant
getParticipant(String resolvedState)
Get the last user who resolved the given stateList<Participant>
getParticipants()
Question[]
getPendingQuestions(String stateName)
Get all the questions asked in the given stateProcessModel
getProcessModel()
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 asweredDataRecord
getRowDataRecord(String role, String lang)
Returns a DataRecord which will be used to represent this process instance as a row in a list.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)
Returns the timeout action to be launched after given dateboolean
getTimeoutStatus()
Get 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()
Returns all the working users on this instance.Actor[]
getWorkingUsers(String state)
Returns all the working users on this instance state.Actor[]
getWorkingUsers(String state, String role)
Returns all the working users on this instance state.boolean
isLockedByAdmin()
Get the lock Admin status of this instanceboolean
isStateInBackStatus(String stateName)
Test is a active state is in back statusboolean
isValid()
Get the validity state of this instancevoid
lock(State state, User user)
Locks this instance for the given instance and statevoid
unLock(State state, User user)
Un-locks this instance for the given instance and statevoid
updateFolder(DataRecord data)
-
-
-
Method Detail
-
getProcessModel
ProcessModel getProcessModel() throws WorkflowException
- Returns:
- ProcessModel
- Throws:
WorkflowException
-
getInstanceId
String getInstanceId()
Get the workflow instance id- Returns:
- instance id
-
getModelId
String getModelId()
Get the workflow model id- Returns:
- model id
-
getHistorySteps
HistoryStep[] getHistorySteps()
- Returns:
- HistoryStep[]
-
getHistoryStep
HistoryStep getHistoryStep(String stepId) throws WorkflowException
- Returns:
- HistoryStep
- Throws:
WorkflowException
-
getActionRecord
DataRecord getActionRecord(String actionName) throws WorkflowException
Returns the data which was given when the action was performed. Returns the most recent data when the action has been done several times.- Parameters:
actionName
- action name- Throws:
WorkflowException
-
getNewActionRecord
DataRecord getNewActionRecord(String actionName, String language) throws WorkflowException
Get a new data record associated to the given action- Parameters:
actionName
- action name- Throws:
WorkflowException
-
getParticipants
List<Participant> getParticipants() throws WorkflowException
- Returns:
- Vector
- Throws:
WorkflowException
-
getParticipant
Participant getParticipant(String resolvedState) throws WorkflowException
Get the last user who resolved the given state- Parameters:
resolvedState
- the resolved state- Returns:
- this user as a Participant object
- Throws:
WorkflowException
-
getFolder
DataRecord getFolder() throws WorkflowException
- Returns:
- DataRecord
- Throws:
WorkflowException
-
updateFolder
void updateFolder(DataRecord data) throws WorkflowException
- Throws:
WorkflowException
-
getAllDataRecord
DataRecord getAllDataRecord(String role, String lang) throws WorkflowException
- Returns:
- DataRecord
- Throws:
WorkflowException
-
getRowDataRecord
DataRecord getRowDataRecord(String role, String lang) throws WorkflowException
Returns a DataRecord which will be used to represent this process instance as a row in a list.- Throws:
WorkflowException
-
getFormRecord
DataRecord getFormRecord(String formName, String role, String lang) throws WorkflowException
- Returns:
- DataRecord
- Throws:
WorkflowException
-
getField
Field getField(String fieldName) throws WorkflowException
- Parameters:
fieldName
- the fieldName that identifies the Field instance to get- Returns:
- Field
- Throws:
WorkflowException
-
getActiveStates
String[] getActiveStates()
- Returns:
- String[]
-
getWorkingUsers
Actor[] getWorkingUsers() throws WorkflowException
Returns all the working users on this instance.- Returns:
- Actor[]
- Throws:
WorkflowException
-
getWorkingUsers
Actor[] getWorkingUsers(String state) throws WorkflowException
Returns all the working users on this instance state.- Parameters:
state
-- Returns:
- User[]
- Throws:
WorkflowException
-
getWorkingUsers
Actor[] getWorkingUsers(String state, String role) throws WorkflowException
Returns all the working users on this instance state.- Parameters:
state
-- Returns:
- User[]
- Throws:
WorkflowException
-
getAssignedStates
String[] getAssignedStates(User user, String roleName) throws WorkflowException
Returns all the state name assigned to the user with given role- Parameters:
user
-roleName
-- Returns:
- String[]
- Throws:
WorkflowException
-
getLockingUser
LockingUser getLockingUser(String state) throws WorkflowException
- Parameters:
state
-- Returns:
- User
- Throws:
WorkflowException
-
isValid
boolean isValid()
Get the validity state of this instance- Returns:
- true is this instance is valid
-
isLockedByAdmin
boolean isLockedByAdmin()
Get the lock Admin status of this instance- Returns:
- true is this instance is locked by admin
-
getErrorStatus
boolean getErrorStatus()
Get the error status of this instance- Returns:
- true if this instance is in error
-
getTimeoutStatus
boolean getTimeoutStatus()
Get the timeout status of this instance- Returns:
- true if this instance is in an active state for a long long time
-
lock
void lock(State state, User user) throws WorkflowException
Locks this instance for the given instance and state- Parameters:
state
- state that have to be lockeduser
- the locking user- Throws:
WorkflowException
-
unLock
void unLock(State state, User user) throws WorkflowException
Un-locks this instance for the given instance and state- Parameters:
state
- state that have to be un-lockeduser
- the unlocking user- Throws:
WorkflowException
-
getUsersInRole
List<User> getUsersInRole(String role) throws WorkflowException
Gets concrete users affected to given role at runtime- Parameters:
role
- the name of the role- Returns:
- users affected to given role
- Throws:
WorkflowException
-
getUsersInGroup
List<User> getUsersInGroup(String groupId) throws WorkflowException
Gets concrete users affected to given group at runtime- Parameters:
groupId
- the id of the group- Returns:
- users in given group
- Throws:
WorkflowException
-
getActors
Actor[] getActors(QualifiedUsers qualifiedUsers, State state) throws WorkflowException
Computes tuples role/user (stored in an Actor object) from a QualifiedUsers object- 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
-
isStateInBackStatus
boolean isStateInBackStatus(String stateName)
Test is a active state is in back status- Parameters:
stateName
- name of active state- Returns:
- true if resolution of active state involves a cancel of actions
-
getSavedStep
HistoryStep getSavedStep(String userId) throws WorkflowException
Get step saved by given user id.- Throws:
WorkflowException
-
getMostRecentStep
HistoryStep getMostRecentStep(String actionName)
Recent the most recent step where the named action has been performed.
-
getBackSteps
HistoryStep[] getBackSteps(User user, String roleName, String stateName) throws WorkflowException
Get all the steps where given user (with given role) can go back from the given state- Parameters:
user
- user that can do the back actionsroleName
- role name of this userroleName
- role name of this userstateName
- name of state where user want to go back from- Returns:
- an array of HistoryStep objects
- Throws:
WorkflowException
-
addQuestion
State addQuestion(String content, String stepId, State fromState, User fromUser) throws WorkflowException
Add a question- 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
State answerQuestion(String content, String questionId) throws WorkflowException
Answer a question- Parameters:
content
- response textquestionId
- id of question corresponding to this response- Returns:
- The state where the question was asked
- Throws:
WorkflowException
-
getPendingQuestions
Question[] getPendingQuestions(String stateName) throws WorkflowException
Get all the questions asked in the given state- Parameters:
stateName
- given state name- Returns:
- all the questions (not yet answered) asked in the given state
- Throws:
WorkflowException
-
getSentQuestions
Question[] getSentQuestions(String stateName)
Get all the questions asked from the given state- Parameters:
stateName
- given state name- Returns:
- all the questions (not yet answered) asked from the given state
-
getRelevantQuestions
Question[] getRelevantQuestions(String stateName)
Get all the questions asked from the given state and that have been aswered- Parameters:
stateName
- given state name- Returns:
- all the answered questions asked from the given state
-
getQuestions
Question[] getQuestions()
Get all the questions asked in this processInstance- Returns:
- all the questions
-
getTimeOutAction
ActionAndState getTimeOutAction(Date dateRef) throws WorkflowException
Returns the timeout action to be launched after given date- Throws:
WorkflowException
-
-