Package org.bonitasoft.engine.parameter
Class ParameterServiceImpl
java.lang.Object
org.bonitasoft.engine.parameter.ParameterServiceImpl
- All Implemented Interfaces:
ParameterService
- Author:
- Baptiste Mesta
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParameterServiceImpl(Recorder recorder, ReadPersistenceService persistenceService) -
Method Summary
Modifier and TypeMethodDescriptionvoidStore all parameters provided to the specific process in file systembooleancontainsNullValues(long processDefinitionId) Check if the specific process contains null-valued parameter or not.voiddeleteAll(long processDefinitionId) Delete all parameters for a specific processDefinitionGet parameters in a specific interval for specific process, this is used for paginationGet parameter by name in specific processgetAll(long processDefinitionId) return all parameters in a mapgetNullValues(long processDefinitionId, int fromIndex, int numberOfResult, OrderBy order) Get a list of parameters will null values in order in specific processprotected StringHandle null values.voidMerge given parameters with existing ones.voidUpdate specific parameter value in a process
-
Field Details
-
PAGE_SIZE
public static final int PAGE_SIZE- See Also:
-
PARAMETER
- See Also:
-
-
Constructor Details
-
ParameterServiceImpl
-
-
Method Details
-
update
public void update(long processDefinitionId, String parameterName, String parameterValue) throws SParameterNameNotFoundException, SBonitaReadException, SObjectModificationException Description copied from interface:ParameterServiceUpdate specific parameter value in a process- Specified by:
updatein interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionparameterName- name of the parameter will be updatedparameterValue- new value of the parameter- Throws:
SParameterNameNotFoundException- error thrown if no parameter found for the specific parameterNameSBonitaReadExceptionSObjectModificationException
-
merge
public void merge(long processDefinitionId, Map<String, String> parameters) throws SBonitaReadException, SObjectModificationExceptionDescription copied from interface:ParameterServiceMerge given parameters with existing ones. Unknown parameters are ignored.- Specified by:
mergein interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionparameters- parameters to merge- Throws:
SBonitaReadException- error thrown if an error occurred while retrieving the process definitionSObjectModificationException- error thrown if an error occurred while updating the parameter value
-
interpretParameterValue
Handle null values. If input isParameterContribution.NULL, convert it tonull -
addAll
public void addAll(long processDefinitionId, Map<String, String> parameters) throws SObjectCreationException, SBonitaReadException, SObjectModificationExceptionDescription copied from interface:ParameterServiceStore all parameters provided to the specific process in file system- Specified by:
addAllin interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionparameters- parameters will be stored in file system- Throws:
SObjectCreationExceptionSBonitaReadExceptionSObjectModificationException
-
getAll
public Map<String,String> getAll(long processDefinitionId) throws SParameterProcessNotFoundException, SBonitaReadException Description copied from interface:ParameterServicereturn all parameters in a map- Specified by:
getAllin interfaceParameterService- Throws:
SParameterProcessNotFoundExceptionSBonitaReadException
-
deleteAll
public void deleteAll(long processDefinitionId) throws SParameterProcessNotFoundException, SBonitaReadException, SObjectModificationException Description copied from interface:ParameterServiceDelete all parameters for a specific processDefinition- Specified by:
deleteAllin interfaceParameterService- Parameters:
processDefinitionId- ID of processDefinition- Throws:
SParameterProcessNotFoundException- error thrown if no parameters configuration file found in file systemSBonitaReadExceptionSObjectModificationException
-
get
public List<SParameter> get(long processDefinitionId, int fromIndex, int numberOfResult, OrderBy order) throws SBonitaReadException Description copied from interface:ParameterServiceGet parameters in a specific interval for specific process, this is used for pagination- Specified by:
getin interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionfromIndex- index of the record to be retrieved from. First record has index 0numberOfResult- number of result we want to get. Maximum number of result returned.order- OrderBy object, contains information to do order- Returns:
- a list of SParameter objects
- Throws:
SBonitaReadException
-
get
Description copied from interface:ParameterServiceGet parameter by name in specific process- Specified by:
getin interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionparameterName- name of parameter- Returns:
- the parameter or null if it does not exists
- Throws:
SBonitaReadException
-
getNullValues
public List<SParameter> getNullValues(long processDefinitionId, int fromIndex, int numberOfResult, OrderBy order) throws SParameterProcessNotFoundException, SBonitaReadException Description copied from interface:ParameterServiceGet a list of parameters will null values in order in specific process- Specified by:
getNullValuesin interfaceParameterService- Parameters:
processDefinitionId- identifier of processDefinitionfromIndex- index of the record to be retrieved from. First record has index 0numberOfResult- number of result we want to get. Maximum number of result returned.order- OrderBy object, contains information to do order- Returns:
- a list of parameters
- Throws:
SParameterProcessNotFoundException- error thrown if no parameters configuration file found in file systemSBonitaReadException
-
containsNullValues
Description copied from interface:ParameterServiceCheck if the specific process contains null-valued parameter or not.- Specified by:
containsNullValuesin interfaceParameterService- Parameters:
processDefinitionId- The ID of the process definition- Returns:
- true if at least one parameter contains a null value, false otherwise.
- Throws:
SBonitaReadException
-