public interface DataContainer extends InputDataContainer
InputDataContainer to also support writing and storing of
(output) parameter values. The methods resemble the ones in
ProcessAwareAccess but with less information. When using
DataContainer only the name of the corresponding parameter and a session
token is necessary since all other information (instance, data element,
agent,...) is already provided when retrieving the container. DataContainer also provides read access to the
(intermediate) written data values. This allows to distinguish the input
value and the already written output value of an INOUT-parameter (a parameter
that is read as well as written). A significant implication of this is that a
data container need to store every value written by an activity - internally
or directly in the data manager. The latter requires that these values must
not be read by another activity from the data manager before the writing
activity has finished. Normally this is done by calling
ProcessAwareAccess.validateWrittenValues(SessionToken, de.aristaflow.adept2.model.processmodel.Instance, int, int, String)
after the data container has been
flushed.
A data container may also be stored intermediately for instance in case an
application is running while the server is temporarily offline. Only unsaved
values need to be stored in this case, use the
getUnsave*-methods for this. After the server is online again, a
new data container may be provided that provides the unsaved values when
flushed.
The retrieval of written values is also used for "re-executing" an
already finished activity - if it supports this (see
ProcessConstants.ExecutionMode.VIEW_ONLY).
This execution mode provides the input parameter as well as the output
parameters written by the corresponding activity. Since it is obviously not
allowed to change any of these values, this container is
read only and all writing methods of the corresponding
data container throw an UnsupportedOperationException.
Implementations of this interface may not store an
internally since a process instance must be accessible by other components.
Instead, all needed information has to be encapsulated in the container. The
instance may be provided, for instance, in the constructor, but the reference
to it has to be released afterwards.Instance
| Modifier and Type | Field and Description |
|---|---|
static long |
serialVersionUID
Generated ID for serialisation.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.UUID |
getInstanceID()
Gets the ID of the instance this data container is for a node of.
|
java.lang.String |
getLastSavepoint(SessionToken session)
Returns the last savepoint stored within this data container.
|
int |
getNodeID()
Gets the ID of the node for which this data container provides the
parameter values.
|
int |
getNodeIteration()
Gets the iteration of the node for which this data container provides the
parameter values.
|
java.util.List<java.lang.String> |
getSavepoints(SessionToken session)
Returns the IDs of the stored savepoints kept in the DataContainer.
|
java.util.Collection<java.lang.String> |
getUnsavedIgnoredParameters(java.lang.String savepoint)
Gets the names of the parameters for the designated savepoint that should
be ignored and that have not been saved yet.
|
java.util.List<java.lang.String> |
getUnsavedSavepoints()
Gets the names of all savepoints that have not been stored yet.
|
byte[] |
getUnsavedSessionState(java.lang.String savepoint)
Gets the session states for the designated savepoint that have not been
saved yet.
|
java.util.Map<java.lang.String,ProcessConstants.AdeptDataType> |
getUnsavedTypes()
Gets all names of unsaved parameters and the corresponding data types.
|
java.util.Map<java.lang.String,java.io.Serializable> |
getUnsavedValues(java.lang.String savepoint)
Gets the parameter values for the designated savepoint that have not been
saved yet.
|
boolean |
ignoredValue(java.lang.String parameterName)
Returns whether the value of the designated output parameter is or has not
been set (ignored) by the application.
|
void |
ignoreValue(SessionToken session,
java.lang.String parameterName)
Ignores the value of the designated parameter.
|
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). |
byte[] |
restoreSessionState(SessionToken session,
java.lang.String savepoint)
Restores the session context of an suspended activity to be resumed.
|
void |
savedSavepoints(java.lang.String[] savepoints)
Signals this data container that the designated savepoints have been saved.
|
void |
setSavepoint(SessionToken session,
java.lang.String savepoint)
Assigns the designated savepoint to the current state of the data, that is
application state and data values.
|
void |
storeBoolean(SessionToken session,
java.lang.String parameterName,
boolean value)
Stores the BOOLEAN value of the designated parameter of the process
instance and the corresponding metadata which is the writing node and its
current iteration.
|
void |
storeDate(SessionToken session,
java.lang.String parameterName,
java.util.Date value)
Stores the DATE value of the designated parameter of the process instance
and the corresponding metadata which is the writing node and its current
iteration.
|
boolean |
storedBoolean(java.lang.String parameterName)
Retrieves the boolean value of the designated output parameter of type
BOOLEAN stored before.
|
java.util.Date |
storedDate(java.lang.String parameterName)
Retrieves the date value of the designated output parameter of type DATE
stored before.
|
double |
storedFloat(java.lang.String parameterName)
Retrieves the double value of the designated output parameter of type FLOAT
stored before.
|
long |
storedInteger(java.lang.String parameterName)
Retrieves the long value of the designated output parameter of type INTEGER
stored before.
|
java.lang.String |
storedString(java.lang.String parameterName)
Retrieves the string value of the designated output parameter of type
STRING stored before.
|
UDTValue |
storedUDT(java.lang.String parameterName)
Retrieves (the proxy of) the value of the designated output parameter of
user-defined type (UDT) stored before.
|
java.net.URI |
storedURI(java.lang.String parameterName)
Retrieves the URI value of the designated output parameter of type URI
stored before.
|
void |
storeFloat(SessionToken session,
java.lang.String parameterName,
double value)
Stores the FLOAT value of the designated parameter of the process instance
and the corresponding metadata which is the writing node and its current
iteration.
|
void |
storeInteger(SessionToken session,
java.lang.String parameterName,
long value)
Stores the INTEGER value of the designated parameter of the process
instance and the corresponding metadata which is the writing node and its
current iteration.
|
void |
storeSessionState(SessionToken session,
byte[] sessionState)
Stores the state of the suspended activity this data container is
associated with in order to enable the resume of the activity.
|
void |
storeString(SessionToken session,
java.lang.String parameterName,
java.lang.String value)
Stores the string value of the designated parameter of the process instance
and the corresponding metadata which is the writing node and its current
iteration.
|
void |
storeUDT(SessionToken session,
java.lang.String parameterName,
UDTValue value)
Stores the value of user-defined type of the designated parameter of the
process instance and the corresponding metadata which is the writing node
and its current iteration.
|
void |
storeURI(SessionToken session,
java.lang.String parameterName,
java.net.URI value)
Stores the URI value of the designated parameter of the process instance
and the corresponding metadata which is the writing node and its current
iteration.
|
isNull, retrieveBoolean, retrieveDate, retrieveFloat, retrieveInteger, retrieveString, retrieveUDT, retrieveURIgetUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValuegetPluginData, getPluginDatas, getSupportedPluginsstatic final long serialVersionUID
boolean isReadOnly()
UnsupportedOperationException at the corresponding methods).void ignoreValue(SessionToken session, java.lang.String parameterName) throws NoSuchParameterException
session - The session which is used to check for access rights on this
method and to retrieve the accessing agent and the corresponding
organisational position.parameterName - The name of the parameter to be ignored.NoSuchParameterException - If the output parameter of the designated
name does not exist, a NoSuchParameterException will
be thrown.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.boolean ignoredValue(java.lang.String parameterName)
throws NoSuchParameterException
parameterName - 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.void storeInteger(SessionToken session, java.lang.String parameterName, long value) throws InvalidDataTypeException, NoSuchParameterException
session - The session which is used to check for access rights on this
method and to retrieve the accessing agent and the corresponding
organisational position.parameterName - The name of the parameter to be stored.value - The value as Java-type long of the parameter of
ADEPT2-type INTEGER.InvalidDataTypeException - If the designated 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.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.ProcessConstants.AdeptDataType.INTEGERlong storedInteger(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
parameterName - 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.INTEGERvoid storeFloat(SessionToken session, java.lang.String parameterName, double value) throws InvalidDataTypeException, NoSuchParameterException
session - The session which is used to check for access rights on this
method and to retrieve the accessing agent and the corresponding
organisational position.parameterName - The name of the parameter to be stored.value - The value as Java-type double of the parameter of
ADEPT2-type FLOAT.InvalidDataTypeException - If the designated 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.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.ProcessConstants.AdeptDataType.FLOATdouble storedFloat(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
parameterName - 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.FLOATvoid storeBoolean(SessionToken session, java.lang.String parameterName, boolean value) throws InvalidDataTypeException, NoSuchParameterException
session - The session which is used to check for access rights on this
method and to retrieve the accessing agent and the corresponding
organisational position.parameterName - The name of the parameter to be stored.value - The value as Java-type boolean of the parameter
of ADEPT2-type BOOLEAN.InvalidDataTypeException - If the designated 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.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.ProcessConstants.AdeptDataType.BOOLEANboolean storedBoolean(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
parameterName - 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.BOOLEANvoid storeString(SessionToken session, java.lang.String parameterName, java.lang.String value) throws InvalidDataTypeException, NoSuchParameterException
session - The session which is used to check for access rights on this
method and to retrieve the accessing agent and the corresponding
organisational position.parameterName - The name of the parameter to be stored.value - The value as Java-type String of the parameter of
ADEPT2-type STRING.InvalidDataTypeException - If the designated 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.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.ProcessConstants.AdeptDataType.STRINGjava.lang.String storedString(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
parameterName - 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.STRINGvoid storeDate(SessionToken session, java.lang.String parameterName, java.util.Date value) throws InvalidDataTypeException, NoSuchParameterException
session - The session which is used to check for access rights on this
method and to retrieve the accessing agent and the corresponding
organisational position.parameterName - The name of the parameter to be stored.value - The value as Java-type java.util.Date of the
parameter of ADEPT2-type DATE.InvalidDataTypeException - If the designated 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.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.ProcessConstants.AdeptDataType.DATEjava.util.Date storedDate(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
parameterName - 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.DATEvoid storeURI(SessionToken session, java.lang.String parameterName, java.net.URI value) throws InvalidDataTypeException, NoSuchParameterException
session - The session which is used to check for access rights on this
method and to retrieve the accessing agent and the corresponding
organisational position.parameterName - The name of the parameter to be stored.value - The value as Java-type java.net.URI of the
parameter of ADEPT2-type URI.InvalidDataTypeException - If the 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.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.ProcessConstants.AdeptDataType.URIjava.net.URI storedURI(java.lang.String parameterName)
throws InvalidDataTypeException,
NoSuchParameterException
parameterName - 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.URIvoid storeUDT(SessionToken session, java.lang.String parameterName, UDTValue value) throws InvalidDataTypeException, NoSuchParameterException
session - The session which is used to check for access rights on this
method and to retrieve the accessing agent and the corresponding
organisational position.parameterName - The name of the parameter to be stored.value - The value of the parameter of ADEPT2-type USERDEFINED.InvalidDataTypeException - If the designated 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.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.ProcessConstants.AdeptDataType.USERDEFINEDUDTValue storedUDT(java.lang.String parameterName) throws InvalidDataTypeException, NoSuchParameterException
parameterName - 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.USERDEFINEDvoid storeSessionState(SessionToken session, byte[] sessionState)
null the corresponding savepoint will be removed.session - The session which is used to identify the user, to
synchronise access and to check for access rights on this method.sessionState - A byte array that contains the state of the suspended
activity or null.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.byte[] restoreSessionState(SessionToken session, java.lang.String savepoint)
session - The session which is used to synchronise access and to check
for access rights on this method.savepoint - The savepoint for which to retrieve the session state. Use
null to get the current session state that has no
savepoint yet.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.void setSavepoint(SessionToken session, java.lang.String savepoint)
session - The session which is used to synchronise access and to check
for access rights on this method.savepoint - The identifier by which the current data state could be
retrieved. This must neither be null nor the empty
string.java.util.List<java.lang.String> getSavepoints(SessionToken session)
session - The session which is used to synchronise access and to check
for access rights on this method.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose,
an UnsupportedOperationException will be thrown.java.lang.String getLastSavepoint(SessionToken session)
session - The session which is used to synchronise access and to check
for access rights on this method.null in case no savepoint has been stored yet
explicitly.java.lang.UnsupportedOperationException - If this data container is only for
displaying purpose, an
UnsupportedOperationException will be thrown.java.util.UUID getInstanceID()
int getNodeID()
int getNodeIteration()
java.util.Map<java.lang.String,ProcessConstants.AdeptDataType> getUnsavedTypes()
java.util.Collection<java.lang.String> getUnsavedIgnoredParameters(java.lang.String savepoint)
savepoint - The savepoint for which to retrieve the ignored parameter
values that have not been saved yet. null is for
all parameters ignored after the last savepoint.java.util.Map<java.lang.String,java.io.Serializable> getUnsavedValues(java.lang.String savepoint)
savepoint - The savepoint for which to retrieve the parameter values
that have not been saved yet. null is for all
parameters values set after the last savepoint.byte[] getUnsavedSessionState(java.lang.String savepoint)
savepoint - The savepoint for which to retrieve the session states
that have not been saved yet. null is for the unsaved
session set after the last savepoint.null in case there is no such session
state or it has been stored already.java.util.List<java.lang.String> getUnsavedSavepoints()
null will be at the end of the list.void savedSavepoints(java.lang.String[] savepoints)
savepoints - The savepoints that have been saved now. This must not be
null nor contain null nor empty strings.