org.processmining.framework.log.rfb
Class ProcessInstanceImpl

java.lang.Object
  extended by org.processmining.framework.log.LogEntity
      extended by org.processmining.framework.log.ProcessInstance
          extended by org.processmining.framework.log.rfb.ProcessInstanceImpl

public class ProcessInstanceImpl
extends ProcessInstance

Implements the interface of a process instance. Semi-lighweight container, keeping the process instance's meta-information in memory while swapping the actual audit trail entries contained to persistent memory. Uses the cached managed random-access file implementation provided by AuditTrailEntryListImpl

Author:
christian

Field Summary
protected  AuditTrailEntryListImpl ates
          List of audit trail entries contained in this process instance.
protected  AuditTrailEntriesProxy atesProxy
          Proxy providing the AuditTrailEntries legacy interface to plugins that have not been updated yet.
protected  java.util.HashMap<java.lang.String,java.lang.String> attributes
          Map of string-based data attributes (key-value pairs)
protected  java.lang.String description
          Human-readable description string
protected  LightweightModelElements modelElements
          Lightweight model elements container.
protected  java.lang.String name
          ID of the process instance
protected  java.lang.String process
          Holds the name, or ID, of this process instance.
 
Fields inherited from class org.processmining.framework.log.ProcessInstance
ATT_ATE_ID, ATT_ATE_POST, ATT_ATE_PRE, ATT_PI_PO
 
Constructor Summary
ProcessInstanceImpl(ProcessInstanceImpl template)
          Creates a clone of the given process instance.
ProcessInstanceImpl(java.lang.String processName)
          Creates a new empty process instance.
ProcessInstanceImpl(java.lang.String processName, ATERandomFileBuffer ateBuffer, int maxFragment, LogReader log)
          Creates a new process instance.
ProcessInstanceImpl(java.lang.String processName, AuditTrailEntryListImpl ateList)
          Creates a new process instance.
 
Method Summary
 void cleanup()
           
 ProcessInstance cloneInstance()
          Returns a deep copy of this instance.
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Returns the meta-data, as map of key-value pairs, associated to this entity.
 AuditTrailEntries getAuditTrailEntries()
          Returns the sequential set of audit trail entries, as found in this process instance.
 AuditTrailEntryList getAuditTrailEntryList()
          Returns the sequential set of audit trail entries, as found in this process instance.
 java.lang.String getDescription()
          Returns the description of this entity.
 ModelElements getModelElements()
          Returns the set of model elements contained in this process instance.
 java.lang.String getName()
          Returns the name of this entity.
 java.lang.String getProcess()
          Returns the identifier / name of the process of this object is an instance.
 boolean isEmpty()
          Returns true, if this process instance contains no audit trail entries to read.
 void removeAttribute(java.lang.String key)
          Removes the attribute with the given key from the set of attributes of this entity.
 void setAttribute(java.lang.String key, java.lang.String value)
          Sets an attribute of this entity as a key-value pair.
 void setAttributes(java.util.Map<java.lang.String,java.lang.String> data)
          Sets the set of attributes, given as key-value pairs, for this entity.
 void setDescription(java.lang.String nDescription)
          Sets the description of this entity
 void setName(java.lang.String nName)
          Sets the name, or ID, of this entity
 java.lang.String toString()
          Returns a string representation of this entity.
 
Methods inherited from class org.processmining.framework.log.ProcessInstance
getData, getListOfATEs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
ID of the process instance


description

protected java.lang.String description
Human-readable description string


attributes

protected java.util.HashMap<java.lang.String,java.lang.String> attributes
Map of string-based data attributes (key-value pairs)


process

protected java.lang.String process
Holds the name, or ID, of this process instance. Replicated, because process instances must not be managed by, nor requested from, a Process container.


ates

protected AuditTrailEntryListImpl ates
List of audit trail entries contained in this process instance.


modelElements

protected LightweightModelElements modelElements
Lightweight model elements container.


atesProxy

protected AuditTrailEntriesProxy atesProxy
Proxy providing the AuditTrailEntries legacy interface to plugins that have not been updated yet. This field is subject to removal!

Constructor Detail

ProcessInstanceImpl

public ProcessInstanceImpl(java.lang.String processName,
                           AuditTrailEntryListImpl ateList)
Creates a new process instance.

