com.silverpeas.workflow.api.instance
Interface ProcessInstance

All Known Subinterfaces:
UpdatableProcessInstance
All Known Implementing Classes:
ProcessInstanceImpl

public interface ProcessInstance


Method Summary
 State addQuestion(String content, String stepId, State fromState, User fromUser)
          Add a question
 State answerQuestion(String content, String questionId)
          Answer a question
 String create()
           
 void delete()
           
 DataRecord 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 object
 DataRecord getAllDataRecord(String role, String lang)
           
 String[] getAssignedStates(User user, String roleName)
          Returns all the state name assigned to the 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 state
 boolean getErrorStatus()
          Get the error status of this instance
 Field 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 id
 LockingUser getLockingUser(String state)
           
 String getModelId()
          Get the workflow model id
 HistoryStep getMostRecentStep(State state)
          Recent the most recent step where an action has been performed on the given state.
 HistoryStep getMostRecentStep(String actionName)
          Recent the most recent step where the named action has been performed.
 DataRecord getNewActionRecord(String actionName)
          Get a new data record associated to the given action
 Participant getParticipant(String resolvedState)
          Get the last user who resolved the given state
 Vector<Participant> getParticipants()
           
 Question[] getPendingQuestions(String stateName)
          Get all the questions asked in the given state
 ProcessModel getProcessModel()
           
 Question[] getQuestions()
          Get all the questions asked in this processInstance
 Question[] getRelevantQuestions(String stateName)
          Get all the questions asked from the given state and that have been aswered
 DataRecord 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 state
 ActionAndState getTimeOutAction(Date dateRef)
          Returns the timeout action to be launched after given date
 boolean getTimeoutStatus()
          Get the timeout status of this instance
 String getTitle(String role, String lang)
          Returns this instance title.
 List<User> getUsersInGroup(String groupId)
          Gets concrete users affected to given group at runtime
 List<User> getUsersInRole(String role)
          Gets concrete users affected to given role at runtime
 Actor[] 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 instance
 boolean isStateInBackStatus(String stateName)
          Test is a active state is in back status
 boolean isValid()
          Get the validity state of this instance
 void lock(State state, User user)
          Locks this instance for the given instance and state
 void unLock(State state, User user)
          Un-locks this instance for the given instance and state
 void update()
           
 

Method Detail

getProcessModel

ProcessModel getProcessModel()
                             throws WorkflowException
Returns:
ProcessModel
Throws:
WorkflowException

create

String create()
              throws WorkflowException
Returns:
String
Throws:
WorkflowException

delete

void delete()
            throws WorkflowException
Throws:
WorkflowException

update

void update()
            throws WorkflowException
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)
                              throws WorkflowException
Get a new data record associated to the given action

Parameters:
actionName - action name
Throws:
WorkflowException

getParticipants

Vector<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

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 -
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 locked
user - 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-locked
user - 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 participant
state - 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.


getMostRecentStep

HistoryStep getMostRecentStep(State state)
Recent the most recent step where an action has been performed on the given state.


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 actions
roleName - role name of this user
roleName - role name of this user
stateName - 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 text
stepId - id of destination step for the question
fromState - the state where the question was asked
fromUser - 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 text
questionId - 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

getTitle

String getTitle(String role,
                String lang)
Returns this instance title.


getTimeOutAction

ActionAndState getTimeOutAction(Date dateRef)
                                throws WorkflowException
Returns the timeout action to be launched after given date

Throws:
WorkflowException


Copyright © 2016 Silverpeas. All Rights Reserved.