Class DataInstanceServiceImpl
java.lang.Object
org.bonitasoft.engine.data.instance.api.impl.DataInstanceServiceImpl
- All Implemented Interfaces:
DataInstanceService
General mechanism for lookup is to look in specific flow node to search a data instance. When referring to "local"
data instance, it means the lookup is
performed only on the specific element, and not on inherited data for parent containers.
- Author:
- Zhao Na, Elias Ricken de Medeiros, Feng Hui, Hongwen Zang, Matthieu Chaffotte, Baptiste Mesta: include data instance data source directly here
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ArchiveServiceprotected final ReadPersistenceServiceprotected final Recorder -
Constructor Summary
ConstructorsConstructorDescriptionDataInstanceServiceImpl(Recorder recorder, ReadPersistenceService persistenceService, ArchiveService archiveService) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateDataInstance(SDataInstance dataInstance) Create dataInstance in DB for given dataInstancevoiddeleteDataInstance(SDataInstance dataInstance) Delete the specific dataInstancevoiddeleteLocalArchivedDataInstances(long containerId, String containerType) Delete all local archived data instances for a specified containervoiddeleteLocalArchivedDataInstances(List<Long> containerIds, String containerType) Delete all local archived data instances for multiple containers having the same typevoiddeleteLocalDataInstances(long containerId, String dataInstanceContainerType, boolean dataPresent) Delete all local active data instances for a specified containergetDataInstance(long dataInstanceId) Get dataInstance by its idgetDataInstance(String dataName, long containerId, String containerType, ParentContainerResolver parentContainerResolver) Get dataInstance visible in the specific containergetDataInstances(long containerId, String containerType, ParentContainerResolver parentContainerResolver, int fromIndex, int numberOfResults) Get all dataInstances visible in the specific containergetDataInstances(List<String> dataNames, long containerId, String containerType, ParentContainerResolver parentContainerResolver) Get dataInstances visible in the specific container for given namesgetLastLocalSADataInstances(long containerId, String containerType, int startIndex, int maxResults) Gets the last archived SADataInstance objects of the container.getLastSADataInstance(String dataName, long containerId, String containerType, ParentContainerResolver parentContainerResolver) Gets the last archived SADataInstance object for the named data in the container.getLocalDataInstance(String dataName, long containerId, String containerType) Get the local dataInstance by name in a certain container, the dataInstance is existed in this containergetLocalDataInstances(long containerId, String containerType, int fromIndex, int numberOfResults) Get a list of local dataInstances for the specific container, those dataInstances must belong to the specified container.getLocalSADataInstances(long containerId, String containerType, int fromIndex, int numberOfResults) Get the local SADataInstances for this elementlonggetNumberOfDataInstances(long containerId, String containerType, ParentContainerResolver parentContainerResolver) Get number of dataInstance for specified containergetSADataInstance(long sourceObjectId, long time) Get SADataInstance object for specific dataInstance at the specific timegetSADataInstance(long containerId, String containerType, ParentContainerResolver parentContainerResolver, String dataName, long time) Get SADataInstance object archived in the specific time for name specified dataInstance in a containergetSADataInstances(long containerId, String containerType, ParentContainerResolver parentContainerResolver, List<String> dataNames, long time) Get all SADataInstance objects archived after specific time for specific dataInstance in a containervoidupdateDataInstance(SDataInstance dataInstance, EntityUpdateDescriptor descriptor) Update the specific dataInstance according to the given descriptor
-
Field Details
-
recorder
-
persistenceService
-
archiveService
-
-
Constructor Details
-
DataInstanceServiceImpl
public DataInstanceServiceImpl(Recorder recorder, ReadPersistenceService persistenceService, ArchiveService archiveService)
-
-
Method Details
-
getDataInstance
public SDataInstance getDataInstance(String dataName, long containerId, String containerType, ParentContainerResolver parentContainerResolver) throws SDataInstanceException Description copied from interface:DataInstanceServiceGet dataInstance visible in the specific container- Specified by:
getDataInstancein interfaceDataInstanceService- Parameters:
dataName- Name of data instancecontainerId- Identifier of containercontainerType- Type of container, e.g process instance, activity instance and so on.- Returns:
- a SDataInstance object
- Throws:
SDataInstanceException
-
getDataInstances
public List<SDataInstance> getDataInstances(long containerId, String containerType, ParentContainerResolver parentContainerResolver, int fromIndex, int numberOfResults) throws SDataInstanceException Description copied from interface:DataInstanceServiceGet all dataInstances visible in the specific container- Specified by:
getDataInstancesin interfaceDataInstanceService- Parameters:
containerId- Identifier of containercontainerType- Type of container, e.g process instance, activity instance and so on.- Returns:
- Throws:
SDataInstanceException
-
getLocalDataInstance
public SDataInstance getLocalDataInstance(String dataName, long containerId, String containerType) throws SDataInstanceReadException Description copied from interface:DataInstanceServiceGet the local dataInstance by name in a certain container, the dataInstance is existed in this container- Specified by:
getLocalDataInstancein interfaceDataInstanceService- Parameters:
dataName- Name of dataInstancecontainerId- Identifier of containercontainerType- Type of container, e.g process instance, activity instance and so on.- Returns:
- an SDataInstance object
- Throws:
SDataInstanceReadException
-
getLocalDataInstances
public List<SDataInstance> getLocalDataInstances(long containerId, String containerType, int fromIndex, int numberOfResults) throws SDataInstanceReadException Description copied from interface:DataInstanceServiceGet a list of local dataInstances for the specific container, those dataInstances must belong to the specified container. This method is paginated.- Specified by:
getLocalDataInstancesin interfaceDataInstanceService- Parameters:
containerId- Identifier of containercontainerType- Type of container, e.g process instance, activity instance and so on.- Returns:
- a list of SDataInstance objects
- Throws:
SDataInstanceReadException
-
getSADataInstance
public SADataInstance getSADataInstance(long containerId, String containerType, ParentContainerResolver parentContainerResolver, String dataName, long time) throws SDataInstanceReadException Description copied from interface:DataInstanceServiceGet SADataInstance object archived in the specific time for name specified dataInstance in a container- Specified by:
getSADataInstancein interfaceDataInstanceService- Parameters:
containerId- Identifier of containercontainerType- Type of container, e.g process instance, activity instance and so on.dataName- Name of data instancetime- The archive time- Returns:
- an SADataInstance object
- Throws:
SDataInstanceReadException
-
getSADataInstance
public SADataInstance getSADataInstance(long sourceObjectId, long time) throws SDataInstanceReadException Description copied from interface:DataInstanceServiceGet SADataInstance object for specific dataInstance at the specific time- Specified by:
getSADataInstancein interfaceDataInstanceService- Parameters:
sourceObjectId- Identifier of data instance which has been archivedtime- The archive time- Returns:
- an SADataInstance object
- Throws:
SDataInstanceReadException
-
getLastSADataInstance
public SADataInstance getLastSADataInstance(String dataName, long containerId, String containerType, ParentContainerResolver parentContainerResolver) throws SDataInstanceException Description copied from interface:DataInstanceServiceGets the last archived SADataInstance object for the named data in the container.- Specified by:
getLastSADataInstancein interfaceDataInstanceService- Parameters:
dataName- the name of the datacontainerId- the identifier of the containercontainerType- the type of the container- Returns:
- the last archived SADataInstance
- Throws:
SDataInstanceException
-
getSADataInstances
public List<SADataInstance> getSADataInstances(long containerId, String containerType, ParentContainerResolver parentContainerResolver, List<String> dataNames, long time) throws SDataInstanceReadException Description copied from interface:DataInstanceServiceGet all SADataInstance objects archived after specific time for specific dataInstance in a container- Specified by:
getSADataInstancesin interfaceDataInstanceService- Parameters:
containerId- Identifier of containercontainerType- Type of container, e.g process instance, activity instance and so on.dataNames- Name of datatime- The archive time- Returns:
- a list of SADataInstance objects
- Throws:
SDataInstanceReadException
-
getLastLocalSADataInstances
public List<SADataInstance> getLastLocalSADataInstances(long containerId, String containerType, int startIndex, int maxResults) throws SDataInstanceReadException Description copied from interface:DataInstanceServiceGets the last archived SADataInstance objects of the container.- Specified by:
getLastLocalSADataInstancesin interfaceDataInstanceService- Parameters:
containerId- the identifier of the containercontainerType- the type of the container- Returns:
- the last archived SADataInstance
- Throws:
SDataInstanceReadException
-
getNumberOfDataInstances
public long getNumberOfDataInstances(long containerId, String containerType, ParentContainerResolver parentContainerResolver) throws SDataInstanceReadException Description copied from interface:DataInstanceServiceGet number of dataInstance for specified container- Specified by:
getNumberOfDataInstancesin interfaceDataInstanceService- Parameters:
containerId- Identifier of containercontainerType- Type of container, e.g process instance, activity instance and so on.- Returns:
- the number of dataInstances
- Throws:
SDataInstanceReadException
-
getDataInstances
public List<SDataInstance> getDataInstances(List<String> dataNames, long containerId, String containerType, ParentContainerResolver parentContainerResolver) throws SDataInstanceException Description copied from interface:DataInstanceServiceGet dataInstances visible in the specific container for given names- Specified by:
getDataInstancesin interfaceDataInstanceService- Parameters:
dataNames- A list of names of data instancescontainerId- Identifier of containercontainerType- Type of container, e.g process instance, activity instance and so on.- Returns:
- a list of SDataInstance objects
- Throws:
SDataInstanceException
-
getLocalSADataInstances
public List<SADataInstance> getLocalSADataInstances(long containerId, String containerType, int fromIndex, int numberOfResults) throws SDataInstanceReadException Description copied from interface:DataInstanceServiceGet the local SADataInstances for this element- Specified by:
getLocalSADataInstancesin interfaceDataInstanceService- Returns:
- Throws:
SDataInstanceReadException
-
deleteLocalArchivedDataInstances
public void deleteLocalArchivedDataInstances(long containerId, String containerType) throws SDataInstanceException Description copied from interface:DataInstanceServiceDelete all local archived data instances for a specified container- Specified by:
deleteLocalArchivedDataInstancesin interfaceDataInstanceService- Throws:
SDataInstanceException
-
deleteLocalArchivedDataInstances
public void deleteLocalArchivedDataInstances(List<Long> containerIds, String containerType) throws SDataInstanceException Description copied from interface:DataInstanceServiceDelete all local archived data instances for multiple containers having the same type- Specified by:
deleteLocalArchivedDataInstancesin interfaceDataInstanceService- Parameters:
containerIds- containerscontainerType- type of the containers- Throws:
SDataInstanceException
-
deleteLocalDataInstances
public void deleteLocalDataInstances(long containerId, String dataInstanceContainerType, boolean dataPresent) throws SDataInstanceException Description copied from interface:DataInstanceServiceDelete all local active data instances for a specified container- Specified by:
deleteLocalDataInstancesin interfaceDataInstanceService- Throws:
SDataInstanceException
-
createDataInstance
Description copied from interface:DataInstanceServiceCreate dataInstance in DB for given dataInstance- Specified by:
createDataInstancein interfaceDataInstanceService- Parameters:
dataInstance- SDataInstance object- Throws:
SDataInstanceException
-
updateDataInstance
public void updateDataInstance(SDataInstance dataInstance, EntityUpdateDescriptor descriptor) throws SDataInstanceException Description copied from interface:DataInstanceServiceUpdate the specific dataInstance according to the given descriptor- Specified by:
updateDataInstancein interfaceDataInstanceService- Parameters:
dataInstance- SDataInstance object will be updateddescriptor- Update description- Throws:
SDataInstanceException
-
deleteDataInstance
Description copied from interface:DataInstanceServiceDelete the specific dataInstance- Specified by:
deleteDataInstancein interfaceDataInstanceService- Parameters:
dataInstance- SDataInstance object will be deleted- Throws:
SDataInstanceException
-
getDataInstance
Description copied from interface:DataInstanceServiceGet dataInstance by its id- Specified by:
getDataInstancein interfaceDataInstanceService- Parameters:
dataInstanceId- Identifier of dataInstance- Returns:
- a SDataInstance object
- Throws:
SDataInstanceException
-