Parameters:
processName - Name of the process of which this is to be an instance.
ateList - List of audit trail entries contained in this process instance.

ProcessInstanceImpl

public ProcessInstanceImpl(java.lang.String processName,
                           ATERandomFileBuffer ateBuffer,
                           int maxFragment,
                           LogReader log)
Creates a new process instance.

Parameters:
processName - Name of the process of which this is to be an instance.
ateBuffer - Random File Buffer containing the audit trail entries of this instance.
maxFragment - Maximal fragmentation count of the transparently created AuditTrailEntryList managing read/write access to the set of audit trail entries.

ProcessInstanceImpl

public ProcessInstanceImpl(java.lang.String processName)
                    throws java.io.IOException
Creates a new empty process instance.

Parameters:
processName - Name of the process of which this is to be an instance.
Throws:
java.io.IOException

ProcessInstanceImpl

public ProcessInstanceImpl(ProcessInstanceImpl template)
                    throws java.io.IOException
Creates a clone of the given process instance. Changes are not synchronized between template and clone.

Parameters:
template - The instance to be cloned.
Throws:
java.io.IOException
Method Detail

getProcess

public java.lang.String getProcess()
Description copied from class: ProcessInstance
Returns the identifier / name of the process of this object is an instance.

Specified by:
getProcess in class ProcessInstance
Returns:

isEmpty

public boolean isEmpty()
Description copied from class: ProcessInstance
Returns true, if this process instance contains no audit trail entries to read.

Specified by:
isEmpty in class ProcessInstance
Returns:

toString

public java.lang.String toString()
Description copied from class: LogEntity
Returns a string representation of this entity.

Specified by:
toString in class LogEntity

getAuditTrailEntryList

public AuditTrailEntryList getAuditTrailEntryList()
Description copied from class: ProcessInstance
Returns the sequential set of audit trail entries, as found in this process instance.

Specified by:
getAuditTrailEntryList in class ProcessInstance
Returns:

getModelElements

public ModelElements getModelElements()
Description copied from class: ProcessInstance
Returns the set of model elements contained in this process instance.

Specified by:
getModelElements in class ProcessInstance
Returns:

cloneInstance

public ProcessInstance cloneInstance()
Returns a deep copy of this instance. Changes are not synchronized between instance and clone.

Warning: Can return null if a serious error has been encountered! Check for this return value in your using code!

Specified by:
cloneInstance in class ProcessInstance
Returns:
A deep copy of this process instance.

cleanup

public void cleanup()
             throws java.io.IOException
Throws:
java.io.IOException

getAuditTrailEntries

public AuditTrailEntries getAuditTrailEntries()
Description copied from class: ProcessInstance
Returns the sequential set of audit trail entries, as found in this process instance.

Specified by:
getAuditTrailEntries in class ProcessInstance
Returns:

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Description copied from class: LogEntity
Returns the meta-data, as map of key-value pairs, associated to this entity.

Specified by:
getAttributes in class LogEntity
Returns:

getDescription

public java.lang.String getDescription()
Description copied from class: LogEntity
Returns the description of this entity.

Specified by:
getDescription in class LogEntity
Returns:

getName

public java.lang.String getName()
Description copied from class: LogEntity
Returns the name of this entity.

Specified by:
getName in class LogEntity
Returns:

removeAttribute

public void removeAttribute(java.lang.String key)
Description copied from class: LogEntity
Removes the attribute with the given key from the set of attributes of this entity.

Specified by:
removeAttribute in class LogEntity

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.String value)
Description copied from class: LogEntity
Sets an attribute of this entity as a key-value pair. If a previous mapping for the given key exists, it will be removed. Otherwise a new mapping will be added.

Specified by:
setAttribute in class LogEntity

setAttributes

public void setAttributes(java.util.Map<java.lang.String,java.lang.String> data)
Description copied from class: LogEntity
Sets the set of attributes, given as key-value pairs, for this entity. Replaces the previously contained set of attributes.

Specified by:
setAttributes in class LogEntity

setDescription

public void setDescription(java.lang.String nDescription)
Description copied from class: LogEntity
Sets the description of this entity

Specified by:
setDescription in class LogEntity

setName

public void setName(java.lang.String nName)
Description copied from class: LogEntity
Sets the name, or ID, of this entity

Specified by:
setName in class LogEntity