Class ActivityData
- java.lang.Object
-
- de.aristaflow.adept2.model.runtimeenvironment.ActivityData
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ActivityData extends Object implements Closeable
ActivityData
provides convenience methods for retrieval of input and output parameter types and values as well as writing the output parameter values. User-defined data types can be lists or other POJOs. Besides the parameters, there are also methods for accessing the configuration values. Mandatory parameters can be checked for existence. If problems occur when accessing a parameter or configuration value, an appropriateApplicationEnvironmentException
will be thrown. This applies for instance in case a mandatory value is not set or a required value has the wrong type.Besides the specific methods, most convenience methods can be classified into the following groups:
readInput*
: Gets the value of the corresponding input parameter ornull
in case the value has not been set. No conversion takes place, if the parameter is of the wrong type or does not exist, an exception will be thrown.requireInput*
: The same as the correspondingreadInput*
-method but this time an exception will be thrown, if the value is not present.*ToNativeTypedValue
: These methods are called when you request a value with conversion (@seegetInputValue(ProcessModelParameter, boolean, boolean)
,getStoredValue(String)
andgetStoredValue(ProcessModelParameter, boolean)
). Override this methods to change the type conversion.readOutput*
: Gets the value of the corresponding output parameter if it has already been written, either by the current execution or by a previous suspended execution.null
will be returned if no value has been written. No conversion takes place, if the parameter is of the wrong type or does not exist, an exception will be thrown.writeOutput*
: Writes the designated value to the corresponding output parameter. No conversion takes place, if the parameter is of the wrong type or does not exist, an exception will be thrown.objectTo*
: These methods are called when you write a value with conversion (@seewriteOutputValue(ProcessModelParameter, boolean, Object)
). Override this methods to change the type conversion.getConf*
: Gets the value of the corresponding activity configuration value. If the configuration value does not exist, or is of another type, the designated default value will be returned.requireConf*
:: The same as the correspondinggetConf*
-method but this time an exception will be thrown, if the value is not present or the configuration entry has the wrong type.getParamConf*
: The same as the getConf* but this time for values of the configuration of the corresponding parameter.requireParamConf*
: The same as the requireConf* but this time for values of the configuration of the corresponding parameter.
-
-
Field Summary
Fields Modifier and Type Field Description protected ActivityInstance
activityInstance
The activity (instance) which is encapsulated by the execution environment.protected Cleanup<RuntimeException>
cleanup
The clean-up for closing theCloseable
s.protected Collection<AutoCloseable>
closeables
TheAutoCloseable
values that are created internally, for instance via conversion which are not controlled by thedataContext
.protected DataContext
dataContext
The data context for the execution environment.protected Logger
logger
The logger for execution environment.
-
Constructor Summary
Constructors Constructor Description ActivityData(ActivityInstance activityInstance, DataContext dataContext, Logger logger)
ActivityData(ActivityData actData)
Constructor for replacing the designated instance ofActivityData
with this one.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
booleanToNativeTypedValue(Boolean value, ProcessModelParameter parameter, boolean output)
Converts an instance ofBoolean
to an instance of the corresponding native type.void
close()
protected void
closeElemsIfCreated(Collection<?> coll, Object... survivors)
Closes the elements of the designated collection viaIoTools.closeLogged(Logger, AutoCloseable...)
if the element should be close by thisActivityData
, that is, it is incloseables
.protected void
closeIfCreated(Object obj)
Closes the designated object viaIoTools.closeLogged(Logger, AutoCloseable...)
if the object should be close by thisActivityData
, that is, it is incloseables
.void
closeUnknown(Object... prospCloseables)
Closes all of the designated instances which areAutoCloseable
and which are not known by thisActivtiyData
(have not been created by it and thus are not withincloseables
).Object
dateToNativeTypedValue(Date value, ProcessModelParameter parameter, boolean output)
Converts an instance ofDate
to an instance of the corresponding native type.Object
floatToNativeTypedValue(Double value, ProcessModelParameter parameter, boolean output)
Converts an instance ofDouble
to an instance of the corresponding native type.protected Object
getActInstConfValue(String entryName, ProcessConstants.AdeptDataType expDt, boolean required, Object defValue)
Gets the designated activity instance configuration value and logs messages or throws exceptions if it is not present.Collection<String>
getAllConfEntries()
Returns all configuration entry names.Boolean
getConfBoolean(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.Boolean
getConfBoolean(String entryName, Boolean defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as BOOLEAN.Date
getConfDate(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.Date
getConfDate(String entryName, Date defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as DATE.Double
getConfFloat(String entryName)
Returns the configuration value of the specified entry or the given value if it is not set or could not be parsed as FLOAT.Double
getConfFloat(String entryName, Double defaultValue)
Returns the configuration value of the specified entry or the given value if it is not set or could not be parsed as FLOAT.Long
getConfInteger(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.Long
getConfInteger(String entryName, Long defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as INTEGER.String
getConfString(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.String
getConfString(String entryName, String defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set.byte[]
getConfUDT(String entryName)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as USERDEFINED.byte[]
getConfUDT(String entryName, byte[] defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as USERDEFINED.URI
getConfURI(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.URI
getConfURI(String entryName, URI defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as URI.protected Object
getConfValue(Configuration conf, String entryName, ProcessConstants.AdeptDataType expDt, boolean required, Object defValue, String paramText)
Gets the designated configuration value and logs messages or throws exceptions if it is not present.Class<?>
getCorrespondingJavaClass(Parameter parameter, boolean output)
Gets the class object corresponding to the type of the designated parameter.<T> T
getDualInputValue(String name, ProcessConstants.AdeptDataType type, Class<T> valueType)
A "dual input parameter" is a parameter whose value can either be provided by an input parameter or by an activity configuration field with the same name or a combination of both.ProcessModelParameter
getInputParam(String parameterName)
Returns the input parameter with the given name ornull
if no such parameter exists.Collection<ProcessModelParameter>
getInputParams()
Returns all input parameters in a list.Class<?>[]
getInputTypes()
Gets the input parameter types in an array of the corresponding classes ordered by their position.Object
getInputValue(ProcessModelParameter parameter)
Retrieves the value of the designated input parameter as an object of the closest related java type.Object
getInputValue(ProcessModelParameter parameter, boolean required)
Retrieves the value of the designated input parameter as an object of the closest related java type.Object
getInputValue(ProcessModelParameter param, boolean convert, boolean required)
Retrieves the value of the specified input parameter as an object of the closest related java type or the appropriate converted type.Object
getInputValue(String parameterName)
Retrieves the value of the specified input parameter as an object of the closest related java type.Object
getInputValue(String parameterName, boolean required)
Retrieves the value of the specified input parameter as an object of the closest related java type.protected Object
getInputValue(String parameterName, ProcessConstants.AdeptDataType expDt, boolean convert, boolean required)
Retrieves the value of the specified input parameter as an object of the closest related java type.Object[]
getInputValues()
Gets the values of the input parameter in an array of object ordered by their position.ProcessModelParameter
getOutputParam(String parameterName)
Returns the output parameter with the given name ornull
if no such parameter exists.Collection<ProcessModelParameter>
getOutputParams()
Returns all output parameters in a list.Boolean
getParamConfBoolean(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, Boolean defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as BOOLEAN.Boolean
getParamConfBoolean(ActivityConstants.AccessType accessType, String parameterName, String entryName, Boolean defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as BOOLEAN.Date
getParamConfDate(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, Date defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as DATE.Date
getParamConfDate(ActivityConstants.AccessType accessType, String parameterName, String entryName, Date defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as DATE.Double
getParamConfFloat(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, Double defaultValue)
Returns the configuration value of the specified entry or the given value if it is not set or could not be parsed as FLOAT.Double
getParamConfFloat(ActivityConstants.AccessType accessType, String parameterName, String entryName, Double defaultValue)
Returns the configuration value of the specified entry or the given value if it is not set or could not be parsed as FLOAT.Long
getParamConfInteger(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, Long defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as INTEGER.Long
getParamConfInteger(ActivityConstants.AccessType accessType, String parameterName, String entryName, Long defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as INTEGER.String
getParamConfString(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, String defaultValue)
Returns the configuration value of the specified entry ornull
if it is not set.String
getParamConfString(ActivityConstants.AccessType accessType, String parameterName, String entryName, String defaultValue)
Returns the configuration value of the specified entry ornull
if it is not set.byte[]
getParamConfUDT(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, byte[] defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as USERDEFINED.byte[]
getParamConfUDT(ActivityConstants.AccessType accessType, String parameterName, String entryName, byte[] defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as USERDEFINED.URI
getParamConfURI(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, URI defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as URI.URI
getParamConfURI(ActivityConstants.AccessType accessType, String parameterName, String entryName, URI defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as URI.protected Object
getParamConfValue(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, ProcessConstants.AdeptDataType expDt, boolean required, Object defValue)
Gets the designated parameter configuration value and logs messages or throws exceptions if it is not present.protected Object
getParamConfValue(ActivityConstants.AccessType accessType, String parameterName, String entryName, ProcessConstants.AdeptDataType expDt, boolean required, Object defValue)
Gets the designated parameter configuration value and logs messages or throws exceptions if it is not present.static Deque<ProcessModelParameter>
getParametersSortedByPosition(Collection<? extends ProcessModelParameter> params)
Gets the designated parameters sorted by the configured position.Object
getStoredValue(ProcessModelParameter parameter)
Retrieves the stored value of the specified output parameter as an object of the closest related java type.Object
getStoredValue(ProcessModelParameter param, boolean convert)
Retrieves the stored value of the specified output parameter as an object of the closest related java type or the appropriate converted type.Object
getStoredValue(String parameterName)
Retrieves the stored value of the specified output parameter as an object of the closest related java type.protected Object
getStoredValue(String parameterName, ProcessConstants.AdeptDataType expDt, boolean convert)
Retrieves the stored value of the specified output parameter as an object of the closest related java type.Object[]
getStoredValues()
Gets the stored values of the output parameter in an array of object ordered by their position.boolean
hasConf(String entryName)
Returns whether the specified configuration entry is set.boolean
hasInputListParam(String parameterName, ProcessConstants.AdeptDataType elementDataType)
Returns whether the input parameter with the specified name exists and is a list with the specified element type.boolean
hasInputParam(String parameterName)
Returns whether the input parameter with the specified name exists.boolean
hasInputValue(String paramName)
Checks whether the value of the specified input parameter is set, i.e. is not null.boolean
hasOutputParam(String parameterName)
Returns whether the output parameter with the specified name exists.boolean
hasParam(String parameterName, ActivityConstants.AccessType accessType)
Returns whether the parameter with the specified name and access type exists.boolean
hasParamConf(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns whether the specified configuration entry is set.boolean
hasParamConf(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns whether the specified configuration entry is set.boolean
hasStoredValue(String paramName)
Checks whether the value of the specified output parameter has been written, i. e. is not null.Object
integerToNativeTypedValue(Long value, ProcessModelParameter parameter, boolean output)
Converts an instance ofLong
to an instance of the corresponding native type.Boolean
objectToBoolean(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofBoolean
.Date
objectToDate(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofDate
.Double
objectToFloat(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofDouble
.Long
objectToInteger(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofLong
.String
objectToString(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofString
.URI
objectToUri(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofURI
.UDTValue
objectToUserdefined(Object value, ProcessModelParameter parameter, boolean output)
Converts an object to an instance ofUDTValue
by serialising the object and encapsulating the corresponding stream in the returned instance of UDTValue.Boolean
readInputBoolean(ProcessModelParameter parameter)
Returns the value of the specified BOOLEAN input parameter ornull
if no value is set or the parameter does not exist.Boolean
readInputBoolean(String parameterName)
Returns the value of the specified BOOLEAN input parameter ornull
if no value is set or the parameter does not exist.Date
readInputDate(ProcessModelParameter parameter)
Returns the value of the specified DATE input parameter ornull
if no value is set or the parameter does not exist.Date
readInputDate(String parameterName)
Returns the value of the specified DATE input parameter ornull
if no value is set or the parameter does not exist.Double
readInputFloat(ProcessModelParameter parameter)
Returns the value of the specified FLOAT input parameter ornull
if no value is set or the parameter does not exist.Double
readInputFloat(String parameterName)
Returns the value of the specified FLOAT input parameter ornull
if no value is set or the parameter does not exist.Long
readInputInteger(ProcessModelParameter parameter)
Returns the value of the specified INTEGER input parameter ornull
if no value is set or the parameter does not exist.Long
readInputInteger(String parameterName)
Returns the value of the specified INTEGER input parameter ornull
if no value is set or the parameter does not exist.<T extends Serializable>
List<T>readInputList(ProcessModelParameter parameter)
Returns the list of the specified USERDEFINED input parameter ornull
if no value is set.<T extends Serializable>
List<T>readInputList(String parameterName)
Returns the list of the specified USERDEFINED input parameter ornull
if no value is set.protected <T extends Serializable>
List<T>readInputList(String pName, UDTValue value, String udtName)
Gets the list of the designatedProcessConstants.AdeptDataType.USERDEFINED
input parameter ornull
if the designated value isnull
.String
readInputString(ProcessModelParameter parameter)
Returns the value of the specified STRING input parameter ornull
if no value is set or the parameter does not exist.String
readInputString(String parameterName)
Returns the value of the specified STRING input parameter ornull
if no value is set or the parameter does not exist.UDTValue
readInputUDT(ProcessModelParameter parameter)
Returns the value of the specified USERDEFINED input parameter ornull
if no value is set or the parameter does not exist.UDTValue
readInputUDT(String parameterName)
Returns the value of the specified USERDEFINED input parameter ornull
if no value is set or the parameter does not exist.URI
readInputURI(ProcessModelParameter parameter)
Returns the value of the specified URI input parameter ornull
if no value is set or the parameter does not exist.URI
readInputURI(String parameterName)
Returns the value of the specified URI input parameter ornull
if no value is set or the parameter does not exist.Boolean
readOutputBoolean(ProcessModelParameter parameter)
Returns the value stored for the specified BOOLEAN output parameter ornull
if no value is set or the parameter does not exist.Boolean
readOutputBoolean(String parameterName)
Returns the value stored for the specified BOOLEAN output parameter ornull
if no value is set or the parameter does not exist.Date
readOutputDate(ProcessModelParameter parameter)
Returns the value stored for the specified DATE output parameter ornull
if no value is set or the parameter does not exist.Date
readOutputDate(String parameterName)
Returns the value stored for the specified DATE output parameter ornull
if no value is set or the parameter does not exist.Double
readOutputFloat(ProcessModelParameter parameter)
Returns the value stored for the specified FLOAT output parameter ornull
if no value is set or the parameter does not exist.Double
readOutputFloat(String parameterName)
Returns the value stored for the specified FLOAT output parameter ornull
if no value is set or the parameter does not exist.Long
readOutputInteger(ProcessModelParameter parameter)
Returns the value stored for the specified INTEGER output parameter ornull
if no value is set or the parameter does not exist.Long
readOutputInteger(String parameterName)
Returns the value stored for the specified INTEGER output parameter ornull
if no value is set or the parameter does not exist.String
readOutputString(ProcessModelParameter parameter)
Returns the value stored for the specified STRING output parameter ornull
if no value is set or the parameter does not exist.String
readOutputString(String parameterName)
Returns the value stored for the specified STRING output parameter ornull
if no value is set or the parameter does not exist.UDTValue
readOutputUDT(ProcessModelParameter parameter)
Returns the value stored for the specified USERDEFINED output parameter ornull
if no value is set or the parameter does not exist.UDTValue
readOutputUDT(String parameterName)
Returns the value stored for the specified USERDEFINED output parameter ornull
if no value is set or the parameter does not exist.URI
readOutputURI(ProcessModelParameter parameter)
Returns the value stored for the specified URI output parameter ornull
if no value is set or the parameter does not exist.URI
readOutputURI(String parameterName)
Returns the value stored for the specified URI output parameter ornull
if no value is set or the parameter does not exist.boolean
requireConfBoolean(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.Date
requireConfDate(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.double
requireConfFloat(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.long
requireConfInteger(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.String
requireConfString(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.byte[]
requireConfUDT(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.URI
requireConfURI(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.boolean
requireInputBoolean(String parameterName)
Returns the value of the specified BOOLEAN input parameter or throws an exception if the value is not available.Date
requireInputDate(String parameterName)
Returns the value of the specified DATE input parameter or throws an exception if the value is not available.double
requireInputFloat(String parameterName)
Returns the value of the specified FLOAT input parameter or throws an exception if the value is not available.long
requireInputInteger(String parameterName)
Returns the value of the specified INTEGER input parameter or throws an exception if the value is not available.ProcessModelParameter
requireInputParam(String parameterName)
Returns the input parameter with the given name, or throws an exception if the parameter does not exist.String
requireInputString(String parameterName)
Returns the value of the specified STRING input parameter or throws an exception if the value is not available.UDTValue
requireInputUDT(String parameterName)
Returns the value of the specified USERDEFINED input parameter or throws an exception if the value is not available.URI
requireInputURI(String parameterName)
Returns the value of the specified URI input parameter or throws an exception if the value is not available.ProcessModelParameter
requireOutputParam(String parameterName)
Returns the output parameter with the given name, or throws an exception if the parameter does not exist.boolean
requireParamConfBoolean(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.boolean
requireParamConfBoolean(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.Date
requireParamConfDate(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.Date
requireParamConfDate(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.double
requireParamConfFloat(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.double
requireParamConfFloat(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.long
requireParamConfInteger(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.long
requireParamConfInteger(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.String
requireParamConfString(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.String
requireParamConfString(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.byte[]
requireParamConfUDT(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.byte[]
requireParamConfUDT(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.URI
requireParamConfURI(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.URI
requireParamConfURI(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.Object
stringToNativeTypedValue(String value, ProcessModelParameter parameter, boolean output)
Converts an instance ofString
to an instance of the corresponding native type.Object
toNativeNull(ProcessModelParameter parameter, boolean output)
Gets an instance fornull
.void
unwriteOutputValue(ProcessModelParameter parameter)
Removes any previously written value for the specified output parameter.void
unwriteOutputValue(String parameterName)
Removes any previously written value for the specified output parameter.Object
uriToNativeTypedValue(URI value, ProcessModelParameter parameter, boolean output)
Converts an instance ofURI
to an instance of the corresponding native type.Object
userdefinedToNativeTypedValue(UDTValue value, ProcessModelParameter parameter, boolean output)
Converts an instance ofUDTValue
to an instance of the corresponding native type.void
writeOutputBoolean(ProcessModelParameter parameter, boolean value)
Stores the value for the specified BOOLEAN output parameter.void
writeOutputBoolean(String parameterName, boolean value)
Stores the value for the specified BOOLEAN output parameter.void
writeOutputDate(ProcessModelParameter parameter, Date value)
Stores the value for the specified DATE output parameter.void
writeOutputDate(String parameterName, Date value)
Stores the value for the specified DATE output parameter.void
writeOutputFloat(ProcessModelParameter parameter, double value)
Stores the value for the specified FLOAT output parameter.void
writeOutputFloat(String parameterName, double value)
Stores the value for the specified FLOAT output parameter.void
writeOutputInteger(ProcessModelParameter parameter, long value)
Stores the value for the specified INTEGER output parameter.void
writeOutputInteger(String parameterName, long value)
Stores the value for the specified INTEGER output parameter.void
writeOutputList(ProcessModelParameter parameter, ListUdt value)
Stores the list value for the specified USERDEFINED output parameter.void
writeOutputList(ProcessModelParameter parameter, List<?> value)
Stores the list value for the specified USERDEFINED output parameter.void
writeOutputList(String parameterName, ListUdt value)
Stores the list value for the specified USERDEFINED output parameter.void
writeOutputList(String parameterName, List<?> value)
Stores the list value for the specified USERDEFINED output parameter.void
writeOutputObject(ProcessModelParameter parameter, Serializable value)
Stores the designated serialisable object for the specified USERDEFINED output parameter.void
writeOutputObject(String parameterName, Serializable value)
Stores the designated serialisable object for the specified USERDEFINED output parameter.void
writeOutputString(ProcessModelParameter parameter, String value)
Stores the value for the specified STRING output parameter.void
writeOutputString(String parameterName, String value)
Stores the value for the specified STRING output parameter.void
writeOutputUDT(ProcessModelParameter parameter, byte[] value)
Stores the value for the specified USERDEFINED output parameter.void
writeOutputUDT(ProcessModelParameter parameter, UDTValue value)
Stores the value for the specified USERDEFINED output parameter.void
writeOutputUDT(String parameterName, byte[] value)
Stores the value for the specified USERDEFINED output parameter.void
writeOutputUDT(String parameterName, UDTValue value)
Stores the value for the specified USERDEFINED output parameter.void
writeOutputURI(ProcessModelParameter parameter, URI value)
Stores the value for the specified URI output parameter.void
writeOutputURI(String parameterName, URI value)
Stores the value for the specified URI output parameter.protected void
writeOutputValue(ProcessModelParameter param, boolean convert, Object value)
Stores the value for the specified output parameter.void
writeOutputValue(ProcessModelParameter parameter, Object value)
Stores the value for the specified output parameter.protected void
writeOutputValue(String parameterName, ProcessConstants.AdeptDataType expDt, boolean convert, Object value)
Stores the value for the specified output parameter.void
writeOutputValue(String parameterName, Object value)
Stores the value for the specified output parameter.void
writeOutputValues(Object returnValue, Object[] values)
Writes the values of the output parameters and the return value into the data context.
-
-
-
Field Detail
-
logger
protected final Logger logger
The logger for execution environment.
-
activityInstance
protected final ActivityInstance activityInstance
The activity (instance) which is encapsulated by the execution environment.
-
dataContext
protected final DataContext dataContext
The data context for the execution environment.
-
closeables
protected final Collection<AutoCloseable> closeables
TheAutoCloseable
values that are created internally, for instance via conversion which are not controlled by thedataContext
.
-
cleanup
protected final Cleanup<RuntimeException> cleanup
The clean-up for closing theCloseable
s.
-
-
Constructor Detail
-
ActivityData
public ActivityData(ActivityInstance activityInstance, DataContext dataContext, Logger logger)
- Parameters:
activityInstance
- The activity (instance) which is encapsulated by the execution environment.dataContext
- The data context for the execution environment.logger
- The logger for the execution environment.
-
ActivityData
public ActivityData(ActivityData actData)
Constructor for replacing the designated instance ofActivityData
with this one.- Parameters:
actData
- The instance ofActivityData
which to replace. The caller is responsible for closing.
-
-
Method Detail
-
getCorrespondingJavaClass
public Class<?> getCorrespondingJavaClass(Parameter parameter, boolean output)
Gets the class object corresponding to the type of the designated parameter. This method should be overridden to return a correctly typed value.
This implementation returnsboolean
,long
,double
,String
,Object
orURI
).- Parameters:
parameter
- The parameter for which the corresponding java class is to be retrieved.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The class object corresponding to the type of the designated parameter or null in case there is no such data type.
-
getInputParams
public Collection<ProcessModelParameter> getInputParams()
Returns all input parameters in a list.- Returns:
- all input parameters in a list
-
getInputParam
public ProcessModelParameter getInputParam(String parameterName)
Returns the input parameter with the given name ornull
if no such parameter exists.- Parameters:
parameterName
- name of the input parameter- Returns:
- the input parameter or
null
-
requireInputParam
public ProcessModelParameter requireInputParam(String parameterName)
Returns the input parameter with the given name, or throws an exception if the parameter does not exist.- Parameters:
parameterName
- name of the input parameter- Returns:
- the input parameter
- Throws:
ApplicationEnvironmentException
- if the parameter does not exist
-
hasParam
public boolean hasParam(String parameterName, ActivityConstants.AccessType accessType)
Returns whether the parameter with the specified name and access type exists.- Parameters:
parameterName
- The name of the parameter.accessType
- The access type of the parameter.- Returns:
- Whether the parameter exists.
-
hasInputParam
public boolean hasInputParam(String parameterName)
Returns whether the input parameter with the specified name exists.- Parameters:
parameterName
- name of the input parameter- Returns:
- whether the input parameter exists
-
hasInputListParam
public boolean hasInputListParam(String parameterName, ProcessConstants.AdeptDataType elementDataType)
Returns whether the input parameter with the specified name exists and is a list with the specified element type.- Parameters:
parameterName
- name of the input parameterelementDataType
- the expected element type of the list; null if this does not matter- Returns:
- whether the input list parameter exists
-
getInputTypes
public Class<?>[] getInputTypes()
Gets the input parameter types in an array of the corresponding classes ordered by their position. The parameter in the first position is in the array at index 0.- Returns:
- An array of class instances representing the input parameter types of the activity of this execution environment ordered by their position. At index 0 is the parameter with position 1.
-
hasInputValue
public boolean hasInputValue(String paramName)
Checks whether the value of the specified input parameter is set, i.e. is not null.- Parameters:
paramName
- The identifier of the parameter- Returns:
- Whether the input parameter has a value,
false
if the parameter is null.
-
getInputValue
public Object getInputValue(String parameterName) throws ApplicationEnvironmentException
Retrieves the value of the specified input parameter as an object of the closest related java type. The conversion methods are used for this.- Parameters:
parameterName
- The identifier of the parameter- Returns:
- The parameter value, or
null
if the parameter is not set. AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist, the data type is invalid or no value is provided anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
-
getInputValue
public Object getInputValue(ProcessModelParameter parameter) throws ApplicationEnvironmentException
Retrieves the value of the designated input parameter as an object of the closest related java type. The conversion methods are used for this.- Parameters:
parameter
- The input parameter for which to get the value.- Returns:
- The parameter value, or
null
if the parameter is not set. AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist, the data type is invalid or no value is provided anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
-
getInputValue
public Object getInputValue(String parameterName, boolean required) throws ApplicationEnvironmentException
Retrieves the value of the specified input parameter as an object of the closest related java type. The conversion methods are used for this.- Parameters:
parameterName
- The identifier of the parameterrequired
- Whether the input parameter is required (mandatory) and therefore anApplicationEnvironmentException
is to be thrown in case it is null.- Returns:
- The parameter value, or
null
if the parameter is not set. AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist, the data type is invalid or no value is provided anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
-
getInputValue
public Object getInputValue(ProcessModelParameter parameter, boolean required) throws ApplicationEnvironmentException
Retrieves the value of the designated input parameter as an object of the closest related java type. The conversion methods are used for this.- Parameters:
parameter
- The input parameter for which to get the value.required
- Whether the input parameter is required (mandatory) and therefore anApplicationEnvironmentException
is to be thrown in case it is null.- Returns:
- The parameter value, or
null
if the parameter is not set. AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist, the data type is invalid or no value is provided anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
-
getInputValue
protected Object getInputValue(String parameterName, ProcessConstants.AdeptDataType expDt, boolean convert, boolean required) throws ApplicationEnvironmentException
Retrieves the value of the specified input parameter as an object of the closest related java type. The conversion methods are used if requested. The designated expected data type improves the type safety. If it does not match the type of the parameter, anApplicationEnvironmentException
will be thrown.- Parameters:
parameterName
- The name of the parameter for which to retrieve the value.expDt
- The data type which is expected. If this isnull
, the data type of the parameter will not be checked.convert
- Whether to convert the retrieved values with the appropriate methods.required
- Whether the input parameter is required (mandatory) and therefore anApplicationEnvironmentException
is to be thrown in case it is null.- Returns:
- The parameter value, or
null
if the parameter is not set. AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist, the data type is invalid or no value is provided for a required parameter anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
-
getInputValue
public Object getInputValue(ProcessModelParameter param, boolean convert, boolean required) throws ApplicationEnvironmentException
Retrieves the value of the specified input parameter as an object of the closest related java type or the appropriate converted type.- Parameters:
param
- The parameter for which to retrieve the value.convert
- Whether to convert the retrieved values with the appropriate methods.required
- Whether the input parameter is required (mandatory) and therefore anApplicationEnvironmentException
is to be thrown in case it is null.- Returns:
- The parameter value, or
null
if the parameter is not set. AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist, the data type is invalid or no value is provided for a required parameter anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
-
getInputValues
public Object[] getInputValues()
Gets the values of the input parameter in an array of object ordered by their position. The parameter in the first position is in the array at index 0. Exceptions lead toApplicationEnvironmentException
s.- Returns:
- An array of object instances representing the input parameters values of the activity
of this execution environment ordered by their position. At index 0 is the parameter
with position 1.
AutoCloseable
values will be coupled to thisActivityData
, so do not close them if applicable; clone one if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If a parameter does not exist, the data type is invalid or no value is provided for a required parameter anApplicationEnvironmentException
will be thrown.- See Also:
getInputValue(String)
-
getDualInputValue
public <T> T getDualInputValue(String name, ProcessConstants.AdeptDataType type, Class<T> valueType)
A "dual input parameter" is a parameter whose value can either be provided by an input parameter or by an activity configuration field with the same name or a combination of both. For this method the data type of the parameter is expected to be the given type and the value of the activity parameter configuration field must be a valid string representation of that data type. In case ofProcessConstants.AdeptDataType.DATE
andProcessConstants.AdeptDataType.USERDEFINED
the special access method of the configuration will be used. It's basically an input parameter with a default value provided in the ATC.The following are the possible constellations:
- if the parameter is present and not optional, the ATC field is ignored
- if the parameter is present but optional, the value of the ATC field is only returned if the data element of the input parameter has not been written yet
- if the parameter is not present, the value of the ATC field is always returned
- Type Parameters:
T
- The type which the requested value is expected to be of.- Parameters:
name
- The name of the dual input parameter (i.e. input parameter + ATC field).type
- The data type of the parameter or configuration entry.valueType
- The (object) type of which the requested value is expected to be. AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
.- Returns:
- The value of the dual parameter.
-
readInputBoolean
public Boolean readInputBoolean(String parameterName)
Returns the value of the specified BOOLEAN input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
requireInputBoolean(String)
,InputDataContext.retrieveBooleanParameterValue(String)
-
readInputBoolean
public Boolean readInputBoolean(ProcessModelParameter parameter)
Returns the value of the specified BOOLEAN input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameter
- the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
getInputValue(ProcessModelParameter, boolean, boolean)
,InputDataContext.retrieveBooleanParameterValue(String)
-
readInputInteger
public Long readInputInteger(String parameterName)
Returns the value of the specified INTEGER input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
requireInputInteger(String)
,InputDataContext.retrieveIntegerParameterValue(String)
-
readInputInteger
public Long readInputInteger(ProcessModelParameter parameter)
Returns the value of the specified INTEGER input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameter
- the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
getInputValue(ProcessModelParameter, boolean, boolean)
,InputDataContext.retrieveIntegerParameterValue(String)
-
readInputFloat
public Double readInputFloat(String parameterName)
Returns the value of the specified FLOAT input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
requireInputFloat(String)
,InputDataContext.retrieveFloatParameterValue(String)
-
readInputFloat
public Double readInputFloat(ProcessModelParameter parameter)
Returns the value of the specified FLOAT input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameter
- the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
getInputValue(ProcessModelParameter, boolean, boolean)
,InputDataContext.retrieveFloatParameterValue(String)
-
readInputString
public String readInputString(String parameterName)
Returns the value of the specified STRING input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
requireInputString(String)
,InputDataContext.retrieveStringParameterValue(String)
-
readInputString
public String readInputString(ProcessModelParameter parameter)
Returns the value of the specified STRING input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameter
- the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
getInputValue(ProcessModelParameter, boolean, boolean)
,InputDataContext.retrieveStringParameterValue(String)
-
readInputDate
public Date readInputDate(String parameterName)
Returns the value of the specified DATE input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
requireInputDate(String)
,InputDataContext.retrieveDateParameterValue(String)
-
readInputDate
public Date readInputDate(ProcessModelParameter parameter)
Returns the value of the specified DATE input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameter
- the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
getInputValue(ProcessModelParameter, boolean, boolean)
,InputDataContext.retrieveDateParameterValue(String)
-
readInputURI
public URI readInputURI(String parameterName)
Returns the value of the specified URI input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
requireInputURI(String)
,InputDataContext.retrieveURIParameterValue(String)
-
readInputURI
public URI readInputURI(ProcessModelParameter parameter)
Returns the value of the specified URI input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameter
- the input parameter- Returns:
- the retrieved value; may be
null
- See Also:
getInputValue(ProcessModelParameter, boolean, boolean)
,InputDataContext.retrieveURIParameterValue(String)
-
readInputUDT
public UDTValue readInputUDT(String parameterName)
Returns the value of the specified USERDEFINED input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- The retrieved value; may be
null
. The UDTValue will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - See Also:
requireInputUDT(String)
,InputDataContext.retrieveUDTParameterValue(String)
-
readInputUDT
public UDTValue readInputUDT(ProcessModelParameter parameter)
Returns the value of the specified USERDEFINED input parameter ornull
if no value is set or the parameter does not exist. Use this method foroptional
input parameters.- Parameters:
parameter
- the input parameter- Returns:
- the retrieved value; may be
null
. The UDTValue will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - See Also:
getInputValue(ProcessModelParameter, boolean, boolean)
,InputDataContext.retrieveUDTParameterValue(String)
-
readInputList
public <T extends Serializable> List<T> readInputList(String parameterName)
Returns the list of the specified USERDEFINED input parameter ornull
if no value is set. Use this method foroptional
input parameters.- Type Parameters:
T
- the element type of the list- Parameters:
parameterName
- name of the input parameter- Returns:
- The retrieved list; may be
null
.AutoCloseable
list elements will be coupled to thisActivityData
, so do not close them; clone one if required longer than thisActivityData
. - See Also:
requireInputList(String)
-
readInputList
public <T extends Serializable> List<T> readInputList(ProcessModelParameter parameter)
Returns the list of the specified USERDEFINED input parameter ornull
if no value is set. Use this method foroptional
input parameters.- Type Parameters:
T
- the element type of the list- Parameters:
parameter
- the input parameter- Returns:
- The retrieved list; may be
null
.AutoCloseable
list elements will be coupled to thisActivityData
, so do not close them; clone one if required longer than thisActivityData
. - See Also:
requireInputList(String)
-
readInputList
protected <T extends Serializable> List<T> readInputList(String pName, UDTValue value, String udtName)
Gets the list of the designatedProcessConstants.AdeptDataType.USERDEFINED
input parameter ornull
if the designated value isnull
. The designated UDT name is used to analyse the UDT and if it is neither a serialised list nor a list UDT, anApplicationEnvironmentException
will be thrown.- Type Parameters:
T
- The type of the list elements.- Parameters:
pName
- The name of the input parameter providing the list from a UDT valuevalue
- The UDT value containing the list. The caller is responsible for closing.udtName
- The name of the UDT value (usually providing information on the list and its content).- Returns:
- The list retrieved from the designated value or
null
if the designated value isnull
.
AutoCloseable
list elements will be coupled to thisActivityData
, so do not close them; clone one if required longer than thisActivityData
. - See Also:
readInputList(String)
-
requireInputBoolean
public boolean requireInputBoolean(String parameterName) throws ApplicationEnvironmentException
Returns the value of the specified BOOLEAN input parameter or throws an exception if the value is not available. Use this method formandatory
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value
- Throws:
ApplicationEnvironmentException
- if the input value could not be retrieved (parameter does not exist; wrong data type) or if the value is not available- See Also:
readInputBoolean(String)
,InputDataContext.retrieveBooleanParameterValue(String)
-
requireInputInteger
public long requireInputInteger(String parameterName) throws ApplicationEnvironmentException
Returns the value of the specified INTEGER input parameter or throws an exception if the value is not available. Use this method formandatory
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value
- Throws:
ApplicationEnvironmentException
- if the input value could not be retrieved (parameter does not exist; wrong data type) or if the value is not available- See Also:
readInputInteger(String)
,InputDataContext.retrieveIntegerParameterValue(String)
-
requireInputFloat
public double requireInputFloat(String parameterName) throws ApplicationEnvironmentException
Returns the value of the specified FLOAT input parameter or throws an exception if the value is not available. Use this method formandatory
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value
- Throws:
ApplicationEnvironmentException
- if the input value could not be retrieved (parameter does not exist; wrong data type) or if the value is not available- See Also:
readInputFloat(String)
,InputDataContext.retrieveFloatParameterValue(String)
-
requireInputString
public String requireInputString(String parameterName) throws ApplicationEnvironmentException
Returns the value of the specified STRING input parameter or throws an exception if the value is not available. Use this method formandatory
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; never
null
- Throws:
ApplicationEnvironmentException
- if the input value could not be retrieved (parameter does not exist; wrong data type) or if the value is not available- See Also:
readInputString(String)
,InputDataContext.retrieveStringParameterValue(String)
-
requireInputDate
public Date requireInputDate(String parameterName) throws ApplicationEnvironmentException
Returns the value of the specified DATE input parameter or throws an exception if the value is not available. Use this method formandatory
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; never
null
- Throws:
ApplicationEnvironmentException
- if the input value could not be retrieved (parameter does not exist; wrong data type) or if the value is not available- See Also:
readInputDate(String)
,InputDataContext.retrieveDateParameterValue(String)
-
requireInputURI
public URI requireInputURI(String parameterName) throws ApplicationEnvironmentException
Returns the value of the specified URI input parameter or throws an exception if the value is not available. Use this method formandatory
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; never
null
- Throws:
ApplicationEnvironmentException
- if the input value could not be retrieved (parameter does not exist; wrong data type) or if the value is not available- See Also:
readInputURI(String)
,InputDataContext.retrieveURIParameterValue(String)
-
requireInputUDT
public UDTValue requireInputUDT(String parameterName) throws ApplicationEnvironmentException
Returns the value of the specified USERDEFINED input parameter or throws an exception if the value is not available. Use this method formandatory
input parameters.- Parameters:
parameterName
- name of the input parameter- Returns:
- the retrieved value; never
null
. The value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- if the input value could not be retrieved (parameter does not exist; wrong data type) or if the value is not available- See Also:
readInputUDT(String)
,InputDataContext.retrieveUDTParameterValue(String)
-
toNativeNull
public Object toNativeNull(ProcessModelParameter parameter, boolean output)
Gets an instance fornull
. This allows for converting to a specific null value.
This implementation returnsnull
.Overriding implementations creating a new object being an
AutoCloseable
itself or an object havingAutoCloseable
elements have to add them tocloseables
.- Parameters:
parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The
null
value.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
.
-
booleanToNativeTypedValue
public Object booleanToNativeTypedValue(Boolean value, ProcessModelParameter parameter, boolean output)
Converts an instance ofBoolean
to an instance of the corresponding native type. This method should be overridden to return a correctly typed value.
This implementation returns the instance unchanged.Overriding implementations creating a new object being an
AutoCloseable
itself or an object havingAutoCloseable
elements have to add them tocloseables
.- Parameters:
value
- An instance ofBoolean
to be converted to native type.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value unchanged.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
.
-
integerToNativeTypedValue
public Object integerToNativeTypedValue(Long value, ProcessModelParameter parameter, boolean output)
Converts an instance ofLong
to an instance of the corresponding native type. This method should be overridden to return a correctly typed value.
This implementation returns the instance unchanged.Overriding implementations creating a new object being an
AutoCloseable
itself or an object havingAutoCloseable
elements have to add them tocloseables
.- Parameters:
value
- An instance ofLong
to be converted to native type.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value unchanged.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
.
-
floatToNativeTypedValue
public Object floatToNativeTypedValue(Double value, ProcessModelParameter parameter, boolean output)
Converts an instance ofDouble
to an instance of the corresponding native type. This method should be overridden to return a correctly typed value.
This implementation returns the instance unchanged.Overriding implementations creating a new object being an
AutoCloseable
itself or an object havingAutoCloseable
elements have to add them tocloseables
.- Parameters:
value
- An instance ofDouble
to be converted to native type.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value unchanged.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
.
-
stringToNativeTypedValue
public Object stringToNativeTypedValue(String value, ProcessModelParameter parameter, boolean output)
Converts an instance ofString
to an instance of the corresponding native type. This method should be overridden to return a correctly typed value.
This implementation returns the instance unchanged.Overriding implementations creating a new object being an
AutoCloseable
itself or an object havingAutoCloseable
elements have to add them tocloseables
.- Parameters:
value
- An instance ofString
to be converted to native type.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value unchanged.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
.
-
dateToNativeTypedValue
public Object dateToNativeTypedValue(Date value, ProcessModelParameter parameter, boolean output)
Converts an instance ofDate
to an instance of the corresponding native type. This method should be overridden to return a correctly typed value.
This implementation returns the instance unchanged.Overriding implementations creating a new object being an
AutoCloseable
itself or an object havingAutoCloseable
elements have to add them tocloseables
.- Parameters:
value
- An instance ofDate
to be converted to native type.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value unchanged.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
.
-
userdefinedToNativeTypedValue
public Object userdefinedToNativeTypedValue(UDTValue value, ProcessModelParameter parameter, boolean output)
Converts an instance ofUDTValue
to an instance of the corresponding native type. This method should be overridden to return a correctly typed value.
This implementation creates an instance ofObject
by interpreting the UDT as an object stream and de-serialising the appropriate object. In case of aListUdt
it will be unmarshalled appropriately and the corresponding list will be returned.
The corresponding class of the object needs to be in the class path!Overriding implementations creating a new object being an
AutoCloseable
itself or an object havingAutoCloseable
elements have to add them tocloseables
.- Parameters:
value
- The UDTValue containing a serialised object to be converted to native type. The caller is responsible for closing.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- An instance of
Object
read from the designated UDTValue ornull
in case the object can not be read.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
.
-
uriToNativeTypedValue
public Object uriToNativeTypedValue(URI value, ProcessModelParameter parameter, boolean output)
Converts an instance ofURI
to an instance of the corresponding native type. This method should be overridden to return a correctly typed value.
This implementation returns the instance unchanged.Overriding implementations creating a new object being an
AutoCloseable
itself or an object havingAutoCloseable
elements have to add them tocloseables
.- Parameters:
value
- An instance ofURI
to be converted to native type.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value unchanged.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
.
-
hasStoredValue
public boolean hasStoredValue(String paramName)
Checks whether the value of the specified output parameter has been written, i. e. is not null.- Parameters:
paramName
- The name of the parameter of which to check whether a value has been written.- Returns:
- Whether the output parameter has a value,
false
if the parameter value isnull
.
-
getStoredValue
public Object getStoredValue(String parameterName) throws ApplicationEnvironmentException
Retrieves the stored value of the specified output parameter as an object of the closest related java type. The conversion methods are used for this.- Parameters:
parameterName
- The identifier of the parameter- Returns:
- The parameter value, or
null
if the parameter has not been written yet.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist or the data type is invalid anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
,getInputValue(String)
-
getStoredValue
public Object getStoredValue(ProcessModelParameter parameter) throws ApplicationEnvironmentException
Retrieves the stored value of the specified output parameter as an object of the closest related java type. The conversion methods are used for this.- Parameters:
parameter
- The output parameter- Returns:
- The parameter value, or
null
if the parameter has not been written yet.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist or the data type is invalid anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
,getInputValue(String)
-
getStoredValue
protected Object getStoredValue(String parameterName, ProcessConstants.AdeptDataType expDt, boolean convert) throws ApplicationEnvironmentException
Retrieves the stored value of the specified output parameter as an object of the closest related java type. The conversion methods are used if requested. The designated expected data type improves the type safety. If it does not match the type of the parameter, anApplicationEnvironmentException
will be thrown.- Parameters:
parameterName
- The name of the parameter for which to retrieve the value.expDt
- The data type which is expected. If this isnull
, the data type of the parameter will not be checked.convert
- Whether to convert the retrieved values with the appropriate methods.- Returns:
- The parameter value, or
null
if the parameter is not set.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist or the data type is invalid anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
-
getStoredValue
public Object getStoredValue(ProcessModelParameter param, boolean convert) throws ApplicationEnvironmentException
Retrieves the stored value of the specified output parameter as an object of the closest related java type or the appropriate converted type.- Parameters:
param
- The parameter for which to retrieve the value.convert
- Whether to convert the retrieved values with the appropriate methods.- Returns:
- The parameter value, or
null
if the parameter is not set.
AnAutoCloseable
value will be coupled to thisActivityData
, so do not close it if applicable; clone it if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist or the data type is invalid anApplicationEnvironmentException
will be thrown.- See Also:
toNativeNull(ProcessModelParameter, boolean)
,booleanToNativeTypedValue(Boolean, ProcessModelParameter, boolean)
,integerToNativeTypedValue(Long, ProcessModelParameter, boolean)
,floatToNativeTypedValue(Double, ProcessModelParameter, boolean)
,stringToNativeTypedValue(String, ProcessModelParameter, boolean)
,userdefinedToNativeTypedValue(UDTValue, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
-
getStoredValues
public Object[] getStoredValues() throws ApplicationEnvironmentException
Gets the stored values of the output parameter in an array of object ordered by their position. The parameter in the first position is in the array at index 0. Exceptions when reading a value of user-defined data type, incorrect parameter names and incorrect parameter types are logged and the corresponding parameter value is set to null.- Returns:
- An array of object instances representing the output parameters values of the activity
of this execution environment ordered by their position. At index 0 is the parameter
with position 1.
AutoCloseable
values will be coupled to thisActivityData
, so do not close them if applicable; clone one if required longer than thisActivityData
. - Throws:
ApplicationEnvironmentException
- If the parameter does not exist or the data type is invalid anApplicationEnvironmentException
will be thrown.- See Also:
getStoredValue(String)
-
readOutputBoolean
public Boolean readOutputBoolean(String parameterName)
Returns the value stored for the specified BOOLEAN output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameterName
- The name of the output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputBoolean(String, boolean)
,DataContext.storedBooleanParameterValue(String)
-
readOutputBoolean
public Boolean readOutputBoolean(ProcessModelParameter parameter)
Returns the value stored for the specified BOOLEAN output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameter
- The output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputBoolean(ProcessModelParameter, boolean)
,DataContext.storedBooleanParameterValue(String)
-
readOutputInteger
public Long readOutputInteger(String parameterName)
Returns the value stored for the specified INTEGER output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameterName
- The name of the output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputInteger(String, long)
,DataContext.storedIntegerParameterValue(String)
-
readOutputInteger
public Long readOutputInteger(ProcessModelParameter parameter)
Returns the value stored for the specified INTEGER output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameter
- The output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputInteger(ProcessModelParameter, long)
,DataContext.storedIntegerParameterValue(String)
-
readOutputFloat
public Double readOutputFloat(String parameterName)
Returns the value stored for the specified FLOAT output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameterName
- The name of the output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputFloat(String, double)
,DataContext.storedFloatParameterValue(String)
-
readOutputFloat
public Double readOutputFloat(ProcessModelParameter parameter)
Returns the value stored for the specified FLOAT output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameter
- The output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputFloat(ProcessModelParameter, double)
,DataContext.storedFloatParameterValue(String)
-
readOutputString
public String readOutputString(String parameterName)
Returns the value stored for the specified STRING output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameterName
- The name of the output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputString(String, String)
,DataContext.storedStringParameterValue(String)
-
readOutputString
public String readOutputString(ProcessModelParameter parameter)
Returns the value stored for the specified STRING output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameter
- The output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputString(ProcessModelParameter, String)
,DataContext.storedStringParameterValue(String)
-
readOutputDate
public Date readOutputDate(String parameterName)
Returns the value stored for the specified DATE output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameterName
- The name of the output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputDate(String, Date)
,DataContext.storedDateParameterValue(String)
-
readOutputDate
public Date readOutputDate(ProcessModelParameter parameter)
Returns the value stored for the specified DATE output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameter
- The output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputDate(ProcessModelParameter, Date)
,DataContext.storedDateParameterValue(String)
-
readOutputURI
public URI readOutputURI(String parameterName)
Returns the value stored for the specified URI output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameterName
- The name of the output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputURI(String, URI)
,DataContext.storedURIParameterValue(String)
-
readOutputURI
public URI readOutputURI(ProcessModelParameter parameter)
Returns the value stored for the specified URI output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameter
- The output parameter.- Returns:
- The previously stored value; may be
null
. - See Also:
writeOutputURI(String, URI)
,DataContext.storedURIParameterValue(String)
-
readOutputUDT
public UDTValue readOutputUDT(String parameterName)
Returns the value stored for the specified USERDEFINED output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameterName
- The name of the output parameter.- Returns:
- The previously stored value; may be
null
. The value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - See Also:
writeOutputUDT(String, UDTValue)
,writeOutputUDT(String, byte[])
,DataContext.storedUDTParameterValue(String)
-
readOutputUDT
public UDTValue readOutputUDT(ProcessModelParameter parameter)
Returns the value stored for the specified USERDEFINED output parameter ornull
if no value is set or the parameter does not exist.- Parameters:
parameter
- The output parameter.- Returns:
- The previously stored value; may be
null
. The value will be coupled to thisActivityData
, so do not close it; clone it if required longer than thisActivityData
. - See Also:
writeOutputUDT(ProcessModelParameter, UDTValue)
,writeOutputUDT(ProcessModelParameter, byte[])
,DataContext.storedUDTParameterValue(String)
-
getOutputParams
public Collection<ProcessModelParameter> getOutputParams()
Returns all output parameters in a list.- Returns:
- all output parameters in a list
-
getOutputParam
public ProcessModelParameter getOutputParam(String parameterName)
Returns the output parameter with the given name ornull
if no such parameter exists.- Parameters:
parameterName
- name of the output parameter- Returns:
- the input parameter or
null
-
requireOutputParam
public ProcessModelParameter requireOutputParam(String parameterName)
Returns the output parameter with the given name, or throws an exception if the parameter does not exist.- Parameters:
parameterName
- name of the output parameter- Returns:
- the input parameter
- Throws:
ApplicationEnvironmentException
- if the parameter does not exist
-
hasOutputParam
public boolean hasOutputParam(String parameterName)
Returns whether the output parameter with the specified name exists.- Parameters:
parameterName
- the output parameter name- Returns:
- whether the output parameter exists
-
writeOutputValue
public void writeOutputValue(String parameterName, Object value)
Stores the value for the specified output parameter. This will overwrite any previously written value.The conversion methods are used for this. Per default they expect the object types to be the same as the matching type-specific
setOutput
methods. If the value is aList
it will be serialised accordingly to a UDT value.- Parameters:
parameterName
- The name of the output parameter.value
- The value to be stored. The caller is responsible for closing if appropriate.- See Also:
objectToBoolean(Object, ProcessModelParameter, boolean)
,objectToInteger(Object, ProcessModelParameter, boolean)
,objectToFloat(Object, ProcessModelParameter, boolean)
,objectToString(Object, ProcessModelParameter, boolean)
,objectToUserdefined(Object, ProcessModelParameter, boolean)
,objectToUri(Object, ProcessModelParameter, boolean)
-
writeOutputValue
public void writeOutputValue(ProcessModelParameter parameter, Object value)
Stores the value for the specified output parameter. This will overwrite any previously written value.The conversion methods are used for this. Per default they expect the object types to be the same as the matching type-specific
setOutput
methods. If the value is aList
it will be serialised accordingly to a UDT value.- Parameters:
parameter
- The output parameter.value
- The value to be stored. The caller is responsible for closing if appropriate.- See Also:
objectToBoolean(Object, ProcessModelParameter, boolean)
,objectToInteger(Object, ProcessModelParameter, boolean)
,objectToFloat(Object, ProcessModelParameter, boolean)
,objectToString(Object, ProcessModelParameter, boolean)
,objectToUserdefined(Object, ProcessModelParameter, boolean)
,objectToUri(Object, ProcessModelParameter, boolean)
-
writeOutputValue
protected void writeOutputValue(String parameterName, ProcessConstants.AdeptDataType expDt, boolean convert, Object value)
Stores the value for the specified output parameter. This will overwrite any previously written value. The designated expected data type improves the type safety. If it does not match the type of the parameter, anApplicationEnvironmentException
will be thrown.The conversion methods are used for this. Per default they expect the object types to be the same as the matching type-specific
setOutput
methods. If the value is aList
it will be serialised accordingly to a UDT value.- Parameters:
parameterName
- The name of the output parameter.expDt
- The data type which is expected. If this isnull
, the data type of the parameter will not be checked.convert
- Whether to convert the designated value with the appropriate methods before storing it.value
- The value to be stored. The caller is responsible for closing if appropriate.- See Also:
objectToBoolean(Object, ProcessModelParameter, boolean)
,objectToInteger(Object, ProcessModelParameter, boolean)
,objectToFloat(Object, ProcessModelParameter, boolean)
,objectToString(Object, ProcessModelParameter, boolean)
,objectToUserdefined(Object, ProcessModelParameter, boolean)
,objectToUri(Object, ProcessModelParameter, boolean)
,uriToNativeTypedValue(URI, ProcessModelParameter, boolean)
-
writeOutputValue
protected void writeOutputValue(ProcessModelParameter param, boolean convert, Object value)
Stores the value for the specified output parameter. This will overwrite any previously written value.- Parameters:
param
- The output parameter.convert
- Whether to convert the designated value with the appropriate methods before storing it.value
- The value to be stored. The caller is responsible for closing if appropriate.- See Also:
objectToBoolean(Object, ProcessModelParameter, boolean)
,objectToInteger(Object, ProcessModelParameter, boolean)
,objectToFloat(Object, ProcessModelParameter, boolean)
,objectToString(Object, ProcessModelParameter, boolean)
,objectToUserdefined(Object, ProcessModelParameter, boolean)
,objectToUri(Object, ProcessModelParameter, boolean)
-
writeOutputValues
public void writeOutputValues(Object returnValue, Object[] values)
Writes the values of the output parameters and the return value into the data context. The designated return value is stored as value for the parameter with position 0. Exceptions when accessing the values (invalid positions or no values provided) are logged and the corresponding value is set to NULL.- Parameters:
returnValue
- The return value of the application which is stored for the output parameter with position 0.values
- The output parameter values as array of object. The positions need to correspond to the parameter positions defined for the executed activity while the parameter with position 1 is stored at index 0 in the array.
The caller is responsible for closing the values if appropriate.
-
closeUnknown
public void closeUnknown(Object... prospCloseables)
Closes all of the designated instances which areAutoCloseable
and which are not known by thisActivtiyData
(have not been created by it and thus are not withincloseables
). This ensures closing ofAutoCloseables
created by the user (usually execution environments). Often these environments cannot distinguish betweenAutoCloseable
s provided byActivityData
for which they are not responsible and the ones they have created and are responsible for.- Parameters:
prospCloseables
- Arbitrary objects of which allAutoCloseable
instances which have not been created by thisActivtityData
will be closed.
-
unwriteOutputValue
public void unwriteOutputValue(String parameterName)
Removes any previously written value for the specified output parameter.- Parameters:
parameterName
- name of the output parameter
-
unwriteOutputValue
public void unwriteOutputValue(ProcessModelParameter parameter)
Removes any previously written value for the specified output parameter.- Parameters:
parameter
- The output parameter.
-
writeOutputBoolean
public void writeOutputBoolean(String parameterName, boolean value)
Stores the value for the specified BOOLEAN output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- the value to be stored- See Also:
DataContext.storeBooleanParameterValue(String, boolean)
-
writeOutputBoolean
public void writeOutputBoolean(ProcessModelParameter parameter, boolean value)
Stores the value for the specified BOOLEAN output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- the value to be stored- See Also:
DataContext.storeBooleanParameterValue(String, boolean)
-
writeOutputInteger
public void writeOutputInteger(String parameterName, long value)
Stores the value for the specified INTEGER output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- the value to be stored- See Also:
DataContext.storeIntegerParameterValue(String, long)
-
writeOutputInteger
public void writeOutputInteger(ProcessModelParameter parameter, long value)
Stores the value for the specified INTEGER output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- the value to be stored- See Also:
DataContext.storeIntegerParameterValue(String, long)
-
writeOutputFloat
public void writeOutputFloat(String parameterName, double value)
Stores the value for the specified FLOAT output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- the value to be stored- See Also:
DataContext.storeFloatParameterValue(String, double)
-
writeOutputFloat
public void writeOutputFloat(ProcessModelParameter parameter, double value)
Stores the value for the specified FLOAT output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- the value to be stored- See Also:
DataContext.storeFloatParameterValue(String, double)
-
writeOutputString
public void writeOutputString(String parameterName, String value)
Stores the value for the specified STRING output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- the value to be stored- See Also:
DataContext.storeStringParameterValue(String, String)
-
writeOutputString
public void writeOutputString(ProcessModelParameter parameter, String value)
Stores the value for the specified STRING output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- the value to be stored- See Also:
DataContext.storeStringParameterValue(String, String)
-
writeOutputDate
public void writeOutputDate(String parameterName, Date value)
Stores the value for the specified DATE output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- the value to be stored- See Also:
DataContext.storeDateParameterValue(String, Date)
-
writeOutputDate
public void writeOutputDate(ProcessModelParameter parameter, Date value)
Stores the value for the specified DATE output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- the value to be stored- See Also:
DataContext.storeDateParameterValue(String, Date)
-
writeOutputURI
public void writeOutputURI(String parameterName, URI value)
Stores the value for the specified URI output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- the value to be stored- See Also:
DataContext.storeURIParameterValue(String, URI)
-
writeOutputURI
public void writeOutputURI(ProcessModelParameter parameter, URI value)
Stores the value for the specified URI output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- the value to be stored- See Also:
DataContext.storeURIParameterValue(String, URI)
-
writeOutputUDT
public void writeOutputUDT(String parameterName, UDTValue value)
Stores the value for the specified USERDEFINED output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- the value to be stored. The caller is responsible for closing.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
writeOutputUDT
public void writeOutputUDT(ProcessModelParameter parameter, UDTValue value)
Stores the value for the specified USERDEFINED output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- the value to be stored. The caller is responsible for closing.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
writeOutputUDT
public void writeOutputUDT(String parameterName, byte[] value)
Stores the value for the specified USERDEFINED output parameter. The same user-defined type will be assumed as the output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- the value to be stored.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
writeOutputUDT
public void writeOutputUDT(ProcessModelParameter parameter, byte[] value)
Stores the value for the specified USERDEFINED output parameter. The same user-defined type will be assumed as the output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- the value to be stored.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
writeOutputList
public void writeOutputList(String parameterName, List<?> value)
Stores the list value for the specified USERDEFINED output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- The list to be stored. The caller is responsible for closing the elements if appropriate.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
writeOutputList
public void writeOutputList(ProcessModelParameter parameter, List<?> value)
Stores the list value for the specified USERDEFINED output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- The list to be stored. The caller is responsible for closing the elements if appropriate.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
writeOutputList
public void writeOutputList(String parameterName, ListUdt value)
Stores the list value for the specified USERDEFINED output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- The ListUdt to be stored. The caller is responsible for closing.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
writeOutputList
public void writeOutputList(ProcessModelParameter parameter, ListUdt value)
Stores the list value for the specified USERDEFINED output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- The ListUdt to be stored. The caller is responsible for closing.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
writeOutputObject
public void writeOutputObject(String parameterName, Serializable value)
Stores the designated serialisable object for the specified USERDEFINED output parameter. This will overwrite any previously written value.- Parameters:
parameterName
- name of the output parametervalue
- The serialisable object to store. The caller is responsible for closing if appropriate.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
writeOutputObject
public void writeOutputObject(ProcessModelParameter parameter, Serializable value)
Stores the designated serialisable object for the specified USERDEFINED output parameter. This will overwrite any previously written value.- Parameters:
parameter
- The output parameter.value
- The serialisable object to store. The caller is responsible for closing if appropriate.- See Also:
DataContext.storeUDTParameterValue(String, UDTValue)
-
objectToBoolean
public Boolean objectToBoolean(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofBoolean
. This method should be overridden to convert from the correct native type.
This implementation casts the designated parameter.- Parameters:
value
- An instance ofObject
(native data type) to be converted toBoolean
. This may benull
ornative null
.
The caller is responsible for closing if appropriate.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value cast.
-
objectToInteger
public Long objectToInteger(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofLong
. This method should be overridden to convert from the correct native type.
This implementation casts the designated parameter.- Parameters:
value
- An instance ofObject
(native data type) to be converted toLong
. This may benull
ornative null
.
The caller is responsible for closing if appropriate.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value cast.
-
objectToFloat
public Double objectToFloat(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofDouble
. This method should be overridden to convert from the correct native type.
This implementation casts the designated parameter.- Parameters:
value
- An instance ofObject
(native data type) to be converted toDouble
. This may benull
ornative null
.
The caller is responsible for closing if appropriate.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value cast.
-
objectToString
public String objectToString(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofString
. This method should be overridden to convert from the correct native type.
This implementation casts the designated parameter.- Parameters:
value
- An instance ofObject
(native data type) to be converted toString
. This may benull
ornative null
.
The caller is responsible for closing if appropriate.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value cast.
-
objectToDate
public Date objectToDate(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofDate
. This method should be overridden to convert from the correct native type.
This implementation casts the designated parameter.- Parameters:
value
- An instance ofObject
(native data type) to be converted toDate
. This may benull
ornative null
.
The caller is responsible for closing if appropriate.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value cast.
-
objectToUri
public URI objectToUri(Object value, ProcessModelParameter parameter, boolean output)
Converts an object (of native type) to an instance ofURI
. This method should be overridden to convert from the correct native type.
This implementation casts the designated parameter.- Parameters:
value
- An instance ofObject
(native data type) to be converted toURI
. This may benull
ornative null
.
The caller is responsible for closing if appropriate.parameter
- The corresponding parameter for further information.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- The designated value cast.
-
objectToUserdefined
public UDTValue objectToUserdefined(Object value, ProcessModelParameter parameter, boolean output)
Converts an object to an instance ofUDTValue
by serialising the object and encapsulating the corresponding stream in the returned instance of UDTValue.
The object needs to be serialisable! In case of aUDTValue
, it will be used directly. If the object is not serialisable or serialisation fails, anApplicationFailedException
will be thrown.Overriding implementations creating a new
UDTValue
itself have to add it tocloseables
.- Parameters:
value
- The object to store in an instance ofUDTValue
. This must not benull
nornative null
.
The caller is responsible for closing if appropriate.parameter
- The output parameter that needs a conversion fromObject
toUDTValue
.output
- Whether the designated parameter is an output parameter (or an input parameter otherwise).- Returns:
- An instance of UDTValue encapsulating the serialised designated object. The value will
be coupled to this
ActivityData
, so do not close it; clone it if required longer than thisActivityData
.
-
getAllConfEntries
public Collection<String> getAllConfEntries()
Returns all configuration entry names.- Returns:
- All entry names that have a value in this configuration or are retrieved from an input parameter or a process configuration.
-
hasConf
public boolean hasConf(String entryName)
Returns whether the specified configuration entry is set.- Parameters:
entryName
- name of the configuration entry- Returns:
- whether the specified configuration entry is set
-
getConfBoolean
public Boolean getConfBoolean(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value if available or null
-
getConfBoolean
public Boolean getConfBoolean(String entryName, Boolean defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as BOOLEAN. In the latter case a warning is logged.- Parameters:
entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getConfInteger
public Long getConfInteger(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value if available or null
-
getConfInteger
public Long getConfInteger(String entryName, Long defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as INTEGER. In the latter case a warning is logged.- Parameters:
entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getConfFloat
public Double getConfFloat(String entryName)
Returns the configuration value of the specified entry or the given value if it is not set or could not be parsed as FLOAT. In the latter case a warning is logged.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value if available or null
-
getConfFloat
public Double getConfFloat(String entryName, Double defaultValue)
Returns the configuration value of the specified entry or the given value if it is not set or could not be parsed as FLOAT. In the latter case a warning is logged.- Parameters:
entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getConfString
public String getConfString(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value if available or null
-
getConfString
public String getConfString(String entryName, String defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set.- Parameters:
entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getConfDate
public Date getConfDate(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value if available or null
-
getConfDate
public Date getConfDate(String entryName, Date defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as DATE. In the latter case a warning is logged.- Parameters:
entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getConfURI
public URI getConfURI(String entryName)
Returns the configuration value of the specified entry ornull
if it is not set.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value if available or null
-
getConfURI
public URI getConfURI(String entryName, URI defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as URI. In the latter case a warning is logged.- Parameters:
entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getConfUDT
public byte[] getConfUDT(String entryName)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as USERDEFINED. In the latter case a warning is logged.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value if available or null
-
getConfUDT
public byte[] getConfUDT(String entryName, byte[] defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as USERDEFINED. In the latter case a warning is logged.- Parameters:
entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
requireConfBoolean
public boolean requireConfBoolean(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as BOOLEAN
-
requireConfInteger
public long requireConfInteger(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as INTEGER
-
requireConfFloat
public double requireConfFloat(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as FLOAT
-
requireConfString
public String requireConfString(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing
-
requireConfDate
public Date requireConfDate(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as DATE
-
requireConfURI
public URI requireConfURI(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as URI
-
requireConfUDT
public byte[] requireConfUDT(String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
entryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as USERDEFINED
-
hasParamConf
public boolean hasParamConf(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns whether the specified configuration entry is set.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entry- Returns:
- whether the specified configuration entry is set
-
hasParamConf
public boolean hasParamConf(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns whether the specified configuration entry is set.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entry- Returns:
- whether the specified configuration entry is set
-
getParamConfBoolean
public Boolean getParamConfBoolean(ActivityConstants.AccessType accessType, String parameterName, String entryName, Boolean defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as BOOLEAN. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfBoolean
public Boolean getParamConfBoolean(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, Boolean defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as BOOLEAN. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfInteger
public Long getParamConfInteger(ActivityConstants.AccessType accessType, String parameterName, String entryName, Long defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as INTEGER. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfInteger
public Long getParamConfInteger(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, Long defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as INTEGER. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfFloat
public Double getParamConfFloat(ActivityConstants.AccessType accessType, String parameterName, String entryName, Double defaultValue)
Returns the configuration value of the specified entry or the given value if it is not set or could not be parsed as FLOAT. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfFloat
public Double getParamConfFloat(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, Double defaultValue)
Returns the configuration value of the specified entry or the given value if it is not set or could not be parsed as FLOAT. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfString
public String getParamConfString(ActivityConstants.AccessType accessType, String parameterName, String entryName, String defaultValue)
Returns the configuration value of the specified entry ornull
if it is not set.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfString
public String getParamConfString(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, String defaultValue)
Returns the configuration value of the specified entry ornull
if it is not set.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfDate
public Date getParamConfDate(ActivityConstants.AccessType accessType, String parameterName, String entryName, Date defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as DATE. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfDate
public Date getParamConfDate(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, Date defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as DATE. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfURI
public URI getParamConfURI(ActivityConstants.AccessType accessType, String parameterName, String entryName, URI defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as URI. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfURI
public URI getParamConfURI(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, URI defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as URI. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfUDT
public byte[] getParamConfUDT(ActivityConstants.AccessType accessType, String parameterName, String entryName, byte[] defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as USERDEFINED. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
getParamConfUDT
public byte[] getParamConfUDT(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, byte[] defaultValue)
Returns the configuration value of the specified entry or the given default value if it is not set or could not be parsed as USERDEFINED. In the latter case a warning is logged.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entrydefaultValue
- the default value that will be returned if the configuration value is missing; may benull
- Returns:
- the configuration value or the given default value
-
requireParamConfBoolean
public boolean requireParamConfBoolean(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entry- Returns:
- the configuration value
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as BOOLEAN
-
requireParamConfBoolean
public boolean requireParamConfBoolean(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entry- Returns:
- the configuration value
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as BOOLEAN
-
requireParamConfInteger
public long requireParamConfInteger(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entry- Returns:
- the configuration value
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as INTEGER
-
requireParamConfInteger
public long requireParamConfInteger(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entry- Returns:
- the configuration value
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as INTEGER
-
requireParamConfFloat
public double requireParamConfFloat(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entry- Returns:
- the configuration value
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as FLOAT
-
requireParamConfFloat
public double requireParamConfFloat(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entry- Returns:
- the configuration value
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as FLOAT
-
requireParamConfString
public String requireParamConfString(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing
-
requireParamConfString
public String requireParamConfString(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing
-
requireParamConfDate
public Date requireParamConfDate(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as DATE
-
requireParamConfDate
public Date requireParamConfDate(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as DATE
-
requireParamConfURI
public URI requireParamConfURI(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as URI
-
requireParamConfURI
public URI requireParamConfURI(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as URI
-
requireParamConfUDT
public byte[] requireParamConfUDT(ActivityConstants.AccessType accessType, String parameterName, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameterName
- the name of the parameterentryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as USERDEFINED
-
requireParamConfUDT
public byte[] requireParamConfUDT(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)
Returns the configuration value of the specified entry or throws an exception if it is not available.- Parameters:
accessType
- the access type of the parameterparameter
- The parameter.entryName
- name of the configuration entry- Returns:
- the configuration value; never
null
- Throws:
ApplicationEnvironmentException
- if the value is missing or cannot be parsed as USERDEFINED
-
getActInstConfValue
protected Object getActInstConfValue(String entryName, ProcessConstants.AdeptDataType expDt, boolean required, Object defValue)
Gets the designated activity instance configuration value and logs messages or throws exceptions if it is not present.- Parameters:
entryName
- the name of the configuration entry for which to retrieve the value.expDt
- The expected data type of the configuration value.required
- Whether the configuration value is required and anApplicationEnvironmentException
is to be thrown in case it is not present.defValue
- The default value to be used in case the configuration value is optional and not set.- Returns:
- The corresponding configuration value.
-
getParamConfValue
protected Object getParamConfValue(ActivityConstants.AccessType accessType, String parameterName, String entryName, ProcessConstants.AdeptDataType expDt, boolean required, Object defValue)
Gets the designated parameter configuration value and logs messages or throws exceptions if it is not present.- Parameters:
accessType
- The access type of the parameter.parameterName
- The name of the parameter.entryName
- the name of the configuration entry for which to retrieve the value.expDt
- The expected data type of the configuration value.required
- Whether the configuration value is required and anApplicationEnvironmentException
is to be thrown in case it is not present.defValue
- The default value to be used in case the configuration value is optional and not set.- Returns:
- The corresponding configuration value.
-
getParamConfValue
protected Object getParamConfValue(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, ProcessConstants.AdeptDataType expDt, boolean required, Object defValue)
Gets the designated parameter configuration value and logs messages or throws exceptions if it is not present.- Parameters:
accessType
- The access type of the parameter.parameter
- The parameter of which to get the configuration value.entryName
- the name of the configuration entry for which to retrieve the value.expDt
- The expected data type of the configuration value.required
- Whether the configuration value is required and anApplicationEnvironmentException
is to be thrown in case it is not present.defValue
- The default value to be used in case the configuration value is optional and not set.- Returns:
- The corresponding configuration value.
-
getConfValue
protected Object getConfValue(Configuration conf, String entryName, ProcessConstants.AdeptDataType expDt, boolean required, Object defValue, String paramText)
Gets the designated configuration value and logs messages or throws exceptions if it is not present.- Parameters:
conf
- The configuration to retrieve the value from.entryName
- the name of the configuration entry for which to retrieve the value.expDt
- The expected data type of the configuration value.required
- Whether the configuration value is required and anApplicationEnvironmentException
is to be thrown in case it is not present.defValue
- The default value to be used in case the configuration value is optional and not set.paramText
- The additional text used for logging or the exceptions in case of a parameter configuration. This provides the name and the direction of the parameter. In case of the configuration of the activity instance this should be the empty string.- Returns:
- The corresponding configuration value.
-
closeIfCreated
protected void closeIfCreated(Object obj)
Closes the designated object viaIoTools.closeLogged(Logger, AutoCloseable...)
if the object should be close by thisActivityData
, that is, it is incloseables
.- Parameters:
obj
- The object which is closed in case it should been closed by thisActivityData
.
-
closeElemsIfCreated
protected void closeElemsIfCreated(Collection<?> coll, Object... survivors)
Closes the elements of the designated collection viaIoTools.closeLogged(Logger, AutoCloseable...)
if the element should be close by thisActivityData
, that is, it is incloseables
.- Parameters:
coll
- A collection of objects to close when created by thisActivityData
.survivors
- Objects that will not be closed when found in the list. Object identity is used for comparison, notObject.equals(Object)
!
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getParametersSortedByPosition
public static Deque<ProcessModelParameter> getParametersSortedByPosition(Collection<? extends ProcessModelParameter> params)
Gets the designated parameters sorted by the configured position. Parameters without a position will be ignored.- Parameters:
params
- The parameters which to sort by their configured position.- Returns:
- The designated parameters having a configuration for a position sorted by this position.
-
-