Package org.jbpm.process.instance.impl
Class ProcessInstanceImpl
- java.lang.Object
-
- org.jbpm.process.instance.impl.ProcessInstanceImpl
-
- All Implemented Interfaces:
Serializable
,ContextableInstance
,ContextInstanceContainer
,ProcessInstance
,org.kie.api.runtime.process.EventListener
,org.kie.api.runtime.process.ProcessInstance
- Direct Known Subclasses:
WorkflowProcessInstanceImpl
public abstract class ProcessInstanceImpl extends Object implements ProcessInstance, Serializable
Default implementation of a process instance.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProcessInstanceImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addContextInstance(String contextId, ContextInstance contextInstance)
void
disconnect()
org.kie.api.runtime.rule.Agenda
getAgenda()
ContextContainer
getContextContainer()
ContextInstance
getContextInstance(String contextId)
ContextInstance
getContextInstance(String contextId, long id)
ContextInstance
getContextInstance(Context context)
List<ContextInstance>
getContextInstances(String contextId)
String
getDescription()
String[]
getEventTypes()
long
getId()
org.drools.core.common.InternalKnowledgeRuntime
getKnowledgeRuntime()
Map<String,Object>
getMetaData()
String
getOutcome()
long
getParentProcessInstanceId()
org.kie.api.definition.process.Process
getProcess()
String
getProcessId()
String
getProcessName()
String
getProcessXml()
int
getState()
void
internalSetState(int state)
protected abstract void
internalStart(String trigger)
void
reconnect()
void
removeContextInstance(String contextId, ContextInstance contextInstance)
void
setContextInstance(String contextId, ContextInstance contextInstance)
void
setDescription(String description)
void
setId(long id)
void
setKnowledgeRuntime(org.drools.core.common.InternalKnowledgeRuntime kruntime)
void
setMetaData(String name, Object data)
void
setOutcome(String outcome)
void
setParentProcessInstanceId(long parentProcessInstanceId)
void
setProcess(org.kie.api.definition.process.Process process)
void
setProcessId(String processId)
void
setProcessXml(String processXml)
void
setState(int state)
void
setState(int state, String outcome)
void
signalEvent(String type, Object event)
void
start()
void
start(String trigger)
String
toString()
void
updateProcess(org.kie.api.definition.process.Process process)
This will update the process definition of only this process instance.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jbpm.process.instance.ProcessInstance
configureSLA, getAgendaFilter, getDeploymentId, getFaultData, getSlaCompliance, getSlaDueDate, getStartDate, isSignalCompletion, setAgendaFilter, setDeploymentId, setSignalCompletion, setState
-
-
-
-
Method Detail
-
setId
public void setId(long id)
- Specified by:
setId
in interfaceProcessInstance
-
getId
public long getId()
- Specified by:
getId
in interfaceorg.kie.api.runtime.process.ProcessInstance
-
setProcess
public void setProcess(org.kie.api.definition.process.Process process)
- Specified by:
setProcess
in interfaceProcessInstance
-
updateProcess
public void updateProcess(org.kie.api.definition.process.Process process)
This will update the process definition of only this process instance. The new process definition will be stored as part of the binary process instance state. Upon reconnect, the process will be restored from binary state and rebuilt (recompiled). This has some limitations though: - the process definition should roundtrip completely through the XmlProcessDumperFactory - any modification to the process cannot involve any generated rules as only the process itself is updated- Parameters:
process
- the new process definition
-
getProcessXml
public String getProcessXml()
-
setProcessXml
public void setProcessXml(String processXml)
-
getProcess
public org.kie.api.definition.process.Process getProcess()
- Specified by:
getProcess
in interfaceProcessInstance
- Specified by:
getProcess
in interfaceorg.kie.api.runtime.process.ProcessInstance
-
setProcessId
public void setProcessId(String processId)
-
getProcessId
public String getProcessId()
- Specified by:
getProcessId
in interfaceorg.kie.api.runtime.process.ProcessInstance
-
getProcessName
public String getProcessName()
- Specified by:
getProcessName
in interfaceorg.kie.api.runtime.process.ProcessInstance
-
setState
public void setState(int state)
- Specified by:
setState
in interfaceProcessInstance
-
setState
public void setState(int state, String outcome)
- Specified by:
setState
in interfaceProcessInstance
-
internalSetState
public void internalSetState(int state)
-
getState
public int getState()
- Specified by:
getState
in interfaceorg.kie.api.runtime.process.ProcessInstance
-
setKnowledgeRuntime
public void setKnowledgeRuntime(org.drools.core.common.InternalKnowledgeRuntime kruntime)
- Specified by:
setKnowledgeRuntime
in interfaceProcessInstance
-
getKnowledgeRuntime
public org.drools.core.common.InternalKnowledgeRuntime getKnowledgeRuntime()
- Specified by:
getKnowledgeRuntime
in interfaceProcessInstance
-
getAgenda
public org.kie.api.runtime.rule.Agenda getAgenda()
-
getContextContainer
public ContextContainer getContextContainer()
- Specified by:
getContextContainer
in interfaceContextInstanceContainer
-
setContextInstance
public void setContextInstance(String contextId, ContextInstance contextInstance)
-
getContextInstance
public ContextInstance getContextInstance(String contextId)
- Specified by:
getContextInstance
in interfaceContextableInstance
-
getContextInstances
public List<ContextInstance> getContextInstances(String contextId)
- Specified by:
getContextInstances
in interfaceContextInstanceContainer
-
addContextInstance
public void addContextInstance(String contextId, ContextInstance contextInstance)
- Specified by:
addContextInstance
in interfaceContextInstanceContainer
-
removeContextInstance
public void removeContextInstance(String contextId, ContextInstance contextInstance)
- Specified by:
removeContextInstance
in interfaceContextInstanceContainer
-
getContextInstance
public ContextInstance getContextInstance(String contextId, long id)
- Specified by:
getContextInstance
in interfaceContextInstanceContainer
-
getContextInstance
public ContextInstance getContextInstance(Context context)
- Specified by:
getContextInstance
in interfaceContextInstanceContainer
-
signalEvent
public void signalEvent(String type, Object event)
- Specified by:
signalEvent
in interfaceorg.kie.api.runtime.process.EventListener
-
start
public void start()
- Specified by:
start
in interfaceProcessInstance
-
start
public void start(String trigger)
- Specified by:
start
in interfaceProcessInstance
-
internalStart
protected abstract void internalStart(String trigger)
-
disconnect
public void disconnect()
-
reconnect
public void reconnect()
-
getEventTypes
public String[] getEventTypes()
- Specified by:
getEventTypes
in interfaceorg.kie.api.runtime.process.EventListener
-
getMetaData
public Map<String,Object> getMetaData()
- Specified by:
getMetaData
in interfaceProcessInstance
-
setOutcome
public void setOutcome(String outcome)
-
getOutcome
public String getOutcome()
- Specified by:
getOutcome
in interfaceProcessInstance
-
getParentProcessInstanceId
public long getParentProcessInstanceId()
- Specified by:
getParentProcessInstanceId
in interfaceorg.kie.api.runtime.process.ProcessInstance
-
setParentProcessInstanceId
public void setParentProcessInstanceId(long parentProcessInstanceId)
- Specified by:
setParentProcessInstanceId
in interfaceProcessInstance
-
getDescription
public String getDescription()
-
setDescription
public void setDescription(String description)
-
-