Class ActivityData
- java.lang.Object
-
- de.aristaflow.adept2.model.runtimeenvironment.ActivityData
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ActivityData extends Object implements Closeable
ActivityDataprovides 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 appropriateApplicationEnvironmentExceptionwill 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 ornullin 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.nullwill 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 ActivityInstanceactivityInstanceThe activity (instance) which is encapsulated by the execution environment.protected Cleanup<RuntimeException>cleanupThe clean-up for closing theCloseables.protected Collection<AutoCloseable>closeablesTheAutoCloseablevalues that are created internally, for instance via conversion which are not controlled by thedataContext.protected DataContextdataContextThe data context for the execution environment.protected LoggerloggerThe 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 ofActivityDatawith this one.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectbooleanToNativeTypedValue(Boolean value, ProcessModelParameter parameter, boolean output)Converts an instance ofBooleanto an instance of the corresponding native type.voidclose()protected voidcloseElemsIfCreated(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 voidcloseIfCreated(Object obj)Closes the designated object viaIoTools.closeLogged(Logger, AutoCloseable...)if the object should be close by thisActivityData, that is, it is incloseables.voidcloseUnknown(Object... prospCloseables)Closes all of the designated instances which areAutoCloseableand which are not known by thisActivtiyData(have not been created by it and thus are not withincloseables).ObjectdateToNativeTypedValue(Date value, ProcessModelParameter parameter, boolean output)Converts an instance ofDateto an instance of the corresponding native type.ObjectfloatToNativeTypedValue(Double value, ProcessModelParameter parameter, boolean output)Converts an instance ofDoubleto an instance of the corresponding native type.protected ObjectgetActInstConfValue(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.BooleangetConfBoolean(String entryName)Returns the configuration value of the specified entry ornullif it is not set.BooleangetConfBoolean(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.DategetConfDate(String entryName)Returns the configuration value of the specified entry ornullif it is not set.DategetConfDate(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.DoublegetConfFloat(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.DoublegetConfFloat(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.LonggetConfInteger(String entryName)Returns the configuration value of the specified entry ornullif it is not set.LonggetConfInteger(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.StringgetConfString(String entryName)Returns the configuration value of the specified entry ornullif it is not set.StringgetConfString(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.URIgetConfURI(String entryName)Returns the configuration value of the specified entry ornullif it is not set.URIgetConfURI(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 ObjectgetConfValue(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> TgetDualInputValue(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.ProcessModelParametergetInputParam(String parameterName)Returns the input parameter with the given name ornullif 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.ObjectgetInputValue(ProcessModelParameter parameter)Retrieves the value of the designated input parameter as an object of the closest related java type.ObjectgetInputValue(ProcessModelParameter parameter, boolean required)Retrieves the value of the designated input parameter as an object of the closest related java type.ObjectgetInputValue(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.ObjectgetInputValue(String parameterName)Retrieves the value of the specified input parameter as an object of the closest related java type.ObjectgetInputValue(String parameterName, boolean required)Retrieves the value of the specified input parameter as an object of the closest related java type.protected ObjectgetInputValue(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.ProcessModelParametergetOutputParam(String parameterName)Returns the output parameter with the given name ornullif no such parameter exists.Collection<ProcessModelParameter>getOutputParams()Returns all output parameters in a list.BooleangetParamConfBoolean(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.BooleangetParamConfBoolean(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.DategetParamConfDate(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.DategetParamConfDate(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.DoublegetParamConfFloat(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.DoublegetParamConfFloat(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.LonggetParamConfInteger(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.LonggetParamConfInteger(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.StringgetParamConfString(ActivityConstants.AccessType accessType, Parameter parameter, String entryName, String defaultValue)Returns the configuration value of the specified entry ornullif it is not set.StringgetParamConfString(ActivityConstants.AccessType accessType, String parameterName, String entryName, String defaultValue)Returns the configuration value of the specified entry ornullif 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.URIgetParamConfURI(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.URIgetParamConfURI(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 ObjectgetParamConfValue(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 ObjectgetParamConfValue(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.ObjectgetStoredValue(ProcessModelParameter parameter)Retrieves the stored value of the specified output parameter as an object of the closest related java type.ObjectgetStoredValue(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.ObjectgetStoredValue(String parameterName)Retrieves the stored value of the specified output parameter as an object of the closest related java type.protected ObjectgetStoredValue(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.booleanhasConf(String entryName)Returns whether the specified configuration entry is set.booleanhasInputListParam(String parameterName, ProcessConstants.AdeptDataType elementDataType)Returns whether the input parameter with the specified name exists and is a list with the specified element type.booleanhasInputParam(String parameterName)Returns whether the input parameter with the specified name exists.booleanhasInputValue(String paramName)Checks whether the value of the specified input parameter is set, i.e.booleanhasOutputParam(String parameterName)Returns whether the output parameter with the specified name exists.booleanhasParam(String parameterName, ActivityConstants.AccessType accessType)Returns whether the parameter with the specified name and access type exists.booleanhasParamConf(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)Returns whether the specified configuration entry is set.booleanhasParamConf(ActivityConstants.AccessType accessType, String parameterName, String entryName)Returns whether the specified configuration entry is set.booleanhasStoredValue(String paramName)Checks whether the value of the specified output parameter has been written, i. e.ObjectintegerToNativeTypedValue(Long value, ProcessModelParameter parameter, boolean output)Converts an instance ofLongto an instance of the corresponding native type.BooleanobjectToBoolean(Object value, ProcessModelParameter parameter, boolean output)Converts an object (of native type) to an instance ofBoolean.DateobjectToDate(Object value, ProcessModelParameter parameter, boolean output)Converts an object (of native type) to an instance ofDate.DoubleobjectToFloat(Object value, ProcessModelParameter parameter, boolean output)Converts an object (of native type) to an instance ofDouble.LongobjectToInteger(Object value, ProcessModelParameter parameter, boolean output)Converts an object (of native type) to an instance ofLong.StringobjectToString(Object value, ProcessModelParameter parameter, boolean output)Converts an object (of native type) to an instance ofString.URIobjectToUri(Object value, ProcessModelParameter parameter, boolean output)Converts an object (of native type) to an instance ofURI.UDTValueobjectToUserdefined(Object value, ProcessModelParameter parameter, boolean output)Converts an object to an instance ofUDTValueby serialising the object and encapsulating the corresponding stream in the returned instance of UDTValue.BooleanreadInputBoolean(ProcessModelParameter parameter)Returns the value of the specified BOOLEAN input parameter ornullif no value is set or the parameter does not exist.BooleanreadInputBoolean(String parameterName)Returns the value of the specified BOOLEAN input parameter ornullif no value is set or the parameter does not exist.DatereadInputDate(ProcessModelParameter parameter)Returns the value of the specified DATE input parameter ornullif no value is set or the parameter does not exist.DatereadInputDate(String parameterName)Returns the value of the specified DATE input parameter ornullif no value is set or the parameter does not exist.DoublereadInputFloat(ProcessModelParameter parameter)Returns the value of the specified FLOAT input parameter ornullif no value is set or the parameter does not exist.DoublereadInputFloat(String parameterName)Returns the value of the specified FLOAT input parameter ornullif no value is set or the parameter does not exist.LongreadInputInteger(ProcessModelParameter parameter)Returns the value of the specified INTEGER input parameter ornullif no value is set or the parameter does not exist.LongreadInputInteger(String parameterName)Returns the value of the specified INTEGER input parameter ornullif 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 ornullif no value is set.<T extends Serializable>
List<T>readInputList(String parameterName)Returns the list of the specified USERDEFINED input parameter ornullif no value is set.protected <T extends Serializable>
List<T>readInputList(String pName, UDTValue value, String udtName)Gets the list of the designatedProcessConstants.AdeptDataType.USERDEFINEDinput parameter ornullif the designated value isnull.StringreadInputString(ProcessModelParameter parameter)Returns the value of the specified STRING input parameter ornullif no value is set or the parameter does not exist.StringreadInputString(String parameterName)Returns the value of the specified STRING input parameter ornullif no value is set or the parameter does not exist.UDTValuereadInputUDT(ProcessModelParameter parameter)Returns the value of the specified USERDEFINED input parameter ornullif no value is set or the parameter does not exist.UDTValuereadInputUDT(String parameterName)Returns the value of the specified USERDEFINED input parameter ornullif no value is set or the parameter does not exist.URIreadInputURI(ProcessModelParameter parameter)Returns the value of the specified URI input parameter ornullif no value is set or the parameter does not exist.URIreadInputURI(String parameterName)Returns the value of the specified URI input parameter ornullif no value is set or the parameter does not exist.BooleanreadOutputBoolean(ProcessModelParameter parameter)Returns the value stored for the specified BOOLEAN output parameter ornullif no value is set or the parameter does not exist.BooleanreadOutputBoolean(String parameterName)Returns the value stored for the specified BOOLEAN output parameter ornullif no value is set or the parameter does not exist.DatereadOutputDate(ProcessModelParameter parameter)Returns the value stored for the specified DATE output parameter ornullif no value is set or the parameter does not exist.DatereadOutputDate(String parameterName)Returns the value stored for the specified DATE output parameter ornullif no value is set or the parameter does not exist.DoublereadOutputFloat(ProcessModelParameter parameter)Returns the value stored for the specified FLOAT output parameter ornullif no value is set or the parameter does not exist.DoublereadOutputFloat(String parameterName)Returns the value stored for the specified FLOAT output parameter ornullif no value is set or the parameter does not exist.LongreadOutputInteger(ProcessModelParameter parameter)Returns the value stored for the specified INTEGER output parameter ornullif no value is set or the parameter does not exist.LongreadOutputInteger(String parameterName)Returns the value stored for the specified INTEGER output parameter ornullif no value is set or the parameter does not exist.StringreadOutputString(ProcessModelParameter parameter)Returns the value stored for the specified STRING output parameter ornullif no value is set or the parameter does not exist.StringreadOutputString(String parameterName)Returns the value stored for the specified STRING output parameter ornullif no value is set or the parameter does not exist.UDTValuereadOutputUDT(ProcessModelParameter parameter)Returns the value stored for the specified USERDEFINED output parameter ornullif no value is set or the parameter does not exist.UDTValuereadOutputUDT(String parameterName)Returns the value stored for the specified USERDEFINED output parameter ornullif no value is set or the parameter does not exist.URIreadOutputURI(ProcessModelParameter parameter)Returns the value stored for the specified URI output parameter ornullif no value is set or the parameter does not exist.URIreadOutputURI(String parameterName)Returns the value stored for the specified URI output parameter ornullif no value is set or the parameter does not exist.booleanrequireConfBoolean(String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.DaterequireConfDate(String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.doublerequireConfFloat(String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.longrequireConfInteger(String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.StringrequireConfString(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.URIrequireConfURI(String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.booleanrequireInputBoolean(String parameterName)Returns the value of the specified BOOLEAN input parameter or throws an exception if the value is not available.DaterequireInputDate(String parameterName)Returns the value of the specified DATE input parameter or throws an exception if the value is not available.doublerequireInputFloat(String parameterName)Returns the value of the specified FLOAT input parameter or throws an exception if the value is not available.longrequireInputInteger(String parameterName)Returns the value of the specified INTEGER input parameter or throws an exception if the value is not available.ProcessModelParameterrequireInputParam(String parameterName)Returns the input parameter with the given name, or throws an exception if the parameter does not exist.StringrequireInputString(String parameterName)Returns the value of the specified STRING input parameter or throws an exception if the value is not available.UDTValuerequireInputUDT(String parameterName)Returns the value of the specified USERDEFINED input parameter or throws an exception if the value is not available.URIrequireInputURI(String parameterName)Returns the value of the specified URI input parameter or throws an exception if the value is not available.ProcessModelParameterrequireOutputParam(String parameterName)Returns the output parameter with the given name, or throws an exception if the parameter does not exist.booleanrequireParamConfBoolean(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.booleanrequireParamConfBoolean(ActivityConstants.AccessType accessType, String parameterName, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.DaterequireParamConfDate(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.DaterequireParamConfDate(ActivityConstants.AccessType accessType, String parameterName, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.doublerequireParamConfFloat(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.doublerequireParamConfFloat(ActivityConstants.AccessType accessType, String parameterName, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.longrequireParamConfInteger(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.longrequireParamConfInteger(ActivityConstants.AccessType accessType, String parameterName, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.StringrequireParamConfString(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.StringrequireParamConfString(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.URIrequireParamConfURI(ActivityConstants.AccessType accessType, Parameter parameter, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.URIrequireParamConfURI(ActivityConstants.AccessType accessType, String parameterName, String entryName)Returns the configuration value of the specified entry or throws an exception if it is not available.ObjectstringToNativeTypedValue(String value, ProcessModelParameter parameter, boolean output)Converts an instance ofStringto an instance of the corresponding native type.ObjecttoNativeNull(ProcessModelParameter parameter, boolean output)Gets an instance fornull.voidunwriteOutputValue(ProcessModelParameter parameter)Removes any previously written value for the specified output parameter.voidunwriteOutputValue(String parameterName)Removes any previously written value for the specified output parameter.ObjecturiToNativeTypedValue(URI value, ProcessModelParameter parameter, boolean output)Converts an instance ofURIto an instance of the corresponding native type.ObjectuserdefinedToNativeTypedValue(UDTValue value, ProcessModelParameter parameter, boolean output)Converts an instance ofUDTValueto an instance of the corresponding native type.voidwriteOutputBoolean(ProcessModelParameter parameter, boolean value)Stores the value for the specified BOOLEAN output parameter.voidwriteOutputBoolean(String parameterName, boolean value)Stores the value for the specified BOOLEAN output parameter.voidwriteOutputDate(ProcessModelParameter parameter, Date value)Stores the value for the specified DATE output parameter.voidwriteOutputDate(String parameterName, Date value)Stores the value for the specified DATE output parameter.voidwriteOutputFloat(ProcessModelParameter parameter, double value)Stores the value for the specified FLOAT output parameter.voidwriteOutputFloat(String parameterName, double value)Stores the value for the specified FLOAT output parameter.voidwriteOutputInteger(ProcessModelParameter parameter, long value)Stores the value for the specified INTEGER output parameter.voidwriteOutputInteger(String parameterName, long value)Stores the value for the specified INTEGER output parameter.voidwriteOutputList(ProcessModelParameter parameter, ListUdt value)Stores the list value for the specified USERDEFINED output parameter.voidwriteOutputList(ProcessModelParameter parameter, List<?> value)Stores the list value for the specified USERDEFINED output parameter.voidwriteOutputList(String parameterName, ListUdt value)Stores the list value for the specified USERDEFINED output parameter.voidwriteOutputList(String parameterName, List<?> value)Stores the list value for the specified USERDEFINED output parameter.voidwriteOutputObject(ProcessModelParameter parameter, Serializable value)Stores the designated serialisable object for the specified USERDEFINED output parameter.voidwriteOutputObject(String parameterName, Serializable value)Stores the designated serialisable object for the specified USERDEFINED output parameter.voidwriteOutputString(ProcessModelParameter parameter, String value)Stores the value for the specified STRING output parameter.voidwriteOutputString(String parameterName, String value)Stores the value for the specified STRING output parameter.voidwriteOutputUDT(ProcessModelParameter parameter, byte[] value)Stores the value for the specified USERDEFINED output parameter.voidwriteOutputUDT(ProcessModelParameter parameter, UDTValue value)Stores the value for the specified USERDEFINED output parameter.voidwriteOutputUDT(String parameterName, byte[] value)Stores the value for the specified USERDEFINED output parameter.voidwriteOutputUDT(String parameterName, UDTValue value)Stores the value for the specified USERDEFINED output parameter.voidwriteOutputURI(ProcessModelParameter parameter, URI value)Stores the value for the specified URI output parameter.voidwriteOutputURI(String parameterName, URI value)Stores the value for the specified URI output parameter.protected voidwriteOutputValue(ProcessModelParameter param, boolean convert, Object value)Stores the value for the specified output parameter.voidwriteOutputValue(ProcessModelParameter parameter, Object value)Stores the value for the specified output parameter.protected voidwriteOutputValue(String parameterName, ProcessConstants.AdeptDataType expDt, boolean convert, Object value)Stores the value for the specified output parameter.voidwriteOutputValue(String parameterName, Object value)Stores the value for the specified output parameter.voidwriteOutputValues(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
TheAutoCloseablevalues 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 theCloseables.
-
-
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 ofActivityDatawith this one.- Parameters:
actData- The instance ofActivityDatawhich 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,ObjectorURI).- 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 ornullif 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,
falseif 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
nullif the parameter is not set. AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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
nullif the parameter is not set. AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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 anApplicationEnvironmentExceptionis to be thrown in case it is null.- Returns:
- The parameter value, or
nullif the parameter is not set. AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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 anApplicationEnvironmentExceptionis to be thrown in case it is null.- Returns:
- The parameter value, or
nullif the parameter is not set. AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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, anApplicationEnvironmentExceptionwill 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 anApplicationEnvironmentExceptionis to be thrown in case it is null.- Returns:
- The parameter value, or
nullif the parameter is not set. AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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 anApplicationEnvironmentExceptionis to be thrown in case it is null.- Returns:
- The parameter value, or
nullif the parameter is not set. AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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 toApplicationEnvironmentExceptions.- 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.
AutoCloseablevalues 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 anApplicationEnvironmentExceptionwill 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.DATEandProcessConstants.AdeptDataType.USERDEFINEDthe 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. AnAutoCloseablevalue 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set or the parameter does not exist. Use this method foroptionalinput 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 ornullif no value is set. Use this method foroptionalinput parameters.- Type Parameters:
T- the element type of the list- Parameters:
parameterName- name of the input parameter- Returns:
- The retrieved list; may be
null.AutoCloseablelist 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 ornullif no value is set. Use this method foroptionalinput parameters.- Type Parameters:
T- the element type of the list- Parameters:
parameter- the input parameter- Returns:
- The retrieved list; may be
null.AutoCloseablelist 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.USERDEFINEDinput parameter ornullif 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, anApplicationEnvironmentExceptionwill 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
nullif the designated value isnull.
AutoCloseablelist 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 formandatoryinput 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 formandatoryinput 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 formandatoryinput 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 formandatoryinput 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 formandatoryinput 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 formandatoryinput 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 formandatoryinput 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
AutoCloseableitself or an object havingAutoCloseableelements 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
nullvalue.
AnAutoCloseablevalue 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 ofBooleanto 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
AutoCloseableitself or an object havingAutoCloseableelements have to add them tocloseables.- Parameters:
value- An instance ofBooleanto 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.
AnAutoCloseablevalue 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 ofLongto 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
AutoCloseableitself or an object havingAutoCloseableelements have to add them tocloseables.- Parameters:
value- An instance ofLongto 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.
AnAutoCloseablevalue 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 ofDoubleto 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
AutoCloseableitself or an object havingAutoCloseableelements have to add them tocloseables.- Parameters:
value- An instance ofDoubleto 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.
AnAutoCloseablevalue 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 ofStringto 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
AutoCloseableitself or an object havingAutoCloseableelements have to add them tocloseables.- Parameters:
value- An instance ofStringto 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.
AnAutoCloseablevalue 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 ofDateto 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
AutoCloseableitself or an object havingAutoCloseableelements have to add them tocloseables.- Parameters:
value- An instance ofDateto 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.
AnAutoCloseablevalue 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 ofUDTValueto an instance of the corresponding native type. This method should be overridden to return a correctly typed value.
This implementation creates an instance ofObjectby interpreting the UDT as an object stream and de-serialising the appropriate object. In case of aListUdtit 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
AutoCloseableitself or an object havingAutoCloseableelements 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
Objectread from the designated UDTValue ornullin case the object can not be read.
AnAutoCloseablevalue 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 ofURIto 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
AutoCloseableitself or an object havingAutoCloseableelements have to add them tocloseables.- Parameters:
value- An instance ofURIto 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.
AnAutoCloseablevalue 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,
falseif 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
nullif the parameter has not been written yet.
AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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
nullif the parameter has not been written yet.
AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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, anApplicationEnvironmentExceptionwill 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
nullif the parameter is not set.
AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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
nullif the parameter is not set.
AnAutoCloseablevalue 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 anApplicationEnvironmentExceptionwill 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.
AutoCloseablevalues 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 anApplicationEnvironmentExceptionwill be thrown.- See Also:
getStoredValue(String)
-
readOutputBoolean
public Boolean readOutputBoolean(String parameterName)
Returns the value stored for the specified BOOLEAN output parameter ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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
setOutputmethods. If the value is aListit 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
setOutputmethods. If the value is aListit 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, anApplicationEnvironmentExceptionwill 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
setOutputmethods. If the value is aListit 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 areAutoCloseableand which are not known by thisActivtiyData(have not been created by it and thus are not withincloseables). This ensures closing ofAutoCloseablescreated by the user (usually execution environments). Often these environments cannot distinguish betweenAutoCloseables provided byActivityDatafor which they are not responsible and the ones they have created and are responsible for.- Parameters:
prospCloseables- Arbitrary objects of which allAutoCloseableinstances which have not been created by thisActivtityDatawill 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 benullornative 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 benullornative 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 benullornative 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 benullornative 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 benullornative 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 benullornative 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 ofUDTValueby 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, anApplicationFailedExceptionwill be thrown.Overriding implementations creating a new
UDTValueitself have to add it tocloseables.- Parameters:
value- The object to store in an instance ofUDTValue. This must not benullnornative null.
The caller is responsible for closing if appropriate.parameter- The output parameter that needs a conversion fromObjecttoUDTValue.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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 ornullif 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 anApplicationEnvironmentExceptionis 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 anApplicationEnvironmentExceptionis 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 anApplicationEnvironmentExceptionis 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 anApplicationEnvironmentExceptionis 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:
closein interfaceAutoCloseable- Specified by:
closein 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.
-
-