The Meta-Environment API

toolbus.process
Class ProcessInstance

java.lang.Object
  extended by toolbus.process.ProcessInstance

public class ProcessInstance
extends java.lang.Object

Author:
paulk, Jul 23, 2002

Field Summary
private  State currentState
           
private  ProcessDefinition definition
           
private  boolean deregistered
           
private  AtomList elements
           
private  State initialState
           
private  java.util.List<aterm.ATerm> notes
           
private  int processId
           
private  java.lang.String processName
           
private  boolean running
           
private  java.util.List<aterm.ATerm> subscriptions
           
private  TBTermFactory tbfactory
           
private  ToolBus toolbus
           
 
Constructor Summary
ProcessInstance(ToolBus TB, ProcessCall call, int processId)
           
 
Method Summary
 boolean contains(StateElement a)
           
 toolbus.process.debug.ExecutionResult debugStep()
          Executes on step in debug mode, where the state element that was executed is returned as result.
 void deregisterCommunicationAtoms(AtomList atoms)
           
 State getCurrentState()
           
 boolean getNoteFromQueue(aterm.ATerm pat, Environment env)
           
 java.util.List<aterm.ATerm> getNoteQueue()
           
 ProcessDefinition getProcessDefinition()
           
 int getProcessId()
           
 java.lang.String getProcessName()
           
 State getProcessState()
           
 long getRunTime()
           
 java.util.Set<StateElement> getStateElements()
          Returns a complete list of state elements in this process instance.
 java.util.List<aterm.ATerm> getSubscriptions()
           
 TBTermFactory getTBTermFactory()
           
 ToolBus getToolBus()
           
 void gotoNextStateAndActivate()
           
 void gotoNextStateAndActivate(StateElement se)
           
 boolean hasNotes()
           
 boolean isTerminated()
           
 boolean noNoteInQueue(aterm.ATerm pat, Environment env)
           
 boolean putNoteInQueue(aterm.ATerm note)
           
 void showAutomaton()
           
 java.lang.String showStatus()
           
 boolean step()
           
 void subscribe(aterm.ATerm pat)
           
 void terminate()
           
 java.lang.String toString()
           
 void unsubscribe(aterm.ATerm pat)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

definition

private final ProcessDefinition definition

processName

private final java.lang.String processName

processId

private final int processId

elements

private final AtomList elements

initialState

private final State initialState

currentState

private State currentState

toolbus

private final ToolBus toolbus

tbfactory

private final TBTermFactory tbfactory

subscriptions

private final java.util.List<aterm.ATerm> subscriptions

notes

private final java.util.List<aterm.ATerm> notes

running

private boolean running

deregistered

private boolean deregistered
Constructor Detail

ProcessInstance

public ProcessInstance(ToolBus TB,
                       ProcessCall call,
                       int processId)
                throws ToolBusException
Throws:
ToolBusException
Method Detail

getProcessDefinition

public ProcessDefinition getProcessDefinition()

getTBTermFactory

public TBTermFactory getTBTermFactory()

getToolBus

public ToolBus getToolBus()

getRunTime

public long getRunTime()

getProcessId

public int getProcessId()

getProcessName

public java.lang.String getProcessName()

terminate

public void terminate()

deregisterCommunicationAtoms

public void deregisterCommunicationAtoms(AtomList atoms)

getNoteFromQueue

public boolean getNoteFromQueue(aterm.ATerm pat,
                                Environment env)

noNoteInQueue

public boolean noNoteInQueue(aterm.ATerm pat,
                             Environment env)

subscribe

public void subscribe(aterm.ATerm pat)

unsubscribe

public void unsubscribe(aterm.ATerm pat)

putNoteInQueue

public boolean putNoteInQueue(aterm.ATerm note)

hasNotes

public boolean hasNotes()

getSubscriptions

public java.util.List<aterm.ATerm> getSubscriptions()

getNoteQueue

public java.util.List<aterm.ATerm> getNoteQueue()

getProcessState

public State getProcessState()

contains

public boolean contains(StateElement a)

getCurrentState

public State getCurrentState()

gotoNextStateAndActivate

public void gotoNextStateAndActivate()

gotoNextStateAndActivate

public void gotoNextStateAndActivate(StateElement se)

step

public boolean step()
             throws ToolBusException
Throws:
ToolBusException

debugStep

public toolbus.process.debug.ExecutionResult debugStep()
                                                throws ToolBusException
Executes on step in debug mode, where the state element that was executed is returned as result.

Returns:
The result of the execution (if contains the state element and partners); null if nothing was executed.
Throws:
ToolBusException - Thrown if something went wrong.

isTerminated

public boolean isTerminated()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

showStatus

public java.lang.String showStatus()

showAutomaton

public void showAutomaton()

getStateElements

public java.util.Set<StateElement> getStateElements()
Returns a complete list of state elements in this process instance. This method is only required for obtaining a reference to a state element, so we can set a break point on it when running the toolbus in debug mode.

Returns:
A complete list of atoms in this process instance.

The Meta-Environment API