public interface WorkflowSession
WorkflowSession
class provides all functionality (depending
on the users rights) for managing WorkflowModel
s, Workflow
instances and their execution.
It provides methods to:
WorkItem
s assigned to a user/groupModifier and Type | Method and Description |
---|---|
void |
complete(WorkItem item,
Route route)
Completes the
for the assigned
instance and assign to the next
according to the given
. |
WorkflowModel |
createNewModel(java.lang.String title)
Creates a new blank
. |
WorkflowModel |
createNewModel(java.lang.String title,
java.lang.String id)
Creates a new blank
under the given path. |
void |
delegateWorkItem(WorkItem item,
Authorizable participant)
Delegates the
WorkItem to the specified
Authorizable . |
void |
deleteModel(java.lang.String id)
Deletes the given
. |
void |
deployModel(WorkflowModel model)
Deploys a new or modified
. |
boolean |
evaluate(WorkflowData data,
java.lang.String rule)
Evaluate the passed rule by choosing the right rule engine.
|
WorkItem[] |
getActiveWorkItems()
|
ResultSet<WorkItem> |
getActiveWorkItems(long start,
long limit)
|
ResultSet<WorkItem> |
getActiveWorkItems(long start,
long limit,
WorkItemFilter filter)
|
Workflow[] |
getAllWorkflows()
Returns all
Workflow s which the
has access to. |
WorkItem[] |
getAllWorkItems()
|
ResultSet<WorkItem> |
getAllWorkItems(long start,
long limit)
|
java.util.List<Route> |
getBackRoutes(WorkItem item)
All
to all possible already passed
destinations will be returned. |
java.util.List<Route> |
getBackRoutes(WorkItem item,
boolean expand)
All
to all possible already passed
destinations will be returned. |
java.util.List<Authorizable> |
getDelegatees(WorkItem item)
Returns all
delegatees as Authorizable who are
allowed to take over the WorkItem |
java.util.List<HistoryItem> |
getHistory(Workflow instance)
The complete ordered list of
HistoryItem
s is returned for the given Workflow instance. |
WorkflowModel |
getModel(java.lang.String id)
Returns newest version of the
with the
given ID. |
WorkflowModel |
getModel(java.lang.String id,
java.lang.String version)
Returns the
with the given ID and
version. |
WorkflowModel[] |
getModels()
Returns newest versions of all deployed
s. |
ResultSet<WorkflowModel> |
getModels(long start,
long limit)
Returns newest versions of all deployed
s. |
ResultSet<WorkflowModel> |
getModels(long start,
long limit,
WorkflowModelFilter filter)
Returns newest versions of all deployed
s. |
WorkflowModel[] |
getModels(WorkflowModelFilter filter)
Returns newest versions of all deployed
s. |
java.util.List<Route> |
getRoutes(WorkItem item)
All
to all possible destinations will be
returned. |
java.util.List<Route> |
getRoutes(WorkItem item,
boolean expand)
All
to all possible destinations will be
returned. |
Session |
getSession()
Returns the JCR
assigned to the
WorkflowSession instance. |
Authorizable |
getUser()
Returns the user that owns the
WorkflowSession . |
Workflow |
getWorkflow(java.lang.String id)
Retrieve the
instance with the given ID. |
Workflow[] |
getWorkflows(java.lang.String[] states)
Returns all
instances that are in one of
the given states and to which the
has access to. |
ResultSet<Workflow> |
getWorkflows(java.lang.String[] states,
long start,
long limit)
Returns all
s instances that are in one of
the given states and to which the
has access to. |
WorkflowService |
getWorkflowService()
Returns the
that was used to create
the WorkflowSession instance. |
WorkItem |
getWorkItem(java.lang.String id)
|
boolean |
isSuperuser()
Checks for the workflow superuser
|
void |
logout()
The logout method has to be called in order to clean up all jcr session
references.
|
WorkflowData |
newWorkflowData(java.lang.String payloadType,
java.lang.Object payload)
Creates a new
instance based on the
given data. |
void |
restartWorkflow(Workflow workflow)
This method restarts a workflow instance that is in a "stale" state.
|
void |
resumeWorkflow(Workflow instance)
Resumes the given
Workflow instance. |
Workflow |
startWorkflow(WorkflowModel model,
WorkflowData data)
|
Workflow |
startWorkflow(WorkflowModel model,
WorkflowData data,
java.util.Dictionary<java.lang.String,java.lang.String> metaData)
Deprecated.
It is recommended to use startWorkflow(WorkflowModel, WorkflowData, Map) instead.
|
Workflow |
startWorkflow(WorkflowModel model,
WorkflowData data,
java.util.Map<java.lang.String,java.lang.Object> metaData)
|
void |
suspendWorkflow(Workflow instance)
Suspends the given
Workflow instance. |
void |
terminateWorkflow(Workflow instance)
Terminates the given
Workflow instance. |
void |
updateWorkflowData(Workflow instance,
WorkflowData data)
Updates the workflow data of a running workflow instance to the given
WorkflowData . |
WorkflowService getWorkflowService()
WorkflowService
that was used to create
the WorkflowSession
instance.WorkflowService
that was used to create
the WorkflowSession
instance.Session getSession()
Session
assigned to the
WorkflowSession
instance.Session
assigned to the
WorkflowSession
instance.Authorizable getUser()
WorkflowSession
.WorkflowSession
.boolean evaluate(WorkflowData data, java.lang.String rule)
data
- workflow data to apply the rulerule
- rule to executetrue
if rule evaluation is true or the rule is
null
void deployModel(WorkflowModel model) throws WorkflowException
WorkflowModel
.model
- The WorkflowModel
to be deployed.WorkflowException
- Thrown in case an error prevents deployment of the
WorkflowModel
.WorkflowModel createNewModel(java.lang.String title) throws WorkflowException
WorkflowModel
.title
- The title of the newly created
WorkflowModel
.WorkflowModel
.WorkflowException
- Thrown in case an error prevents creation of the
WorkflowModel
.WorkflowModel createNewModel(java.lang.String title, java.lang.String id) throws WorkflowException
WorkflowModel
under the given path.title
- The title of the newly created
WorkflowModel
.id
- The ID of the new WorkflowModel
.WorkflowModel
.WorkflowException
- Thrown in case an error prevents creation of the
WorkflowModel
.void deleteModel(java.lang.String id) throws WorkflowException
WorkflowModel
.id
- The ID of the WorkflowModel
to be
deleted.WorkflowException
- Thrown in case an error prevents deployment of the
WorkflowModel
.WorkflowModel[] getModels() throws WorkflowException
WorkflowModel
s.WorkflowModel
at their newest
versions.WorkflowException
- Thrown in case an error occurs while fetching the
WorkflowModel
s.WorkflowModel[] getModels(WorkflowModelFilter filter) throws WorkflowException
WorkflowModel
s.filter
- The WorkflowModelFilter
used for getting workflow modelsWorkflowModel
at their newest
versions.WorkflowException
- Thrown in case an error occurs while fetching the
WorkflowModel
.ResultSet<WorkflowModel> getModels(long start, long limit) throws WorkflowException
WorkflowModel
s.start
- Start index of the result set.limit
- Limit of the result set.WorkflowModel
at their newest
versions.WorkflowException
- Thrown in case an error occurs while fetching the
WorkflowModel
s.ResultSet<WorkflowModel> getModels(long start, long limit, WorkflowModelFilter filter) throws WorkflowException
WorkflowModel
s.start
- Start index of the result set.limit
- Limit of the result set.filter
- The WorkflowModelFilter
used for getting workflow modelsWorkflowModel
at their newest
versions.WorkflowException
- Thrown in case an error occurs while fetching the
WorkflowModel
s.WorkflowModel getModel(java.lang.String id) throws WorkflowException
WorkflowModel
with the
given ID.id
- The ID of the WorkflowModel
.WorkflowModel
with
the given ID or null, if no WorkflowModel
with the given ID exists.WorkflowException
- Thrown in case an error occurs while fetching the
WorkflowModel
.WorkflowModel getModel(java.lang.String id, java.lang.String version) throws WorkflowException, VersionException
WorkflowModel
with the given ID and
version.id
- The ID of the WorkflowModel
.version
- The version of the WorkflowModel
.WorkflowModel
with the given ID and
version or null, if no WorkflowModel
matches
the given ID and/or version.WorkflowException
- Thrown in case an error occurs while fetching the
WorkflowModel
.VersionException
- Thrown in case the version does not exist or can not be
accessed.Workflow startWorkflow(WorkflowModel model, WorkflowData data) throws WorkflowException
model
- WorkflowModel
to be used for the new
Workflow
instance.data
- WorkflowData
to be attached to the new
workflow instance.Workflow
of the newly started
Workflow
instance.WorkflowException
- Thrown in case the workflow process cannot be started.Workflow startWorkflow(WorkflowModel model, WorkflowData data, java.util.Dictionary<java.lang.String,java.lang.String> metaData) throws WorkflowException
model
- WorkflowModel
to be used for the new
Workflow
instance.data
- WorkflowData
to be attached to the new
workflow instance.metaData
- Meta data assigned to the new Workflow
.Workflow
of the newly started
Workflow
instance.WorkflowException
- Thrown in case the workflow process cannot be started.Workflow startWorkflow(WorkflowModel model, WorkflowData data, java.util.Map<java.lang.String,java.lang.Object> metaData) throws WorkflowException
model
- WorkflowModel
to be used for the new
Workflow
instance.data
- WorkflowData
to be attached to the new
workflow instance.metaData
- Meta data assigned to the new Workflow
.Workflow
of the newly started
Workflow
instance.WorkflowException
- Thrown in case the workflow process cannot be started.void terminateWorkflow(Workflow instance) throws WorkflowException
Workflow
instance.instance
- The Workflow
instance that shall be
terminated.WorkflowException
- Thrown in case the workflow instance cannot be terminated.void resumeWorkflow(Workflow instance) throws WorkflowException
Workflow
instance.instance
- The Workflow
instance that shall be
resumed.WorkflowException
- Thrown in case the workflow instance cannot be resumed.void suspendWorkflow(Workflow instance) throws WorkflowException
Workflow
instance.instance
- The Workflow
of the workflow instance
that shall be suspended.WorkflowException
- Thrown in case the workflow instance cannot be suspended.WorkItem[] getActiveWorkItems() throws WorkflowException
WorkItem
s assigned to an active Workflow
instance and the respective user of the WorkflowSession
will
be returned.WorkItem
s assigned to an active workflow
and the respective users WorkflowSession
.WorkflowException
- Thrown in case an exception occurs while fetching the active
WorkItem
s.ResultSet<WorkItem> getActiveWorkItems(long start, long limit) throws WorkflowException
WorkItem
s assigned to an active Workflow
instance and the respective user of the WorkflowSession
will
be returned.start
- Start index of the result set.limit
- Limit of the result set.WorkItem
s assigned to an active workflow
and the respective users WorkflowSession
.WorkflowException
- Thrown in case an exception occurs while fetching the active
WorkItem
s.ResultSet<WorkItem> getActiveWorkItems(long start, long limit, WorkItemFilter filter) throws WorkflowException
WorkItem
s assigned to an active Workflow
instance and the respective user of the WorkflowSession
will
be returned.start
- Start index of the result set.limit
- Limit of the result set.filter
- filter for work itemsWorkItem
s assigned to an active workflow
and the respective users WorkflowSession
.WorkflowException
- Thrown in case an exception occurs while fetching the active
WorkItem
s.WorkItem[] getAllWorkItems() throws WorkflowException
WorkItem
s assigned to a Workflow
instance and assigned to the respective user of the
WorkflowSession
will be returned.WorkItem
s assigned to a Workflow
instance and the respective users WorkflowSession
.WorkflowException
- Thrown in case an exception occurs while fetching all
WorkItem
s.ResultSet<WorkItem> getAllWorkItems(long start, long limit) throws WorkflowException
WorkItem
s assigned to a Workflow
instance and assigned to the respective user of the
WorkflowSession
will be returned.start
- Start index of the result set.limit
- Limit of the result set.WorkItem
s assigned to a Workflow
instance and the respective users WorkflowSession
.WorkflowException
- Thrown in case an exception occurs while fetching all
WorkItem
s.WorkItem getWorkItem(java.lang.String id) throws WorkflowException
WorkItem
with the given ID assigned to a
Workflow
instance, but only if the respective users
WorkflowSession}
has access to it.id
- The ID of the WorkItem
.WorkItem
with the given ID.WorkflowException
- Thrown in case an exception is occurs while fetching the
WorkItem
.Workflow[] getWorkflows(java.lang.String[] states) throws WorkflowException
Workflow
instances that are in one of
the given states and to which the
WorkflowSession
has access to.states
- The list of states used to select the
Workflow
instances.Workflow
s that are in one of the given
states and to which the WorkflowSession
has
access to.WorkflowException
- Thrown in case an error occurred while retrieving the
Workflow
s.ResultSet<Workflow> getWorkflows(java.lang.String[] states, long start, long limit) throws WorkflowException
Workflow
s instances that are in one of
the given states and to which the
WorkflowSession
has access to.states
- The list of states used to select the
Workflow
instances.start
- Start index of the result set.limit
- Limit of the result set.Workflow
s that are in one of the given
states and to which the WorkflowSession
has
access to.WorkflowException
- Thrown in case an error occurred while retrieving the
Workflow
s.Workflow[] getAllWorkflows() throws WorkflowException
Workflow
s which the
WorkflowSession
has access to.Workflow
s the
WorkflowSession
has access to.WorkflowException
- Thrown in case an error occurred while retrieving the
Workflow
s.Workflow getWorkflow(java.lang.String id) throws WorkflowException
Workflow
instance with the given ID.id
- The ID of the Workflow
instance that
should be returned.Workflow
instance with the given ID or
null, if no Workflow
instance ID matches the
given ID.WorkflowException
- Thrown in case an unexpected error occurs while retrieving
the Workflow
.void complete(WorkItem item, Route route) throws WorkflowException
WorkItem
for the assigned
Workflow
instance and assign to the next
WorkflowNode
according to the given
Route
.item
- The WorkItem
to be completed.route
- The Route
to the destination to be
advanced.WorkflowException
- Thrown in case an error is occurs while completing the
WorkItem
.java.util.List<Route> getRoutes(WorkItem item) throws WorkflowException
Route
to all possible destinations will be
returned. Rules will be already executed, thus all routes that are active
can be selected.item
- The WorkItem
to retrieve routes from.Route
s to advance.WorkflowException
- Thrown in case an error is occurs while evaluating the
Route
s.java.util.List<Route> getRoutes(WorkItem item, boolean expand) throws WorkflowException
Route
to all possible destinations will be
returned. Rules will be already executed, thus all routes that are active
can be selected.item
- The WorkItem
to retrieve routes from.expand
- Expands the group members if the destination points to a
group. Means that not only the group is retourned as route but
as well all group members.Route
s to advance.WorkflowException
- Thrown in case an error is occurs while evaluating the
Route
s.java.util.List<Route> getBackRoutes(WorkItem item) throws WorkflowException
Route
to all possible already passed
destinations will be returned. Rules will be already executed, thus all
routes that are active can be selected.item
- The WorkItem
to retrieve back routes
from.Route
s to advance (back).WorkflowException
- Thrown in case an error is occurs while evaluating the
Route
s.java.util.List<Route> getBackRoutes(WorkItem item, boolean expand) throws WorkflowException
Route
to all possible already passed
destinations will be returned. Rules will be already executed, thus all
routes that are active can be selected.item
- The WorkItem
to retrieve back routes
from.expand
- Expands the group members if the destination points to a
group. Means that not only the group is retourned as route but
as well all group members.Route
s to advance (back).WorkflowException
- Thrown in case an error is occurs while evaluating the
Route
s.WorkflowData newWorkflowData(java.lang.String payloadType, java.lang.Object payload)
WorkflowData
instance based on the
given data.payloadType
- The type of payload for the new
WorkflowData
instance.payload
- The payload object used for creating the new
WorkflowData
instance.
WorkflowData
instance.WorkflowData
instance.java.util.List<Authorizable> getDelegatees(WorkItem item) throws WorkflowException
delegatees
as Authorizable
who are
allowed to take over the WorkItem
item
- The workitemAuthorizable
s who are allowed to act as
delegatees.WorkflowException
- in case the delegatees could not be retrieved for some reasonvoid delegateWorkItem(WorkItem item, Authorizable participant) throws WorkflowException, java.security.AccessControlException
WorkItem
to the specified
Authorizable
.item
- the corresponding workitemparticipant
- the participant to delegatejava.security.AccessControlException
- if the given participant is not allowed to take over the
workitem.WorkflowException
- in case the delegation fails in regards of persisting the
"new" state.java.util.List<HistoryItem> getHistory(Workflow instance) throws WorkflowException
HistoryItem
s is returned for the given Workflow
instance.instance
- Workflow
instanceList
of HistoryItem
sWorkflowException
- in case the history item retrieval failsvoid updateWorkflowData(Workflow instance, WorkflowData data)
WorkflowData
.instance
- The Workflow
instance for which to update the data.data
- The WorkflowData
for the update.void logout()
boolean isSuperuser()
true
if the user is a workflow superuservoid restartWorkflow(Workflow workflow) throws WorkflowException
workflow
- workflowWorkflowException
- in case an error occursCopyright © 2010 - 2020 Adobe. All Rights Reserved