public class JbpmServiceImpl extends Object implements JbpmService
JbpmService.HibernateQueries, JbpmService.TaskVariableName, JbpmService.VariableName
Modifier and Type | Field and Description |
---|---|
static ThreadLocal<JbpmContext> |
contexts |
ACL_PREFIX
Constructor and Description |
---|
JbpmServiceImpl() |
Modifier and Type | Method and Description |
---|---|
ProcessInstance |
createProcessInstance(NuxeoPrincipal user,
String processDefinitionName,
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 filter)
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 filter)
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.
|
boolean |
isTransactionEnabled(JbpmContext context) |
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.
|
public static final ThreadLocal<JbpmContext> contexts
public Serializable executeJbpmOperation(JbpmOperation operation) throws NuxeoJbpmException
JbpmService
The JbpmOperation will be executed inside a context block.
executeJbpmOperation
in interface JbpmService
NuxeoJbpmException
public JbpmConfiguration getConfiguration()
JbpmService
getConfiguration
in interface JbpmService
public boolean isTransactionEnabled(JbpmContext context)
public List<TaskInstance> getCurrentTaskInstances(NuxeoPrincipal currentUser, JbpmListFilter filter) throws NuxeoJbpmException
JbpmService
getCurrentTaskInstances
in interface JbpmService
currentUser
- the user.NuxeoJbpmException
public ProcessInstance createProcessInstance(NuxeoPrincipal user, String processDefinitionName, DocumentModel dm, Map<String,Serializable> variables, Map<String,Serializable> transientVariables) throws NuxeoJbpmException
JbpmService
createProcessInstance
in interface JbpmService
user
- the initiator of the process.processDefinitionName
- the name of the processdm
- the document attached to this process.variables
- A list a variables to add to the process instance.transientVariables
- the list of transient variables.NuxeoJbpmException
public List<ProcessInstance> getCurrentProcessInstances(NuxeoPrincipal principal, JbpmListFilter filter) throws NuxeoJbpmException
JbpmService
getCurrentProcessInstances
in interface JbpmService
NuxeoJbpmException
public DocumentModel getDocumentModel(TaskInstance ti, NuxeoPrincipal user) throws NuxeoJbpmException
JbpmService
getDocumentModel
in interface JbpmService
ti
- the task.user
- the user.NuxeoJbpmException
public DocumentModel getDocumentModel(ProcessInstance pi, NuxeoPrincipal user) throws NuxeoJbpmException
JbpmService
getDocumentModel
in interface JbpmService
pi
- the process instance.user
- the user.NuxeoJbpmException
public List<ProcessInstance> getProcessInstances(DocumentModel dm, NuxeoPrincipal user, JbpmListFilter jbpmListFilter) throws NuxeoJbpmException
JbpmService
getProcessInstances
in interface JbpmService
NuxeoJbpmException
public List<TaskInstance> getTaskInstances(DocumentModel dm, NuxeoPrincipal user, JbpmListFilter filter) throws NuxeoJbpmException
JbpmService
If the user is null, then it returns all task instances for the document.
getTaskInstances
in interface JbpmService
dm
- the document.NuxeoJbpmException
public void endProcessInstance(Long processId) throws NuxeoJbpmException
JbpmService
endProcessInstance
in interface JbpmService
processId
- the id of the process instance.NuxeoJbpmException
public void endTask(Long taskInstanceId, String transition, Map<String,Serializable> taskVariables, Map<String,Serializable> variables, Map<String,Serializable> transientVariables, NuxeoPrincipal principal) throws NuxeoJbpmException
JbpmService
endTask
in interface JbpmService
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()NuxeoJbpmException
public List<String> getAvailableTransitions(Long taskInstanceId, NuxeoPrincipal principal) throws NuxeoJbpmException
JbpmService
getAvailableTransitions
in interface JbpmService
taskInstanceId
- the id of the taskInstance.principal
- the userNuxeoJbpmException
public ProcessInstance getProcessInstance(Long processInstanceId) throws NuxeoJbpmException
JbpmService
getProcessInstance
in interface JbpmService
processInstanceId
- the id of the process instance.NuxeoJbpmException
public List<TaskInstance> getTaskInstances(Long processInstanceId, NuxeoPrincipal principal, JbpmListFilter filter) throws NuxeoJbpmException
JbpmService
getTaskInstances
in interface JbpmService
processInstanceId
- the id of the process instance.NuxeoJbpmException
public void saveTaskInstances(List<TaskInstance> taskInstances) throws NuxeoJbpmException
JbpmService
Tasks are created or updated if they already exist.
saveTaskInstances
in interface JbpmService
NuxeoJbpmException
public List<ProcessDefinition> getProcessDefinitions(NuxeoPrincipal user, DocumentModel dm, JbpmListFilter filter) throws NuxeoJbpmException
JbpmService
null
. The
returned process definition is always the latest.getProcessDefinitions
in interface JbpmService
user
- the caller.dm
- the document concerned by the processNuxeoJbpmException
public Boolean getPermission(ProcessInstance pi, JbpmSecurityPolicy.Action action, DocumentModel dm, NuxeoPrincipal principal) throws NuxeoJbpmException
JbpmService
getPermission
in interface JbpmService
NuxeoJbpmException
extention point
public ProcessInstance persistProcessInstance(ProcessInstance pi) throws NuxeoJbpmException
JbpmService
persistProcessInstance
in interface JbpmService
NuxeoJbpmException
public Map<String,List<String>> getTypeFilterConfiguration()
JbpmService
getTypeFilterConfiguration
in interface JbpmService
public void deleteProcessInstance(NuxeoPrincipal principal, Long processId) throws NuxeoJbpmException
JbpmService
If you don't want to delete the process, add a abandon state and suitable transitions.
deleteProcessInstance
in interface JbpmService
principal
- the canceller.NuxeoJbpmException
public void deleteTaskInstance(NuxeoPrincipal principal, Long taskId) throws NuxeoJbpmException
JbpmService
deleteTaskInstance
in interface JbpmService
principal
- the canceller.NuxeoJbpmException
public ProcessDefinition getProcessDefinitionByName(String name) throws NuxeoJbpmException
JbpmService
getProcessDefinitionByName
in interface JbpmService
name
- the Name.NuxeoJbpmException
public List<ProcessDefinition> getProcessDefinitionsByType(String type) throws NuxeoJbpmException
JbpmService
Matching between type and process definition is done in the typeFilter extension point of the service.
getProcessDefinitionsByType
in interface JbpmService
type
- the type.NuxeoJbpmException
public List<ProcessInstance> getCurrentProcessInstances(List<String> actors, JbpmActorsListFilter filter) throws NuxeoJbpmException
JbpmService
getCurrentProcessInstances
in interface JbpmService
actors
- A list of string that would be used as actorId to retrieve
the process instances.NuxeoJbpmException
public List<TaskInstance> getCurrentTaskInstances(List<String> actors, JbpmActorsListFilter filter) throws NuxeoJbpmException
JbpmService
getCurrentTaskInstances
in interface JbpmService
actors
- a list used as actorId to retrieve the tasks.NuxeoJbpmException
public List<TaskInstance> getTaskInstances(DocumentModel dm, List<String> actors, JbpmActorsListFilter filter) throws NuxeoJbpmException
JbpmService
getTaskInstances
in interface JbpmService
NuxeoJbpmException
public void notifyEventListeners(String name, String comment, String[] recipients, CoreSession session, NuxeoPrincipal principal, DocumentModel doc) throws ClientException
JbpmService
notifyEventListeners
in interface JbpmService
name
- the name of the eventcomment
- the commentrecipients
- the recipients property of the event contextClientException
Copyright © 2011 Nuxeo SA. All Rights Reserved.