public class SettableDataContext extends SerialisablePluginDataContainer implements DataContext
SettableDataContext allows to set the arbitrary input and
output parameters as well as the corresponding values. This allows for using
a data context with arbitrary parameters and values and also retrieving the
values of output parameters after usage. This way this data context serves
the same purpose as an
InstanceDataContainer.| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap<java.lang.String,ProcessModelParameter> |
inputParams
A map of all input parameters, mapping the name of a parameter to the
corresponding parameter object.
|
protected java.util.HashMap<java.lang.String,ProcessModelParameter> |
outputParams
A map of all output parameters, mapping the name of a parameter to the
corresponding parameter object.
|
protected java.util.HashMap<java.lang.String,java.io.Serializable> |
values
The value of the input and output parameters.
|
| Constructor and Description |
|---|
SettableDataContext()
Creates a new
SettableDataContext with no parameters and no
values. |
SettableDataContext(java.util.Map<java.lang.String,java.io.Serializable> values,
java.util.Map<java.lang.String,ProcessModelParameter> inputParams,
java.util.Map<java.lang.String,ProcessModelParameter> outputParams)
Creates a new
SettableDataContext with the designated
parameters and values. |
| Modifier and Type | Method and Description |
|---|---|
void |
addInputParameter(ProcessModelParameter param,
java.io.Serializable value)
Adds the designated parameter as input parameter to this data context
having the designated value.
|
void |
addOutputParameter(ProcessModelParameter param)
Adds the designated parameter as output parameter to this data context.
|
protected void |
checkInputExistence(java.lang.String parameterName)
Checks whether the designated parameter is an input parameter (exists in
the input parameter map).
|
protected void |
checkInputExistenceAndType(java.lang.String parameterName,
ProcessConstants.AdeptDataType expectedType)
Checks whether the designated parameter is an input parameter (exists in
the input parameter map) and whether it is of the Java-type corresponding
to the designated expected ADEPT-data type.
|
protected void |
checkOutputExistence(java.lang.String parameterName)
Checks whether the designated parameter is an output parameter (exists in
the output parameter map).
|
protected void |
checkOutputExistenceAndType(java.lang.String parameterName,
ProcessConstants.AdeptDataType expectedType)
Checks whether the designated parameter is an output parameter (exists in
the output parameter map) and whether it is of the Java-type corresponding
to the designated expected ADEPT-data type.
|
protected void |
checkType(java.lang.Object value,
ProcessConstants.AdeptDataType expectedType)
Checks whether the designated value is of the Java-type corresponding to
the designated ADEPT-data type.
|
java.util.Map<java.lang.String,java.io.Serializable> |
getValues()
Returns the values set for the data context, that is a mapping from
parameter names to the corresponding values as Java-objects.
|
boolean |
ignoredValue(java.lang.String parameterName)
Returns whether the value of the designated output parameter is not or has
not been set (ignored) by the application.
|
void |
ignoreValue(java.lang.String parameterName)
Ignores the value of the designated parameter that is the value has not
been written.
|
boolean |
isNull(java.lang.String parameterName)
Returns whether the value of the designated parameter is NULL which means
the data element has not been written or has been consumed yet or has been
explicitly set to NULL by a previous application.
|
boolean |
isReadOnly()
Returns whether this data container is read only and therefore does not
allow to store values (and throws an
UnsupportedOperationException at the corresponding methods). |
boolean |
retrieveBooleanParameterValue(java.lang.String parameterName)
Reads from an input parameter.
|
java.util.Date |
retrieveDateParameterValue(java.lang.String parameterName)
Reads from an input parameter.
|
double |
retrieveFloatParameterValue(java.lang.String parameterName)
Reads from an input parameter.
|
long |
retrieveIntegerParameterValue(java.lang.String parameterName)
Reads from an input parameter.
|
java.lang.String |
retrieveStringParameterValue(java.lang.String parameterName)
Reads from an input parameter.
|
UDTValue |
retrieveUDTParameterValue(java.lang.String parameterName)
Reads from an input parameter.
|
java.net.URI |
retrieveURIParameterValue(java.lang.String parameterName)
Reads from an input parameter.
|
void |
storeBooleanParameterValue(java.lang.String parameterName,
boolean value)
Writes an output parameter of the type boolean to the data container of the
process management system.
|
void |
storeDateParameterValue(java.lang.String parameterName,
java.util.Date value)
Writes an output parameter of the type date to the data context of the
process management system.
|
boolean |
storedBooleanParameterValue(java.lang.String parameterName)
Reads the boolean value of the designated output parameter.
|
java.util.Date |
storedDateParameterValue(java.lang.String parameterName)
Reads the date value of the designated output parameter.
|
double |
storedFloatParameterValue(java.lang.String parameterName)
Reads the double value of the designated output parameter.
|
long |
storedIntegerParameterValue(java.lang.String parameterName)
Reads the long value of the designated output parameter.
|
java.lang.String |
storedStringParameterValue(java.lang.String parameterName)
Reads the string value of the designated output parameter.
|
UDTValue |
storedUDTParameterValue(java.lang.String parameterName)
Reads the value of the designated output parameter of user-defined type.
|
java.net.URI |
storedURIParameterValue(java.lang.String parameterName)
Reads the URI value of the designated output parameter.
|
void |
storeFloatParameterValue(java.lang.String parameterName,
double value)
Writes an output parameter of the type float to the data container of the
process management system.
|
void |
storeIntegerParameterValue(java.lang.String parameterName,
long value)
Writes an output parameter of the type integer (in java: long) to the data
context of the process management system.
|
void |
storeStringParameterValue(java.lang.String parameterName,
java.lang.String value)
Writes an output parameter of type String to the data container of the
process management system.
|
void |
storeUDTParameterValue(java.lang.String parameterName,
UDTValue value)
Writes an output parameter of an user defined type to the data container of
the process management system.
|
void |
storeURIParameterValue(java.lang.String parameterName,
java.net.URI value)
Writes an output parameter of type URI to the data container of the process
management system.
|
boolean |
subEquals(java.lang.Object obj)
An implementation of
Object.equals(Object) for various purpose. |
int |
subHashCode()
An implementation of
Object.hashCode() for various purpose. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValuegetPluginData, getPluginDatas, getSupportedPluginsprotected final java.util.HashMap<java.lang.String,java.io.Serializable> values
protected final java.util.HashMap<java.lang.String,ProcessModelParameter> inputParams
protected final java.util.HashMap<java.lang.String,ProcessModelParameter> outputParams
public SettableDataContext()
SettableDataContext with no parameters and no
values.public SettableDataContext(java.util.Map<java.lang.String,java.io.Serializable> values,
java.util.Map<java.lang.String,ProcessModelParameter> inputParams,
java.util.Map<java.lang.String,ProcessModelParameter> outputParams)
SettableDataContext with the designated
parameters and values. Please ensure that the maps are consistent, that is
the value-map contains only parameters that are either in the input or in
the output parameter map. Additionally, all mandatory input parameter need
to have a value in the value map.values - The values of the parameters, mapping the parameter names to
the corresponding values.inputParams - The input parameters for the data context mapping the
parameter name to the corresponding parameter object.outputParams - The output parameters for the data context mapping the
parameter name to the corresponding parameter object.public void addInputParameter(ProcessModelParameter param, java.io.Serializable value)
add it as output parameter.
If the value is not set yet, use null as value. But do not
provide null for a mandatory input parameter!param - The parameter to add as input parameter to this data context.value - The value of the input parameter (may be null).java.lang.ClassCastException - If the designated value is not of the Java-type
corresponding to the ADEPT-data type of the designated parameter,
a ClassCastException will be thrown.public void addOutputParameter(ProcessModelParameter param)
add it as input parameter.param - The parameter to add as output parameter to this data context.public java.util.Map<java.lang.String,java.io.Serializable> getValues()
protected void checkType(java.lang.Object value,
ProcessConstants.AdeptDataType expectedType)
value - The value to check the type of.expectedType - The ADEPT-data type that the value is expected to be.java.lang.ClassCastException - If the designated value is not of an appropriate
type, a ClassCastException will be thrown.public boolean isNull(java.lang.String parameterName)
throws NoSuchParameterException
InputDataContextisNull in interface InputDataContextparameterName - The name of the parameter to check on NULL.true if the value of the designated parameter is
NULL and therefore has not been written or has been consumed yet.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.public long retrieveIntegerParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
InputDataContextretrieveIntegerParameterValue in interface InputDataContextparameterName - the name of the input parameter to be readInvalidDataTypeException - If the designated parameter is not of
type INTEGER, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.public double retrieveFloatParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
InputDataContextretrieveFloatParameterValue in interface InputDataContextparameterName - the name of the input parameter to be readInvalidDataTypeException - If the designated parameter is not of
type FLOAT, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.public boolean retrieveBooleanParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
InputDataContextretrieveBooleanParameterValue in interface InputDataContextparameterName - the name of the input parameter to be readInvalidDataTypeException - If the designated parameter is not of
type BOOLEAN, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.public java.lang.String retrieveStringParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
InputDataContextretrieveStringParameterValue in interface InputDataContextparameterName - the name of the input parameter to be readInvalidDataTypeException - If the designated parameter is not of
type STRING, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.public java.util.Date retrieveDateParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
InputDataContextjava.util.Date.retrieveDateParameterValue in interface InputDataContextparameterName - the name of the input parameter to be readInvalidDataTypeException - If the designated parameter is not of
type DATE, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.public java.net.URI retrieveURIParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
InputDataContextretrieveURIParameterValue in interface InputDataContextparameterName - the name of the input parameter to be readInvalidDataTypeException - If the designated parameter is not of
type URI, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.public UDTValue retrieveUDTParameterValue(java.lang.String parameterName) throws InvalidDataTypeException, NoSuchParameterException
InputDataContextretrieveUDTParameterValue in interface InputDataContextparameterName - the name of the input parameter to be readInvalidDataTypeException - If the designated parameter is not of
type UDT, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.protected void checkInputExistence(java.lang.String parameterName)
throws NoSuchParameterException
parameterName - The name of the input parameter to check for its
existence.NoSuchParameterException - If the designated parameter name is not
known as input parameter, a
NoSuchParameterException will be thrown.protected void checkInputExistenceAndType(java.lang.String parameterName,
ProcessConstants.AdeptDataType expectedType)
throws InvalidDataTypeException,
NoSuchParameterException
parameterName - The name of the input parameter to check for its
existence and type.expectedType - The type that is expected for the designated parameter.InvalidDataTypeException - If the designated parameter is known but
its value is not of the Java-type corresponding to the designated
expected type.NoSuchParameterException - If the designated parameter name is not
known as input parameter, a
NoSuchParameterException will be thrown.public boolean isReadOnly()
DataContextUnsupportedOperationException at the corresponding methods).isReadOnly in interface DataContextpublic void ignoreValue(java.lang.String parameterName)
throws NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.ignoreValue in interface DataContextparameterName - The name of the parameter to be ignored.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.public boolean ignoredValue(java.lang.String parameterName)
throws NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.ignoredValue in interface DataContextparameterName - The name of the output parameter to check for being
unset.true if the value of the designated output parameter
is or has not been written.NoSuchParameterException - If the output parameter of the designated
name does not exist, a NoSuchParameterException
will be thrown.public void storeIntegerParameterValue(java.lang.String parameterName,
long value)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storeIntegerParameterValue in interface DataContextparameterName - The name of the output parameter to be written.value - The value that is written for the designated output parameter.InvalidDataTypeException - If the designated parameter is not of type
INTEGER, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.DataContainerpublic long storedIntegerParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storedIntegerParameterValue in interface DataContextparameterName - The name of the output parameter to be read.long.InvalidDataTypeException - If the designated output parameter is not
of type INTEGER, an InvalidDataTypeException will
be raised.NoSuchParameterException - If the output parameter of the designated
name does not exist, a NoSuchParameterException
will be thrown.ProcessConstants.AdeptDataType.INTEGERpublic void storeFloatParameterValue(java.lang.String parameterName,
double value)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storeFloatParameterValue in interface DataContextparameterName - The name of the output parameter to be written.value - The value that is written for the designated output parameter.InvalidDataTypeException - If the designated parameter is not of type
FLOAT, an InvalidDataTypeException will be raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.DataContainerpublic double storedFloatParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storedFloatParameterValue in interface DataContextparameterName - The name of the output parameter to be read.double.InvalidDataTypeException - If the designated output parameter is not
of type FLOAT, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the output parameter of the designated
name does not exist, a NoSuchParameterException
will be thrown.ProcessConstants.AdeptDataType.FLOATpublic void storeBooleanParameterValue(java.lang.String parameterName,
boolean value)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storeBooleanParameterValue in interface DataContextparameterName - The name of the output parameter to be written.value - The value that is written for the designated output parameter.InvalidDataTypeException - If the designated parameter is not of type
BOOLEAN, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.DataContainerpublic boolean storedBooleanParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storedBooleanParameterValue in interface DataContextparameterName - The name of the output parameter to be read.boolean.InvalidDataTypeException - If the designated output parameter is not
of type BOOLEAN, an InvalidDataTypeException will
be raised.NoSuchParameterException - If the output parameter of the designated
name does not exist, a NoSuchParameterException
will be thrown.ProcessConstants.AdeptDataType.BOOLEANpublic void storeStringParameterValue(java.lang.String parameterName,
java.lang.String value)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storeStringParameterValue in interface DataContextparameterName - The name of the output parameter to be written.value - The value that is written for the designated output parameter.InvalidDataTypeException - If the designated parameter is not of type
STRING, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.DataContainerpublic java.lang.String storedStringParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storedStringParameterValue in interface DataContextparameterName - The name of the output parameter to be read.String.InvalidDataTypeException - If the designated output parameter is not
of type STRING, an InvalidDataTypeException will
be raised.NoSuchParameterException - If the output parameter of the designated
name does not exist, a NoSuchParameterException
will be thrown.ProcessConstants.AdeptDataType.STRINGpublic void storeDateParameterValue(java.lang.String parameterName,
java.util.Date value)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the method
is not called by the main thread of the corresponding component.storeDateParameterValue in interface DataContextparameterName - The name of the output parameter to be written.value - The value that is written for the designated output parameter.InvalidDataTypeException - If the designated parameter is not of type
DATE, an InvalidDataTypeException will be raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.DataContainerpublic java.util.Date storedDateParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storedDateParameterValue in interface DataContextparameterName - The name of the output parameter to be read.java.util.Date.InvalidDataTypeException - If the designated output parameter is not
of type DATE, an InvalidDataTypeException will
be raised.NoSuchParameterException - If the output parameter of the designated
name does not exist, a NoSuchParameterException
will be thrown.ProcessConstants.AdeptDataType.DATEpublic void storeURIParameterValue(java.lang.String parameterName,
java.net.URI value)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storeURIParameterValue in interface DataContextparameterName - The name of the output parameter to be written.value - The value that is written for the designated output parameter.InvalidDataTypeException - If the designated parameter is not of type
URI, an InvalidDataTypeException will be raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.DataContainerpublic java.net.URI storedURIParameterValue(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storedURIParameterValue in interface DataContextparameterName - The name of the output parameter to be read.java.net.URI.InvalidDataTypeException - If the output designated parameter is not
of type URI, an InvalidDataTypeException will be
raised.NoSuchParameterException - If the output parameter of the designated
name does not exist, a NoSuchParameterException
will be thrown.ProcessConstants.AdeptDataType.URIpublic void storeUDTParameterValue(java.lang.String parameterName,
UDTValue value)
throws InvalidDataTypeException,
NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storeUDTParameterValue in interface DataContextparameterName - The name of the output parameter to be written.value - The value that is written for the designated output parameter.InvalidDataTypeException - If the designated parameter is not of type
UDT, an InvalidDataTypeException will be raised.NoSuchParameterException - If the parameter of the designated name
does not exist, a NoSuchParameterException will be
thrown.DataContainerpublic UDTValue storedUDTParameterValue(java.lang.String parameterName) throws InvalidDataTypeException, NoSuchParameterException
DataContextInvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.storedUDTParameterValue in interface DataContextparameterName - The name of the output parameter to be read.UDTValue.InvalidDataTypeException - If the designated output parameter is not
of type USERDEFINED, an InvalidDataTypeException
will be raised.NoSuchParameterException - If the output parameter of the designated
name does not exist, a NoSuchParameterException
will be thrown.ProcessConstants.AdeptDataType.USERDEFINEDprotected void checkOutputExistence(java.lang.String parameterName)
throws NoSuchParameterException
parameterName - The name of the output parameter to check for its
existence.NoSuchParameterException - If the designated parameter name is not
known as output parameter, a
NoSuchParameterException will be thrown.protected void checkOutputExistenceAndType(java.lang.String parameterName,
ProcessConstants.AdeptDataType expectedType)
throws InvalidDataTypeException,
NoSuchParameterException
parameterName - The name of the output parameter to check for its
existence and type.expectedType - The type that is expected for the designated parameter.InvalidDataTypeException - If the designated parameter is known but
its value is not of the Java-type corresponding to the designated
expected type.NoSuchParameterException - If the designated parameter name is not
known as output parameter, a
NoSuchParameterException will be thrown.public boolean subEquals(java.lang.Object obj)
Object.equals(Object) for various purpose. Due to
several reasons we do not want actually override Object.equals(Object).obj - The object with which to compare.public int subHashCode()
Object.hashCode() for various purpose. Due to
several reasons we do not want actually override
Object.hashCode(). subEquals(Object) with respect to Object.equals(Object).