public interface JbpmService
The returned value are detached from their hibernate session.
The methods on document assume a single document attached to a process. The variables 'documentId' and 'documentRepositoryName' should exists. Security is only implemented in such a case.
Warning: The returned result of most of the methods are list issue from hibernate query. Also the object are fully loaded, their dependent objects might not have been fetch. If you need dependent object, use the executeJbpmOperation making sure those object are properly loaded inside the operation.
Modifier and Type | Interface and Description |
---|---|
static class |
JbpmService.HibernateQueries
Named hibernate queries.
|
static class |
JbpmService.TaskVariableName
Task variable.
|
static class |
JbpmService.VariableName
The variable used as process instance variables.
|
Modifier and Type | Field and Description |
---|---|
static String |
ACL_PREFIX
Marker for acls managed by workflow.
|
Modifier and Type | Method and Description |
---|---|
ProcessInstance |
createProcessInstance(NuxeoPrincipal user,
String processInstanceName,
DocumentModel dm,
Map<String,Serializable> variables,
Map<String,Serializable> transientVariables)
Returns the created and started process instance.
|
void |
deleteProcessInstance(NuxeoPrincipal principal,
Long processId)
Deletes the process instance and related tasks.
|
void |
deleteTaskInstance(NuxeoPrincipal principal,
Long taskId)
Deletes a task instance (attached to a process or not)
|
void |
endProcessInstance(Long processId)
Terminates this process and all the tokens in it.
|
void |
endTask(Long taskInstanceId,
String transition,
Map<String,Serializable> taskVariables,
Map<String,Serializable> variables,
Map<String,Serializable> transientVariables,
NuxeoPrincipal principal)
Ends the task following the transition.
|
Serializable |
executeJbpmOperation(JbpmOperation operation)
Executes a JbpmOperation.
|
List<String> |
getAvailableTransitions(Long taskInstanceId,
NuxeoPrincipal principal)
Returns a list of of possible transition for this user.
|
JbpmConfiguration |
getConfiguration()
Return the configuration.
|
List<ProcessInstance> |
getCurrentProcessInstances(List<String> actors,
JbpmActorsListFilter filter)
Returns a list of all current process instances that has been started by
one of the actors in the list.
|
List<ProcessInstance> |
getCurrentProcessInstances(NuxeoPrincipal principal,
JbpmListFilter filter)
Returns a list of all current process instances this user has started.
|
List<TaskInstance> |
getCurrentTaskInstances(List<String> actors,
JbpmActorsListFilter filter)
Returns a list of task instances assigned to one of the actors in the
list or to its pool.
|
List<TaskInstance> |
getCurrentTaskInstances(NuxeoPrincipal currentUser,
JbpmListFilter filter)
Returns a list of task instances assigned to this user or one of its
group.
|
DocumentModel |
getDocumentModel(ProcessInstance pi,
NuxeoPrincipal user)
Returns the document used in this process.
|
DocumentModel |
getDocumentModel(TaskInstance ti,
NuxeoPrincipal user)
Returns the document used in this task.
|
Boolean |
getPermission(ProcessInstance pi,
JbpmSecurityPolicy.Action action,
DocumentModel dm,
NuxeoPrincipal principal)
Returns true if this user has this permission for this process instance
and document.
|
ProcessDefinition |
getProcessDefinitionByName(String name)
Returns the latest process definition with this name.
|
List<ProcessDefinition> |
getProcessDefinitions(NuxeoPrincipal user,
DocumentModel dm,
JbpmListFilter filter)
Returns a list of available Process Definition Name available for this
document and user.
|
List<ProcessDefinition> |
getProcessDefinitionsByType(String type)
Returns the latest process definitions attached to a type.
|
ProcessInstance |
getProcessInstance(Long processInstanceId)
Return the process instance.
|
List<ProcessInstance> |
getProcessInstances(DocumentModel dm,
NuxeoPrincipal user,
JbpmListFilter jbpmListFilter)
Returns the list of process instances associated with this document.
|
List<TaskInstance> |
getTaskInstances(DocumentModel dm,
List<String> actors,
JbpmActorsListFilter jbpmActorsListFilter)
Returns the list of task instances associated with this document assigned
to one of the actor in the list or its pool.
|
List<TaskInstance> |
getTaskInstances(DocumentModel dm,
NuxeoPrincipal user,
JbpmListFilter jbpmListFilter)
Returns the list of task instances associated with this document for
which the user is the actor or belongs to the pooled actor list.
|
List<TaskInstance> |
getTaskInstances(Long processInstanceId,
NuxeoPrincipal principal,
JbpmListFilter filter)
Returns a list of task instance for this process instance.
|
Map<String,List<String>> |
getTypeFilterConfiguration()
Returns a map, whose key is the type of document, and value is a list of
process definitions.
|
void |
notifyEventListeners(String name,
String comment,
String[] recipients,
CoreSession session,
NuxeoPrincipal principal,
DocumentModel doc)
Notify the event producer on the machine the jbpm service is.
|
ProcessInstance |
persistProcessInstance(ProcessInstance pi)
Persists a process instance.
|
void |
saveTaskInstances(List<TaskInstance> taskInstances)
Saves the task instances.
|
static final String ACL_PREFIX
JbpmConfiguration getConfiguration()
Serializable executeJbpmOperation(JbpmOperation operation) throws NuxeoJbpmException
The JbpmOperation will be executed inside a context block.
operation
- NuxeoJbpmException
List<TaskInstance> getCurrentTaskInstances(NuxeoPrincipal currentUser, JbpmListFilter filter) throws NuxeoJbpmException
currentUser
- the user.IllegalStateException
- If the currentUser is null.NuxeoJbpmException
List<TaskInstance> getCurrentTaskInstances(List<String> actors, JbpmActorsListFilter filter) throws NuxeoJbpmException
actors
- a list used as actorId to retrieve the tasks.filter
- NuxeoJbpmException
List<TaskInstance> getTaskInstances(Long processInstanceId, NuxeoPrincipal principal, JbpmListFilter filter) throws NuxeoJbpmException
processInstanceId
- the id of the process instance.principal
- NuxeoJbpmException
void endTask(Long taskInstanceId, String transition, Map<String,Serializable> taskVariables, Map<String,Serializable> variables, Map<String,Serializable> transientVariables, NuxeoPrincipal principal) throws NuxeoJbpmException
taskInstanceId
- transition
- the transition to followtaskVariables
- the variables attached to the task.variables
- A list a variables to add to the process instance.transientVariables
- the list of transient variables.principal
- the user ending the task. Might be different from
task.getActorId()NuxeoJbpmSecurityRuntimeException
- If a document is attached to
the process and the transition is not allowed for user.NuxeoJbpmException
List<String> getAvailableTransitions(Long taskInstanceId, NuxeoPrincipal principal) throws NuxeoJbpmException
taskInstanceId
- the id of the taskInstance.principal
- the userNuxeoJbpmException
void saveTaskInstances(List<TaskInstance> taskInstances) throws NuxeoJbpmException
Tasks are created or updated if they already exist.
taskInstances
- NuxeoJbpmException
void deleteProcessInstance(NuxeoPrincipal principal, Long processId) throws NuxeoJbpmException
If you don't want to delete the process, add a abandon state and suitable transitions.
principal
- the canceller.NuxeoJbpmException
void deleteTaskInstance(NuxeoPrincipal principal, Long taskId) throws NuxeoJbpmException
principal
- the canceller.NuxeoJbpmException
List<ProcessInstance> getCurrentProcessInstances(NuxeoPrincipal principal, JbpmListFilter filter) throws NuxeoJbpmException
principal
- IllegalStateException
- If the principal is null.NuxeoJbpmException
List<ProcessInstance> getCurrentProcessInstances(List<String> actors, JbpmActorsListFilter filter) throws NuxeoJbpmException
actors
- A list of string that would be used as actorId to retrieve
the process instances.filter
- NuxeoJbpmException
ProcessInstance getProcessInstance(Long processInstanceId) throws NuxeoJbpmException
processInstanceId
- the id of the process instance.NuxeoJbpmException
ProcessInstance createProcessInstance(NuxeoPrincipal user, String processInstanceName, DocumentModel dm, Map<String,Serializable> variables, Map<String,Serializable> transientVariables) throws NuxeoJbpmException
processInstanceName
- the name of the processuser
- the initiator of the process.dm
- the document attached to this process.variables
- A list a variables to add to the process instance.transientVariables
- the list of transient variables.NuxeoJbpmException
NuxeoJbpmSecurityException
- If the user is not allowed to create a
process instance for this document.List<ProcessDefinition> getProcessDefinitions(NuxeoPrincipal user, DocumentModel dm, JbpmListFilter filter) throws NuxeoJbpmException
null
. The
returned process definition is always the latest.user
- the caller.dm
- the document concerned by the processNuxeoJbpmException
List<ProcessDefinition> getProcessDefinitionsByType(String type) throws NuxeoJbpmException
Matching between type and process definition is done in the typeFilter extension point of the service.
type
- the type.NuxeoJbpmException
ProcessDefinition getProcessDefinitionByName(String name) throws NuxeoJbpmException
name
- the Name.NuxeoJbpmException
void endProcessInstance(Long processId) throws NuxeoJbpmException
processId
- the id of the process instance.NuxeoJbpmException
ProcessInstance persistProcessInstance(ProcessInstance pi) throws NuxeoJbpmException
NuxeoJbpmException
DocumentModel getDocumentModel(TaskInstance ti, NuxeoPrincipal user) throws NuxeoJbpmException
ti
- the task.user
- the user.NuxeoJbpmException
DocumentModel getDocumentModel(ProcessInstance pi, NuxeoPrincipal user) throws NuxeoJbpmException
pi
- the process instance.user
- the user.NuxeoJbpmException
List<TaskInstance> getTaskInstances(DocumentModel dm, NuxeoPrincipal user, JbpmListFilter jbpmListFilter) throws NuxeoJbpmException
If the user is null, then it returns all task instances for the document.
dm
- the document.user
- NuxeoJbpmException
List<TaskInstance> getTaskInstances(DocumentModel dm, List<String> actors, JbpmActorsListFilter jbpmActorsListFilter) throws NuxeoJbpmException
dm
- actors
- jbpmActorsListFilter
- NuxeoJbpmException
List<ProcessInstance> getProcessInstances(DocumentModel dm, NuxeoPrincipal user, JbpmListFilter jbpmListFilter) throws NuxeoJbpmException
dm
- user
- NuxeoJbpmException
Map<String,List<String>> getTypeFilterConfiguration()
Boolean getPermission(ProcessInstance pi, JbpmSecurityPolicy.Action action, DocumentModel dm, NuxeoPrincipal principal) throws NuxeoJbpmException
pi
- action
- dm
- principal
- NuxeoJbpmException
extention point
void notifyEventListeners(String name, String comment, String[] recipients, CoreSession session, NuxeoPrincipal principal, DocumentModel doc) throws ClientException
name
- the name of the eventcomment
- the commentrecipients
- the recipients property of the event contextClientException
Copyright © 2012 Nuxeo SA. All Rights Reserved.