public class ProcessServiceImpl extends Object implements ProcessService, VariablesAware
Modifier and Type | Field and Description |
---|---|
protected RuntimeDataService |
dataService |
protected DeploymentService |
deploymentService |
Constructor and Description |
---|
ProcessServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
abortProcessInstance(Long processInstanceId)
Aborts the specified process
|
void |
abortProcessInstances(List<Long> processInstanceIds)
Aborts all specified processes
|
void |
abortWorkItem(Long id)
Abort the specified workItem
|
protected Collection<String> |
collectActiveSignals(Collection<org.kie.api.runtime.process.NodeInstance> activeNodes) |
void |
completeWorkItem(Long id,
Map<String,Object> results)
Completes the specified WorkItem with the given results
|
protected void |
disallowWhenNotActive(DeployedUnit deployedUnit,
org.kie.api.command.Command<?> cmd) |
protected void |
disposeRuntimeEngine(org.kie.api.runtime.manager.RuntimeManager manager,
org.kie.api.runtime.manager.RuntimeEngine engine) |
<T> T |
execute(String deploymentId,
org.kie.api.command.Command<T> command)
Executes provided command on the underlying command executor (usually KieSession)
|
<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)
|
Collection<String> |
getAvailableSignals(Long processInstanceId)
Returns all signals available in current state of given process instance
|
protected org.kie.api.runtime.manager.Context<?> |
getContext(Map<String,Object> params) |
org.kie.api.runtime.process.ProcessInstance |
getProcessInstance(org.kie.internal.process.CorrelationKey key)
Returns process instance information.
|
org.kie.api.runtime.process.ProcessInstance |
getProcessInstance(Long processInstanceId)
Returns process instance information.
|
Object |
getProcessInstanceVariable(Long processInstanceId,
String variableName)
Gets a process instance's variable.
|
Map<String,Object> |
getProcessInstanceVariables(Long processInstanceId)
Gets a process instance's variable values.
|
org.kie.api.runtime.process.WorkItem |
getWorkItem(Long id)
Returns the specified workItem
|
List<org.kie.api.runtime.process.WorkItem> |
getWorkItemByProcessInstance(Long processInstanceId)
Returns active work items by process instance id.
|
<T> T |
process(T variables,
ClassLoader cl)
Generic processing method that might be simply returning same instance of variables
if no processing is required.
|
void |
setDataService(RuntimeDataService dataService) |
void |
setDeploymentService(DeploymentService deploymentService) |
void |
setProcessVariable(Long processInstanceId,
String variableId,
Object value)
Sets a process variable.
|
void |
setProcessVariables(Long processInstanceId,
Map<String,Object> variables)
Sets process variables.
|
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
|
void |
signalProcessInstance(Long processInstanceId,
String signalName,
Object event)
Signal an event to a single process instance
|
void |
signalProcessInstances(List<Long> processInstanceIds,
String signalName,
Object event)
Signal an event to given list of process instances
|
Long |
startProcess(String deploymentId,
String processId)
Starts a process with no variables
|
Long |
startProcess(String deploymentId,
String processId,
org.kie.internal.process.CorrelationKey correlationKey)
Starts a process with no variables
|
Long |
startProcess(String deploymentId,
String processId,
org.kie.internal.process.CorrelationKey correlationKey,
Map<String,Object> params)
Starts a process with no variables
|
Long |
startProcess(String deploymentId,
String processId,
Map<String,Object> params)
Starts a process with no variables
|
protected DeploymentService deploymentService
protected RuntimeDataService dataService
public void setDeploymentService(DeploymentService deploymentService)
public void setDataService(RuntimeDataService dataService)
public Long startProcess(String deploymentId, String processId)
ProcessService
startProcess
in interface ProcessService
deploymentId
- deployment information for the process's kjarprocessId
- The process's identifierpublic Long startProcess(String deploymentId, String processId, Map<String,Object> params)
ProcessService
startProcess
in interface ProcessService
deploymentId
- deployment information for the process's kjarprocessId
- The process's identifierparams
- process variablespublic Long startProcess(String deploymentId, String processId, org.kie.internal.process.CorrelationKey correlationKey)
ProcessService
startProcess
in interface ProcessService
deploymentId
- deployment information for the process's kjarprocessId
- The process's identifiercorrelationKey
- correlation key to be assigned to process instance - must be uniquepublic Long startProcess(String deploymentId, String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> params)
ProcessService
startProcess
in interface ProcessService
deploymentId
- deployment information for the process's kjarprocessId
- The process's identifiercorrelationKey
- correlation key to be assigned to process instance - must be uniqueparams
- process variablespublic void abortProcessInstance(Long processInstanceId)
ProcessService
abortProcessInstance
in interface ProcessService
processInstanceId
- process instance's unique identifierpublic void abortProcessInstances(List<Long> processInstanceIds)
ProcessService
abortProcessInstances
in interface ProcessService
processInstanceIds
- list of process instance unique identifierspublic void signalProcessInstance(Long processInstanceId, String signalName, Object event)
ProcessService
signalProcessInstance
in interface ProcessService
processInstanceId
- the process instance's unique identifiersignalName
- the signal's id in the processevent
- the event object to be passed in with the eventpublic void signalProcessInstances(List<Long> processInstanceIds, String signalName, Object event)
ProcessService
signalProcessInstances
in interface ProcessService
processInstanceIds
- list of process instance unique identifierssignalName
- the signal's id in the processevent
- the event object to be passed in with the eventpublic void signalEvent(String deployment, String signalName, Object event)
ProcessService
signalEvent
in interface ProcessService
deployment
- information for the process's kjarsignalName
- the signal's id in the processevent
- the event object to be passed in with the eventpublic org.kie.api.runtime.process.ProcessInstance getProcessInstance(Long processInstanceId)
ProcessService
getProcessInstance
in interface ProcessService
processInstanceId
- The process instance's unique identifierpublic org.kie.api.runtime.process.ProcessInstance getProcessInstance(org.kie.internal.process.CorrelationKey key)
ProcessService
getProcessInstance
in interface ProcessService
key
- correlation key assigned to process instancepublic void setProcessVariable(Long processInstanceId, String variableId, Object value)
ProcessService
setProcessVariable
in interface ProcessService
processInstanceId
- The process instance's unique identifier.public void setProcessVariables(Long processInstanceId, Map<String,Object> variables)
ProcessService
setProcessVariables
in interface ProcessService
processInstanceId
- The process instance's unique identifier.variables
- map of process variables (key - variable name, value - variable value)public Object getProcessInstanceVariable(Long processInstanceId, String variableName)
ProcessService
getProcessInstanceVariable
in interface ProcessService
processInstanceId
- the process instance's unique identifier.variableName
- the variable name to get from the process.public Map<String,Object> getProcessInstanceVariables(Long processInstanceId)
ProcessService
getProcessInstanceVariables
in interface ProcessService
processInstanceId
- The process instance's unique identifier.public Collection<String> getAvailableSignals(Long processInstanceId)
ProcessService
getAvailableSignals
in interface ProcessService
processInstanceId
- process instance idpublic void completeWorkItem(Long id, Map<String,Object> results)
ProcessService
completeWorkItem
in interface ProcessService
id
- workItem idresults
- results of the workItempublic void abortWorkItem(Long id)
ProcessService
abortWorkItem
in interface ProcessService
id
- workItem idpublic org.kie.api.runtime.process.WorkItem getWorkItem(Long id)
ProcessService
getWorkItem
in interface ProcessService
id
- workItem idpublic List<org.kie.api.runtime.process.WorkItem> getWorkItemByProcessInstance(Long processInstanceId)
ProcessService
getWorkItemByProcessInstance
in interface ProcessService
processInstanceId
- process instance idpublic <T> T execute(String deploymentId, org.kie.api.command.Command<T> command)
ProcessService
execute
in interface ProcessService
deploymentId
- deployment information for the process's kjarcommand
- actual command for executionpublic <T> T execute(String deploymentId, org.kie.api.runtime.manager.Context<?> context, org.kie.api.command.Command<T> command)
ProcessService
execute
in interface ProcessService
deploymentId
- deployment information for the process's kjarcontext
- context implementation to be used to get runtime enginecommand
- actual command for executionprotected void disallowWhenNotActive(DeployedUnit deployedUnit, org.kie.api.command.Command<?> cmd)
protected Collection<String> collectActiveSignals(Collection<org.kie.api.runtime.process.NodeInstance> activeNodes)
public <T> T process(T variables, ClassLoader cl)
VariablesAware
process
in interface VariablesAware
variables
- object that holds varialble(s)cl
- classloader that shall be used to operate on the variables e.g. project class loaderprotected void disposeRuntimeEngine(org.kie.api.runtime.manager.RuntimeManager manager, org.kie.api.runtime.manager.RuntimeEngine engine)
Copyright © 2001–2016 JBoss by Red Hat. All rights reserved.