Package org.kie.api.runtime.process
Interface ProcessContext
- All Superinterfaces:
KieContext
Represents the context when executing a process.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the node instance that is currently being executed in this context, ornullif no node instance is currently being executed.Returns the process instance that is currently being executed in this context.getVariable(String variableName) Returns the value of the variable with the given name.voidsetVariable(String variableName, Object value) Sets the value of the variable with the given name.Methods inherited from interface org.kie.api.runtime.KieContext
getKieBase, getKieRuntime, getKnowledgeRuntime
-
Method Details
-
getProcessInstance
ProcessInstance getProcessInstance()Returns the process instance that is currently being executed in this context.- Returns:
- the process instance that is currently being executed in this context
-
getNodeInstance
NodeInstance getNodeInstance()Returns the node instance that is currently being executed in this context, ornullif no node instance is currently being executed.- Returns:
- the node instance that is currently being executed in this context
-
getVariable
Returns the value of the variable with the given name. Based on the current node instance, it will try to resolve the given variable, taking nested variable scopes into account. Returnsnullif the variable could not be found.- Parameters:
variableName- the name of the variable- Returns:
- the value of the variable
-
setVariable
Sets the value of the variable with the given name. Based on the current node instance, it will try to resolve the given variable, taking nested variable scopes into account. If the variable cannot be resolved, it will set the value as a process-level variable. It is however recommended to only use this with caution, as it is always recommended to define the variables that are used inside a process.- Parameters:
variableName- the name of the variablevalue- the value of the variable
-