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)
ProcessServicestartProcess in interface ProcessServicedeploymentId - deployment information for the process's kjarprocessId - The process's identifierpublic Long startProcess(String deploymentId, String processId, Map<String,Object> params)
ProcessServicestartProcess in interface ProcessServicedeploymentId - 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)
ProcessServicestartProcess in interface ProcessServicedeploymentId - 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)
ProcessServicestartProcess in interface ProcessServicedeploymentId - 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)
ProcessServiceabortProcessInstance in interface ProcessServiceprocessInstanceId - process instance's unique identifierpublic void abortProcessInstances(List<Long> processInstanceIds)
ProcessServiceabortProcessInstances in interface ProcessServiceprocessInstanceIds - list of process instance unique identifierspublic void signalProcessInstance(Long processInstanceId, String signalName, Object event)
ProcessServicesignalProcessInstance in interface ProcessServiceprocessInstanceId - 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)
ProcessServicesignalProcessInstances in interface ProcessServiceprocessInstanceIds - 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)
ProcessServicesignalEvent in interface ProcessServicedeployment - 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)
ProcessServicegetProcessInstance in interface ProcessServiceprocessInstanceId - The process instance's unique identifierpublic org.kie.api.runtime.process.ProcessInstance getProcessInstance(org.kie.internal.process.CorrelationKey key)
ProcessServicegetProcessInstance in interface ProcessServicekey - correlation key assigned to process instancepublic void setProcessVariable(Long processInstanceId, String variableId, Object value)
ProcessServicesetProcessVariable in interface ProcessServiceprocessInstanceId - The process instance's unique identifier.public void setProcessVariables(Long processInstanceId, Map<String,Object> variables)
ProcessServicesetProcessVariables in interface ProcessServiceprocessInstanceId - The process instance's unique identifier.variables - map of process variables (key - variable name, value - variable value)public Object getProcessInstanceVariable(Long processInstanceId, String variableName)
ProcessServicegetProcessInstanceVariable in interface ProcessServiceprocessInstanceId - the process instance's unique identifier.variableName - the variable name to get from the process.public Map<String,Object> getProcessInstanceVariables(Long processInstanceId)
ProcessServicegetProcessInstanceVariables in interface ProcessServiceprocessInstanceId - The process instance's unique identifier.public Collection<String> getAvailableSignals(Long processInstanceId)
ProcessServicegetAvailableSignals in interface ProcessServiceprocessInstanceId - process instance idpublic void completeWorkItem(Long id, Map<String,Object> results)
ProcessServicecompleteWorkItem in interface ProcessServiceid - workItem idresults - results of the workItempublic void abortWorkItem(Long id)
ProcessServiceabortWorkItem in interface ProcessServiceid - workItem idpublic org.kie.api.runtime.process.WorkItem getWorkItem(Long id)
ProcessServicegetWorkItem in interface ProcessServiceid - workItem idpublic List<org.kie.api.runtime.process.WorkItem> getWorkItemByProcessInstance(Long processInstanceId)
ProcessServicegetWorkItemByProcessInstance in interface ProcessServiceprocessInstanceId - process instance idpublic <T> T execute(String deploymentId, org.kie.api.command.Command<T> command)
ProcessServiceexecute in interface ProcessServicedeploymentId - 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)
ProcessServiceexecute in interface ProcessServicedeploymentId - 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)
VariablesAwareprocess in interface VariablesAwarevariables - 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–2017 JBoss by Red Hat. All rights reserved.