Interface ProcessInstance

    • Method Detail

      • 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[]
      • 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
      • 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
      • getActiveStates

        String[] getActiveStates()
        Returns:
        String[]
      • 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
      • 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 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