|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WorkflowSession
The WorkflowSession class provides all functionality
(depending on the users rights) for managing WorkflowModels,
Workflow instances and their execution.
It provides methods to:
WorkItems assigned to a user/group
| Method Summary | |
|---|---|
void |
complete(WorkItem item,
Route route)
Completes the for the assigned
instance and assign to the next
according to the given
. |
WorkflowModel |
createNewModel(String title)
Creates a new blank . |
void |
delegateWorkItem(WorkItem item,
Authorizable participant)
Delegates the WorkItem to the specified
Authorizable. |
void |
deleteModel(String id)
Deletes the given . |
void |
deployModel(WorkflowModel model)
Deploys a new or modified . |
boolean |
evaluate(WorkflowData data,
String rule)
Evaluate the passed rule by choosing the right rule engine. |
WorkItem[] |
getActiveWorkItems()
All s assigned to an active
Workflow instance and the respective user of the
WorkflowSession will be returned. |
Workflow[] |
getAllWorkflows()
Returns all Workflows which the
has access to. |
WorkItem[] |
getAllWorkItems()
All s assigned to a Workflow
instance and assigned to the respective user of the
WorkflowSession will be returned. |
List<Route> |
getBackRoutes(WorkItem item)
All to all possible already passed
destinations will be returned. |
List<Authorizable> |
getDelegatees(WorkItem item)
Returns all delegatees as Authorizable who
are allowed to take over the WorkItem |
List<HistoryItem> |
getHistory(Workflow instance)
The complete ordered list of HistoryItems
is returned for the given Workflow instance. |
WorkflowModel |
getModel(String id)
Returns newest version of the with
the given ID. |
WorkflowModel |
getModel(String id,
String version)
Returns the with the given ID and
version. |
WorkflowModel[] |
getModels()
Returns newest versions of all deployed s. |
List<Route> |
getRoutes(WorkItem item)
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(String id)
Retrieve the instance with the given ID. |
Workflow[] |
getWorkflows(String[] states)
Returns all |
WorkflowService |
getWorkflowService()
Returns the that was used to
create the WorkflowSession instance. |
WorkItem |
getWorkItem(String id)
Returns the with the given ID assigned to
a Workflow instance, but only if the respective users
WorkflowSession} has access to it. |
void |
logout()
The logout method has to be called in order to clean up all jcr session references. |
WorkflowData |
newWorkflowData(String payloadType,
Object payload)
Creates a new instance based on the
given data. |
void |
resumeWorkflow(Workflow instance)
Resumes the given Workflow instance. |
Workflow |
startWorkflow(WorkflowModel model,
WorkflowData data)
Start a new Workflow instance with the given
and
. |
Workflow |
startWorkflow(WorkflowModel model,
WorkflowData data,
Dictionary<String,String> metaData)
Start a new Workflow instance with the given
and
. |
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. |
| Method Detail |
|---|
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,
String rule)
data - workflow data to apply the rulerule - rule to execute
true 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(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.
void deleteModel(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
WorkflowModels.
WorkflowModel at their newest
versions.
WorkflowException - Thrown in case an error occurs while fetching the
WorkflowModels.
WorkflowModel getModel(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(String id,
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
Workflow instance with the given
WorkflowModel and
WorkflowData.
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,
Dictionary<String,String> metaData)
throws WorkflowException
Workflow instance with the given
WorkflowModel and
WorkflowData.
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
WorkItems assigned to an active
Workflow instance and the respective user of the
WorkflowSession will be returned.
WorkItems assigned to an active
workflow and the respective users WorkflowSession.
WorkflowException - Thrown in case an exception occurs while fetching the active
WorkItems.
WorkItem[] getAllWorkItems()
throws WorkflowException
WorkItems assigned to a Workflow
instance and assigned to the respective user of the
WorkflowSession will be returned.
WorkItems assigned to a
Workflow instance and the respective users
WorkflowSession.
WorkflowException - Thrown in case an exception occurs while fetching all
WorkItems.
WorkItem getWorkItem(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(String[] states)
throws WorkflowException
Workflows instances that are in one of
the given states and to which the
WorkflowSession has access to.
- Parameters:
states - The list of states used to select the
Workflow instances.
- Returns:
- All
Workflows that are in one of the given
states and to which the
WorkflowSession has access to.
- Throws:
WorkflowException - Thrown in case an error occurred while retrieving the
Workflows.
Workflow[] getAllWorkflows()
throws WorkflowException
Workflows which the
WorkflowSession has access to.
Workflows the
WorkflowSession has access to.
WorkflowException - Thrown in case an error occurred while retrieving the
Workflows.
Workflow getWorkflow(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.
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.
Routes to advance.
WorkflowException - Thrown in case an error is occurs while evaluating the
Routes.
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.
Routes to advance (back).
WorkflowException - Thrown in case an error is occurs while evaluating the
Routes.
WorkflowData newWorkflowData(String payloadType,
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.
List<Authorizable> getDelegatees(WorkItem item)
throws WorkflowException
delegatees as Authorizable who
are allowed to take over the WorkItem
item - The workitem
Authorizables who are allowed to act
as delegatees.
WorkflowException - in case the delegatees could not be retrieved for some reason
void delegateWorkItem(WorkItem item,
Authorizable participant)
throws WorkflowException,
AccessControlException
WorkItem to the specified
Authorizable.
item - the corresponding workitemparticipant - the participant to delegate
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.
List<HistoryItem> getHistory(Workflow instance)
throws WorkflowException
HistoryItems
is returned for the given Workflow instance.
instance - Workflow instance
List of HistoryItems
WorkflowException - in case the history item retrieval fails
void updateWorkflowData(Workflow instance,
WorkflowData data)
WorkflowData.
instance - The Workflow instance for which to update the data.data - The WorkflowData for the update.void logout()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||