com.rapidminer
Class ProcessContext

java.lang.Object
  extended by com.rapidminer.tools.AbstractObservable<ProcessContext>
      extended by com.rapidminer.ProcessContext
All Implemented Interfaces:
Observable<ProcessContext>, java.io.Serializable

public class ProcessContext
extends AbstractObservable<ProcessContext>
implements java.io.Serializable

The process context holds some data controlling the execution of a Process. This includes connections of the input and output ports of the root operator to repository locations as well as the definition of macros.

The fact that this data is defined outside the process itself is particularly useful if this process is offered as a service, so it can be adapted easily. Furthermore, this saves the process designer from defining data reading and storing operators at the beginning and at the end of the process.

Note: A ProcessContext is not necessarily associate with a Process. E.g., if a process is run remotely, it does not necessarily exist on the machine that prepares the context.

Since this class acts merely as a data container, it has public getter and setter methods which return references to the actual data (as opposed to immutable views). In order to trigger an update, call a setter method rather than adding to the lists, which is invisible to the process context.

The data is saved as strings rather than, e.g. using RepositoryLocations.

Since this class is saved as a Lob with the ProcessExecutionParameters entity, serializability must be ensured. This is guaranteed by the fact that this class only contains Lists of strings or Pairs of strings, where Pair is serializable.

Author:
Simon Fischer
See Also:
Serialized Form

Constructor Summary
ProcessContext()
           
 
Method Summary
 void addInputLocation(java.lang.String location)
           
 void addMacro(Pair<java.lang.String,java.lang.String> macro)
          Adds a macro to the list or sets an existing one.
 void addOperatorLibrary(OperatorLibrary library, java.lang.String location)
           
 void addOutputLocation(java.lang.String location)
           
 java.util.List<java.lang.String> getInputRepositoryLocations()
           
 java.util.List<Pair<java.lang.String,java.lang.String>> getMacros()
           
 java.util.List<OperatorLibrary> getOperatorLibraries()
          This returns all loaded OperatorLibries that should be used within this process.
 java.util.List<java.lang.String> getOutputRepositoryLocations()
           
 void removeInputLocation(int rowIndex)
           
 void removeOutputLocation(int rowIndex)
           
 void setInputRepositoryLocation(int index, java.lang.String location)
           
 void setInputRepositoryLocations(java.util.List<java.lang.String> inputRepositoryLocations)
           
 void setMacros(java.util.List<Pair<java.lang.String,java.lang.String>> macros)
           
 void setOutputRepositoryLocation(int index, java.lang.String location)
           
 void setOutputRepositoryLocations(java.util.List<java.lang.String> outputRepositoryLocations)
           
 void superimpose(ProcessContext other)
          Merges the current context with the given one.
 java.lang.String toString()
           
 
Methods inherited from class com.rapidminer.tools.AbstractObservable
addObserver, addObserverAsFirst, fireUpdate, fireUpdate, removeObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcessContext

public ProcessContext()
Method Detail

getInputRepositoryLocations

public java.util.List<java.lang.String> getInputRepositoryLocations()

setInputRepositoryLocations

public void setInputRepositoryLocations(java.util.List<java.lang.String> inputRepositoryLocations)

getOutputRepositoryLocations

public java.util.List<java.lang.String> getOutputRepositoryLocations()

setOutputRepositoryLocations

public void setOutputRepositoryLocations(java.util.List<java.lang.String> outputRepositoryLocations)

getMacros

public java.util.List<Pair<java.lang.String,java.lang.String>> getMacros()

addMacro

public void addMacro(Pair<java.lang.String,java.lang.String> macro)
Adds a macro to the list or sets an existing one.


setMacros

public void setMacros(java.util.List<Pair<java.lang.String,java.lang.String>> macros)

setOutputRepositoryLocation

public void setOutputRepositoryLocation(int index,
                                        java.lang.String location)

setInputRepositoryLocation

public void setInputRepositoryLocation(int index,
                                       java.lang.String location)

removeOutputLocation

public void removeOutputLocation(int rowIndex)

removeInputLocation

public void removeInputLocation(int rowIndex)

addOutputLocation

public void addOutputLocation(java.lang.String location)

addInputLocation

public void addInputLocation(java.lang.String location)

superimpose

public void superimpose(ProcessContext other)
Merges the current context with the given one. Macros will be simply added, input and output locations override their respective counterparts if not null. This modifies this instance.


toString

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

getOperatorLibraries

public java.util.List<OperatorLibrary> getOperatorLibraries()
This returns all loaded OperatorLibries that should be used within this process.


addOperatorLibrary

public void addOperatorLibrary(OperatorLibrary library,
                               java.lang.String location)


Copyright © 2001-2009 by Rapid-I