Interface WorkflowContext


  • public interface WorkflowContext
    A workflow context class is made available to a workflow implementation (see WorkflowImpl@getWorkflowContext) to obtain additional information during the execution of a workflow step.
    • Method Detail

      • getUserIdentity

        String getUserIdentity()
        Returns:
        the invocation user identity
      • getUserSession

        Session getUserSession()
        Obtains the initial workflow invocation (user) session.
        Returns:
        the invocation user session
      • getSubject

        Node getSubject()
        Obtains the subject of this WorkflowContext
        Returns:
        the subject of this WorkflowContext
      • getSubjectSession

        Session getSubjectSession()
        Obtain the subject session used to check and load the current workflow.

        For an initial workflow invocation this will be, in most cases, but not all, see below, the getUserSession().
        For any subsequent (nested) workflow invocation this will be the getInternalWorkflowSession().

        If the initial workflow was invoked through WorkflowManager.getWorkflow(String, Node), the provided node parameter its own session will be used as subject session, so potentially different from the user session invoking the workflow!

        This separate session reference is useful to check JCR permissions within the workflow as was used to validate access the workflow itself.

        Returns:
        the session to check permissions on and within the current workflow itself
      • getInternalWorkflowSession

        Session getInternalWorkflowSession()
        Obain the internal workflow session which has 'root' privileges. This session is internally used by the workflow and used to persist workflow modifications. Also, the workflow subject (Node) itself will be loaded through this internal workflow session.

        Do NOT return JCR Items loaded through this internal workflow session back to the invoking user, as it will expose access to this session.

        Be very careful making changes through the internal workflow session: state consistency can easily broken that way.

        Returns:
        the internal workflow session with higer(st) privileges: be aware of possible dangerous side-effects when used for modifications
      • getWorkflowConfiguration

        RepositoryMap getWorkflowConfiguration()
      • getInteraction

        String getInteraction()
      • getInteractionId

        String getInteractionId()