Interface WorkflowContext
-
Method Summary
Modifier and TypeMethodDescriptionObain the internal workflow session which has 'root' privileges.Obtains the subject of this WorkflowContextObtain the subject session used to check and load the current workflow.Obtains the initial workflow invocation (user) session.getWorkflow
(String category) Obtains a workflow instance for this workflow context its subject.getWorkflow
(String category, Document document) Obtains a workflow instance for a document subject
-
Method Details
-
getWorkflow
Obtains a workflow instance for this workflow context its subject.Be aware that the returned workflow is checked against the
getInternalWorkflowSession()
privileges, so NOT against the initial workflow invocationgetUserSession()
.For the returned workflow it is assumed there are no pending changes on its
getInternalWorkflowSession()
. So before using the returned workflow it might be required to first do aSession.save()
orSession.refresh(false)
.- Parameters:
category
- Name of the workflow category- Returns:
- a workflow instance
- Throws:
MappingException
WorkflowException
RepositoryException
-
getWorkflow
Workflow getWorkflow(String category, Document document) throws WorkflowException, RepositoryException Obtains a workflow instance for a document subjectBe aware that the returned workflow is checked against the
getInternalWorkflowSession()
privileges, so NOT against the initial workflow invocationgetUserSession()
.For the returned workflow it is assumed there are no pending changes on its
getInternalWorkflowSession()
. So before using the returned workflow it might be required to first do aSession.save()
orSession.refresh(false)
.- Parameters:
category
- Name of the workflow categorydocument
- Document subject for which the new workflow instance will be returned- Returns:
- a workflow instance
- Throws:
MappingException
WorkflowException
RepositoryException
-
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 thegetInternalWorkflowSession()
.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()
-