public interface WorkflowContext
Modifier and Type | Method and Description |
---|---|
String |
getInteraction() |
String |
getInteractionId() |
javax.jcr.Session |
getInternalWorkflowSession()
Obain the internal workflow session which has 'root' privileges.
|
javax.jcr.Node |
getSubject()
Obtains the subject of this WorkflowContext
|
javax.jcr.Session |
getSubjectSession()
Obtain the subject session used to check and load the current workflow.
|
String |
getUserIdentity() |
javax.jcr.Session |
getUserSession()
Obtains the initial workflow invocation (user) session.
|
Workflow |
getWorkflow(String category)
Obtains a workflow instance for this workflow context its subject.
|
Workflow |
getWorkflow(String category,
Document document)
Obtains a workflow instance for a document subject
|
RepositoryMap |
getWorkflowConfiguration() |
Workflow getWorkflow(String category) throws WorkflowException, javax.jcr.RepositoryException
Be aware that the returned workflow is checked against the getInternalWorkflowSession()
privileges,
so NOT against the initial workflow invocation getUserSession()
.
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 a Session.save()
or Session.refresh(false)
.
category
- Name of the workflow categoryMappingException
WorkflowException
javax.jcr.RepositoryException
Workflow getWorkflow(String category, Document document) throws WorkflowException, javax.jcr.RepositoryException
Be aware that the returned workflow is checked against the getInternalWorkflowSession()
privileges,
so NOT against the initial workflow invocation getUserSession()
.
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 a Session.save()
or Session.refresh(false)
.
category
- Name of the workflow categorydocument
- Document subject for which the new workflow instance will be returnedMappingException
WorkflowException
javax.jcr.RepositoryException
String getUserIdentity()
javax.jcr.Session getUserSession()
javax.jcr.Node getSubject()
javax.jcr.Session getSubjectSession()
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.
javax.jcr.Session getInternalWorkflowSession()
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.
RepositoryMap getWorkflowConfiguration()
String getInteraction()
String getInteractionId()
Copyright © 2007–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.