Package org.kie.internal.process
Interface CorrelationAwareProcessRuntime
-
public interface CorrelationAwareProcessRuntime
Classes that implement this interface will provide additional capabilities based on correlation. Most important to allow users to define custom correlation keys as an alternative to considered internal process instance id.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.kie.api.runtime.process.ProcessInstance
createProcessInstance(java.lang.String processId, CorrelationKey correlationKey, java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a new process instance (but does not yet start it).org.kie.api.runtime.process.ProcessInstance
getProcessInstance(CorrelationKey correlationKey)
Returns the process instance with the given correlationKey.org.kie.api.runtime.process.ProcessInstance
startProcess(java.lang.String processId, CorrelationKey correlationKey, java.util.Map<java.lang.String,java.lang.Object> parameters)
Start a new process instance.org.kie.api.runtime.process.ProcessInstance
startProcessFromNodeIds(java.lang.String processId, CorrelationKey key, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String... nodeIds)
Starts a process with the values supplied from the current nodes
-
-
-
Method Detail
-
startProcess
org.kie.api.runtime.process.ProcessInstance startProcess(java.lang.String processId, CorrelationKey correlationKey, java.util.Map<java.lang.String,java.lang.Object> parameters)
Start a new process instance. The process (definition) that should be used is referenced by the given process id. Parameters can be passed to the process instance (as name-value pairs), and these will be set as variables of the process instance.- Parameters:
processId
- the id of the process that should be startedcorrelationKey
- custom correlation key that can be used to identify process instanceparameters
- the process variables that should be set when starting the process instance- Returns:
- the
ProcessInstance
that represents the instance of the process that was started
-
createProcessInstance
org.kie.api.runtime.process.ProcessInstance createProcessInstance(java.lang.String processId, CorrelationKey correlationKey, java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a new process instance (but does not yet start it). The process (definition) that should be used is referenced by the given process id. Parameters can be passed to the process instance (as name-value pairs), and these will be set as variables of the process instance. You should only use this method if you need a reference to the process instance before actually starting it. Otherwise, use startProcess.- Parameters:
processId
- the id of the process that should be startedcorrelationKey
- custom correlation key that can be used to identify process instanceparameters
- the process variables that should be set when creating the process instance- Returns:
- the
ProcessInstance
that represents the instance of the process that was created (but not yet started)
-
startProcessFromNodeIds
org.kie.api.runtime.process.ProcessInstance startProcessFromNodeIds(java.lang.String processId, CorrelationKey key, java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String... nodeIds)
Starts a process with the values supplied from the current nodes- Parameters:
processId
- The process's identifiercorrelationKey
- correlation key to be assigned to process instance - must be uniqueparams
- process variablesnodeIds
- list of unique node ids that would be triggered once the process is created- Returns:
- process instance identifier
- Throws:
java.lang.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
-
getProcessInstance
org.kie.api.runtime.process.ProcessInstance getProcessInstance(CorrelationKey correlationKey)
Returns the process instance with the given correlationKey. Note that only active process instances will be returned. If a process instance has been completed already, this method will returnnull
.- Parameters:
correlationKey
- the custom correlation key assigned when process instance was created- Returns:
- the process instance with the given id or
null
if it cannot be found
-
-