Package org.jbpm.services.api
Interface ProcessService
-
- All Known Subinterfaces:
ProcessServiceEJBLocal,ProcessServiceEJBRemote
- All Known Implementing Classes:
ProcessServiceCDIImpl,ProcessServiceEJBImpl,ProcessServiceImpl
public interface ProcessService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidabortProcessInstance(Long processInstanceId)Aborts the specified processvoidabortProcessInstance(String deploymentId, Long processInstanceId)Aborts the specified processvoidabortProcessInstances(String deploymentId, List<Long> processInstanceIds)Aborts all specified processesvoidabortProcessInstances(List<Long> processInstanceIds)Aborts all specified processesvoidabortWorkItem(Long id)Abort the specified workItemvoidabortWorkItem(String deploymentId, Long processInstanceId, Long id)Abort the specified workItemvoidcompleteWorkItem(Long id, Map<String,Object> results)Completes the specified WorkItem with the given resultsvoidcompleteWorkItem(String deploymentId, Long processInstanceId, Long id, Map<String,Object> results)Completes the specified WorkItem with the given resultsMap<String,Object>computeProcessOutcome(String deploymentId, String processId, Map<String,Object> params)compute the process outcome for those process designed to start and finish in the same transaction.<T> Texecute(String deploymentId, org.kie.api.command.Command<T> command)Executes provided command on the underlying command executor (usually KieSession)<T> Texecute(String deploymentId, org.kie.api.runtime.manager.Context<?> context, org.kie.api.command.Command<T> command)Executes provided command on the underlying command executor (usually KieSession)Collection<String>getAvailableSignals(Long processInstanceId)Returns all signals available in current state of given process instanceCollection<String>getAvailableSignals(String deploymentId, Long processInstanceId)Returns all signals available in current state of given process instanceorg.kie.api.runtime.process.ProcessInstancegetProcessInstance(Long processInstanceId)Returns process instance information.org.kie.api.runtime.process.ProcessInstancegetProcessInstance(String deploymentId, Long processInstanceId)Returns process instance information.org.kie.api.runtime.process.ProcessInstancegetProcessInstance(String deploymentId, org.kie.internal.process.CorrelationKey correlationKey)Returns process instance information.org.kie.api.runtime.process.ProcessInstancegetProcessInstance(org.kie.internal.process.CorrelationKey correlationKey)Returns process instance information.ObjectgetProcessInstanceVariable(Long processInstanceId, String variableName)Gets a process instance's variable.ObjectgetProcessInstanceVariable(String deploymentId, Long processInstanceId, String variableName)Gets a process instance's variable.Map<String,Object>getProcessInstanceVariables(Long processInstanceId)Gets a process instance's variable values.Map<String,Object>getProcessInstanceVariables(String deploymentId, Long processInstanceId)Gets a process instance's variable values.org.kie.api.runtime.process.WorkItemgetWorkItem(Long id)Returns the specified workItemorg.kie.api.runtime.process.WorkItemgetWorkItem(String deploymentId, Long processInstanceId, Long id)Returns the specified workItemList<org.kie.api.runtime.process.WorkItem>getWorkItemByProcessInstance(Long processInstanceId)Returns active work items by process instance id.List<org.kie.api.runtime.process.WorkItem>getWorkItemByProcessInstance(String deploymentId, Long processInstanceId)Returns active work items by process instance id.voidsetProcessVariable(Long processInstanceId, String variableId, Object value)Sets a process variable.voidsetProcessVariable(String deploymentId, Long processInstanceId, String variableId, Object value)Sets a process variable.voidsetProcessVariables(Long processInstanceId, Map<String,Object> variables)Sets process variables.voidsetProcessVariables(String deploymentId, Long processInstanceId, Map<String,Object> variables)Sets process variables.voidsignalEvent(String deployment, String signalName, Object event)Signal an event to a any process instance that listens to give signal that belongs to given deploymentvoidsignalProcessInstance(Long processInstanceId, String signalName, Object event)Signal an event to a single process instancevoidsignalProcessInstance(String deploymentId, Long processInstanceId, String signalName, Object event)Signal an event to a single process instancevoidsignalProcessInstanceByCorrelationKey(String deploymentId, org.kie.internal.process.CorrelationKey correlationKey, String signalName, Object event)Signal an event to a single process instance by correlation keyvoidsignalProcessInstanceByCorrelationKey(org.kie.internal.process.CorrelationKey correlationKey, String signalName, Object event)Signal an event to a single process instance by correlation keyvoidsignalProcessInstances(String deploymentId, List<Long> processInstanceIds, String signalName, Object event)Signal an event to given list of process instancesvoidsignalProcessInstances(List<Long> processInstanceIds, String signalName, Object event)Signal an event to given list of process instancesvoidsignalProcessInstancesByCorrelationKeys(String deploymentId, List<org.kie.internal.process.CorrelationKey> correlationKeys, String signalName, Object event)Signal an event to given list of correlation keysvoidsignalProcessInstancesByCorrelationKeys(List<org.kie.internal.process.CorrelationKey> correlationKeys, String signalName, Object event)Signal an event to given list of correlation keysLongstartProcess(String deploymentId, String processId)Starts a process with no variablesLongstartProcess(String deploymentId, String processId, Map<String,Object> params)Starts a process with no variablesLongstartProcess(String deploymentId, String processId, org.kie.internal.process.CorrelationKey correlationKey)Starts a process with no variablesLongstartProcess(String deploymentId, String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> params)Starts a process with no variablesLongstartProcessFromNodeIds(String deploymentId, String processId, Map<String,Object> params, String... nodeIds)Starts a process with the values supplied from the current nodesLongstartProcessFromNodeIds(String deploymentId, String processId, org.kie.internal.process.CorrelationKey key, Map<String,Object> params, String... nodeIds)Starts a process with the values supplied from the current nodes
-
-
-
Method Detail
-
startProcess
Long startProcess(String deploymentId, String processId)
Starts a process with no variables- Parameters:
deploymentId- deployment information for the process's kjarprocessId- The process's identifier- Returns:
- process instance identifier
- Throws:
RuntimeException- in case of encountered errorsDeploymentNotFoundException- in case deployment with given deployment id does not existDeploymentNotActiveException- in case deployment with given deployment id is not active
-
startProcess
Long startProcess(String deploymentId, String processId, Map<String,Object> params)
Starts a process with no variables- Parameters:
deploymentId- deployment information for the process's kjarprocessId- The process's identifierparams- process variables- Returns:
- process instance identifier
- Throws:
RuntimeException- in case of encountered errorsDeploymentNotFoundException- in case deployment with given deployment id does not existDeploymentNotActiveException- in case deployment with given deployment id is not active
-
computeProcessOutcome
Map<String,Object> computeProcessOutcome(String deploymentId, String processId, Map<String,Object> params)
compute the process outcome for those process designed to start and finish in the same transaction. This functionality allows to retrieve the outcome of process variables- Parameters:
deploymentId- deployment information for the process's kjarprocessId- the process identifierparams- process variables- Returns:
- last modification of process variables.
-
startProcess
Long startProcess(String deploymentId, String processId, org.kie.internal.process.CorrelationKey correlationKey)
Starts a process with no variables- Parameters:
deploymentId- deployment information for the process's kjarprocessId- The process's identifiercorrelationKey- correlation key to be assigned to process instance - must be unique- Returns:
- process instance identifier
- Throws:
RuntimeException- in case of encountered errorsDeploymentNotFoundException- in case deployment with given deployment id does not existDeploymentNotActiveException- in case deployment with given deployment id is not active
-
startProcess
Long startProcess(String deploymentId, String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> params)
Starts a process with no variables- Parameters:
deploymentId- deployment information for the process's kjarprocessId- The process's identifiercorrelationKey- correlation key to be assigned to process instance - must be uniqueparams- process variables- Returns:
- process instance identifier
- Throws:
RuntimeException- in case of encountered errorsDeploymentNotFoundException- in case deployment with given deployment id does not existDeploymentNotActiveException- in case deployment with given deployment id is not active
-
startProcessFromNodeIds
Long startProcessFromNodeIds(String deploymentId, String processId, Map<String,Object> params, String... nodeIds)
Starts a process with the values supplied from the current nodes- Parameters:
deploymentId- deployment information for the process's kjarprocessId- The process's identifierparams- process variablesnodeIds- list of bpmn node id list where the process is going to start- Returns:
- process instance identifier
- Throws:
RuntimeException- in case of encountered errorsDeploymentNotFoundException- in case deployment with given deployment id does not existDeploymentNotActiveException- in case deployment with given deployment id is not active
-
startProcessFromNodeIds
Long startProcessFromNodeIds(String deploymentId, String processId, org.kie.internal.process.CorrelationKey key, Map<String,Object> params, String... nodeIds)
Starts a process with the values supplied from the current nodes- Parameters:
deploymentId- deployment information for the process's kjarprocessId- The process's identifierkey- correlation key (must be unique)params- process variablesnodeIds- list of bpmn node id list where the process is going to start.- Returns:
- process instance identifier
- Throws:
RuntimeException- in case of encountered errorsDeploymentNotFoundException- in case deployment with given deployment id does not existDeploymentNotActiveException- in case deployment with given deployment id is not active
-
abortProcessInstance
void abortProcessInstance(Long processInstanceId)
Aborts the specified process- Parameters:
processInstanceId- process instance's unique identifier- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
abortProcessInstance
void abortProcessInstance(String deploymentId, Long processInstanceId)
Aborts the specified process- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- process instance's unique identifier- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
abortProcessInstances
void abortProcessInstances(List<Long> processInstanceIds)
Aborts all specified processes- Parameters:
processInstanceIds- list of process instance unique identifiers- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
abortProcessInstances
void abortProcessInstances(String deploymentId, List<Long> processInstanceIds)
Aborts all specified processes- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceIds- list of process instance unique identifiers- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
signalProcessInstance
void signalProcessInstance(Long processInstanceId, String signalName, Object event)
Signal an event to a single process instance- Parameters:
processInstanceId- the process instance's unique identifiersignalName- the signal's id in the processevent- the event object to be passed in with the event- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
signalProcessInstance
void signalProcessInstance(String deploymentId, Long processInstanceId, String signalName, Object event)
Signal an event to a single process instance- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- the process instance's unique identifiersignalName- the signal's id in the processevent- the event object to be passed in with the event- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
signalProcessInstances
void signalProcessInstances(List<Long> processInstanceIds, String signalName, Object event)
Signal an event to given list of process instances- Parameters:
processInstanceIds- list of process instance unique identifierssignalName- the signal's id in the processevent- the event object to be passed in with the event- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
signalProcessInstances
void signalProcessInstances(String deploymentId, List<Long> processInstanceIds, String signalName, Object event)
Signal an event to given list of process instances- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceIds- list of process instance unique identifierssignalName- the signal's id in the processevent- the event object to be passed in with the event- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
signalProcessInstanceByCorrelationKey
void signalProcessInstanceByCorrelationKey(org.kie.internal.process.CorrelationKey correlationKey, String signalName, Object event)Signal an event to a single process instance by correlation key- Parameters:
correlationKey- the process instances unique correlation keysignalName- the signals id in the processevent- the event object to be passed in with the event- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
signalProcessInstanceByCorrelationKey
void signalProcessInstanceByCorrelationKey(String deploymentId, org.kie.internal.process.CorrelationKey correlationKey, String signalName, Object event)
Signal an event to a single process instance by correlation key- Parameters:
deploymentId- deployment that process instance belongs tocorrelationKey- the process instances unique correlation keysignalName- the signals id in the processevent- the event object to be passed in with the event- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
signalProcessInstancesByCorrelationKeys
void signalProcessInstancesByCorrelationKeys(List<org.kie.internal.process.CorrelationKey> correlationKeys, String signalName, Object event)
Signal an event to given list of correlation keys- Parameters:
correlationKeys- list of process instance unique correlation keyssignalName- the signal's id in the processevent- the event object to be passed in with the event- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
signalProcessInstancesByCorrelationKeys
void signalProcessInstancesByCorrelationKeys(String deploymentId, List<org.kie.internal.process.CorrelationKey> correlationKeys, String signalName, Object event)
Signal an event to given list of correlation keys- Parameters:
deploymentId- deployment that process instance belongs tocorrelationKeys- list of process instance unique correlation keyssignalName- the signal's id in the processevent- the event object to be passed in with the event- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
signalEvent
void signalEvent(String deployment, String signalName, Object event)
Signal an event to a any process instance that listens to give signal that belongs to given deployment- Parameters:
deployment- information for the process's kjarsignalName- the signal's id in the processevent- the event object to be passed in with the event- Throws:
DeploymentNotFoundException- in case deployment unit was not found
-
getProcessInstance
org.kie.api.runtime.process.ProcessInstance getProcessInstance(Long processInstanceId)
Returns process instance information. Will return null if no active process with that id is found- Parameters:
processInstanceId- The process instance's unique identifier- Returns:
- Process instance information
- Throws:
DeploymentNotFoundException- in case deployment unit was not found
-
getProcessInstance
org.kie.api.runtime.process.ProcessInstance getProcessInstance(String deploymentId, Long processInstanceId)
Returns process instance information. Will return null if no active process with that id is found- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- The process instance's unique identifier- Returns:
- Process instance information
- Throws:
DeploymentNotFoundException- in case deployment unit was not found
-
getProcessInstance
org.kie.api.runtime.process.ProcessInstance getProcessInstance(org.kie.internal.process.CorrelationKey correlationKey)
Returns process instance information. Will return null if no active process with that correlation key is found- Parameters:
correlationKey- correlation key assigned to process instance- Returns:
- Process instance information
- Throws:
DeploymentNotFoundException- in case deployment unit was not found
-
getProcessInstance
org.kie.api.runtime.process.ProcessInstance getProcessInstance(String deploymentId, org.kie.internal.process.CorrelationKey correlationKey)
Returns process instance information. Will return null if no active process with that correlation key is found- Parameters:
deploymentId- deployment that process instance belongs tocorrelationKey- correlation key assigned to process instance- Returns:
- Process instance information
- Throws:
DeploymentNotFoundException- in case deployment unit was not found
-
setProcessVariable
void setProcessVariable(Long processInstanceId, String variableId, Object value)
Sets a process variable.- Parameters:
processInstanceId- The process instance's unique identifier.variableId- The variable id to set.value- The variable value.- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
setProcessVariable
void setProcessVariable(String deploymentId, Long processInstanceId, String variableId, Object value)
Sets a process variable.- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- The process instance's unique identifier.variableId- The variable id to set.value- The variable value.- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
setProcessVariables
void setProcessVariables(Long processInstanceId, Map<String,Object> variables)
Sets process variables.- Parameters:
processInstanceId- The process instance's unique identifier.variables- map of process variables (key - variable name, value - variable value)- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
setProcessVariables
void setProcessVariables(String deploymentId, Long processInstanceId, Map<String,Object> variables)
Sets process variables.- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- The process instance's unique identifier.variables- map of process variables (key - variable name, value - variable value)- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
getProcessInstanceVariable
Object getProcessInstanceVariable(Long processInstanceId, String variableName)
Gets a process instance's variable.- Parameters:
processInstanceId- the process instance's unique identifier.variableName- the variable name to get from the process.- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
getProcessInstanceVariable
Object getProcessInstanceVariable(String deploymentId, Long processInstanceId, String variableName)
Gets a process instance's variable.- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- the process instance's unique identifier.variableName- the variable name to get from the process.- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
getProcessInstanceVariables
Map<String,Object> getProcessInstanceVariables(Long processInstanceId)
Gets a process instance's variable values.- Parameters:
processInstanceId- The process instance's unique identifier.- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
getProcessInstanceVariables
Map<String,Object> getProcessInstanceVariables(String deploymentId, Long processInstanceId)
Gets a process instance's variable values.- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- The process instance's unique identifier.- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
getAvailableSignals
Collection<String> getAvailableSignals(Long processInstanceId)
Returns all signals available in current state of given process instance- Parameters:
processInstanceId- process instance id- Returns:
- list of available signals or empty list if no signals are available
-
getAvailableSignals
Collection<String> getAvailableSignals(String deploymentId, Long processInstanceId)
Returns all signals available in current state of given process instance- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- process instance id- Returns:
- list of available signals or empty list if no signals are available
-
completeWorkItem
void completeWorkItem(Long id, Map<String,Object> results)
Completes the specified WorkItem with the given results- Parameters:
id- workItem idresults- results of the workItem- Throws:
DeploymentNotFoundException- in case deployment unit was not foundWorkItemNotFoundException- in case work item with given id was not found
-
completeWorkItem
void completeWorkItem(String deploymentId, Long processInstanceId, Long id, Map<String,Object> results)
Completes the specified WorkItem with the given results- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- process instance id that work item belongs toid- workItem idresults- results of the workItem- Throws:
DeploymentNotFoundException- in case deployment unit was not foundWorkItemNotFoundException- in case work item with given id was not found
-
abortWorkItem
void abortWorkItem(Long id)
Abort the specified workItem- Parameters:
id- workItem id- Throws:
DeploymentNotFoundException- in case deployment unit was not foundWorkItemNotFoundException- in case work item with given id was not found
-
abortWorkItem
void abortWorkItem(String deploymentId, Long processInstanceId, Long id)
Abort the specified workItem- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- process instance id that work item belongs toid- workItem id- Throws:
DeploymentNotFoundException- in case deployment unit was not foundWorkItemNotFoundException- in case work item with given id was not found
-
getWorkItem
org.kie.api.runtime.process.WorkItem getWorkItem(Long id)
Returns the specified workItem- Parameters:
id- workItem id- Returns:
- The specified workItem
- Throws:
DeploymentNotFoundException- in case deployment unit was not foundWorkItemNotFoundException- in case work item with given id was not found
-
getWorkItem
org.kie.api.runtime.process.WorkItem getWorkItem(String deploymentId, Long processInstanceId, Long id)
Returns the specified workItem- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- process instance id that work item belongs toid- workItem id- Returns:
- The specified workItem
- Throws:
DeploymentNotFoundException- in case deployment unit was not foundWorkItemNotFoundException- in case work item with given id was not found
-
getWorkItemByProcessInstance
List<org.kie.api.runtime.process.WorkItem> getWorkItemByProcessInstance(Long processInstanceId)
Returns active work items by process instance id.- Parameters:
processInstanceId- process instance id- Returns:
- The list of active workItems for the process instance
- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
getWorkItemByProcessInstance
List<org.kie.api.runtime.process.WorkItem> getWorkItemByProcessInstance(String deploymentId, Long processInstanceId)
Returns active work items by process instance id.- Parameters:
deploymentId- deployment that process instance belongs toprocessInstanceId- process instance id- Returns:
- The list of active workItems for the process instance
- Throws:
DeploymentNotFoundException- in case deployment unit was not foundProcessInstanceNotFoundException- in case process instance with given id was not found
-
execute
<T> T execute(String deploymentId, org.kie.api.command.Command<T> command)
Executes provided command on the underlying command executor (usually KieSession)- Parameters:
deploymentId- deployment information for the process's kjarcommand- actual command for execution- Returns:
- results of command execution
- Throws:
DeploymentNotFoundException- in case deployment with given deployment id does not existDeploymentNotActiveException- in case deployment with given deployment id is not active for restricted commands (e.g. start process)
-
execute
<T> T execute(String deploymentId, org.kie.api.runtime.manager.Context<?> context, org.kie.api.command.Command<T> command)
Executes provided command on the underlying command executor (usually KieSession)- Parameters:
deploymentId- deployment information for the process's kjarcontext- context implementation to be used to get runtime enginecommand- actual command for execution- Returns:
- results of command execution
- Throws:
DeploymentNotFoundException- in case deployment with given deployment id does not existDeploymentNotActiveException- in case deployment with given deployment id is not active for restricted commands (e.g. start process)
-
-