org.jbpm.process.instance.impl
Class ProcessInstanceImpl

java.lang.Object
  extended by org.jbpm.process.instance.impl.ProcessInstanceImpl
All Implemented Interfaces:
Serializable, EventListener, ProcessInstance, ContextableInstance, ContextInstanceContainer
Direct Known Subclasses:
WorkflowProcessInstanceImpl

public abstract class ProcessInstanceImpl
extends Object
implements ProcessInstance, Serializable

Default implementation of a process instance.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.drools.runtime.process.ProcessInstance
STATE_ABORTED, STATE_ACTIVE, STATE_COMPLETED, STATE_PENDING, STATE_SUSPENDED
 
Constructor Summary
ProcessInstanceImpl()
           
 
Method Summary
 void addContextInstance(String contextId, ContextInstance contextInstance)
           
 void disconnect()
           
 Agenda getAgenda()
           
 ContextContainer getContextContainer()
           
 ContextInstance getContextInstance(Context context)
           
 ContextInstance getContextInstance(String contextId)
           
 ContextInstance getContextInstance(String contextId, long id)
           
 List<ContextInstance> getContextInstances(String contextId)
           
 String[] getEventTypes()
          Returns the event types this event listener is interested in.
 long getId()
          The unique id of this process instance.
 org.drools.common.InternalKnowledgeRuntime getKnowledgeRuntime()
           
 Map<String,Object> getMetaData()
           
 String getOutcome()
           
 Process getProcess()
           
 String getProcessId()
          The id of the process definition that is related to this process instance.
 String getProcessName()
          The name of the process definition that is related to this process instance.
 int getState()
          The state of the process instance.
 void internalSetState(int state)
           
protected abstract  void internalStart()
           
 void reconnect()
           
 void removeContextInstance(String contextId, ContextInstance contextInstance)
           
 void setContextInstance(String contextId, ContextInstance contextInstance)
           
 void setId(long id)
           
 void setKnowledgeRuntime(org.drools.common.InternalKnowledgeRuntime kruntime)
           
 void setMetaData(String name, Object data)
           
 void setOutcome(String outcome)
           
 void setProcess(Process process)
           
 void setProcessId(String processId)
           
 void setState(int state)
           
 void setState(int state, String outcome)
           
 void signalEvent(String type, Object event)
          Signals that an event has occurred.
 void start()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcessInstanceImpl

public ProcessInstanceImpl()
Method Detail

setId

public void setId(long id)

getId

public long getId()
Description copied from interface: ProcessInstance
The unique id of this process instance.

Specified by:
getId in interface ProcessInstance
Returns:
the unique id of this process instance

setProcess

public void setProcess(Process process)

getProcess

public Process getProcess()
Specified by:
getProcess in interface ProcessInstance

setProcessId

public void setProcessId(String processId)

getProcessId

public String getProcessId()
Description copied from interface: ProcessInstance
The id of the process definition that is related to this process instance.

Specified by:
getProcessId in interface ProcessInstance
Returns:
the id of the process definition that is related to this process instance

getProcessName

public String getProcessName()
Description copied from interface: ProcessInstance
The name of the process definition that is related to this process instance.

Specified by:
getProcessName in interface ProcessInstance
Returns:
the name of the process definition that is related to this process instance

setState

public void setState(int state)

setState

public void setState(int state,
                     String outcome)

internalSetState

public void internalSetState(int state)

getState

public int getState()
Description copied from interface: ProcessInstance
The state of the process instance.

Specified by:
getState in interface ProcessInstance
Returns:
the state of the process instance

setKnowledgeRuntime

public void setKnowledgeRuntime(org.drools.common.InternalKnowledgeRuntime kruntime)

getKnowledgeRuntime

public org.drools.common.InternalKnowledgeRuntime getKnowledgeRuntime()

getAgenda

public Agenda getAgenda()

getContextContainer

public ContextContainer getContextContainer()
Specified by:
getContextContainer in interface ContextInstanceContainer

setContextInstance

public void setContextInstance(String contextId,
                               ContextInstance contextInstance)

getContextInstance

public ContextInstance getContextInstance(String contextId)
Specified by:
getContextInstance in interface ContextableInstance

getContextInstances

public List<ContextInstance> getContextInstances(String contextId)
Specified by:
getContextInstances in interface ContextInstanceContainer

addContextInstance

public void addContextInstance(String contextId,
                               ContextInstance contextInstance)
Specified by:
addContextInstance in interface ContextInstanceContainer

removeContextInstance

public void removeContextInstance(String contextId,
                                  ContextInstance contextInstance)
Specified by:
removeContextInstance in interface ContextInstanceContainer

getContextInstance

public ContextInstance getContextInstance(String contextId,
                                          long id)
Specified by:
getContextInstance in interface ContextInstanceContainer

getContextInstance

public ContextInstance getContextInstance(Context context)
Specified by:
getContextInstance in interface ContextInstanceContainer

signalEvent

public void signalEvent(String type,
                        Object event)
Description copied from interface: EventListener
Signals that an event has occurred. The type parameter defines which type of event and the event parameter can contain additional information related to the event.

Specified by:
signalEvent in interface EventListener
Parameters:
type - the type of event
event - the data associated with this event

start

public void start()

internalStart

protected abstract void internalStart()

disconnect

public void disconnect()

reconnect

public void reconnect()

getEventTypes

public String[] getEventTypes()
Description copied from interface: EventListener
Returns the event types this event listener is interested in. May return null if the event types are unknown.

Specified by:
getEventTypes in interface EventListener

toString

public String toString()
Overrides:
toString in class Object

getMetaData

public Map<String,Object> getMetaData()

setMetaData

public void setMetaData(String name,
                        Object data)

setOutcome

public void setOutcome(String outcome)

getOutcome

public String getOutcome()


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.