Class IndexingServiceImpl

    • Field Detail

      • indexingEnabled

        protected boolean indexingEnabled
      • objectMapper

        protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
      • asyncHistoryExecutor

        protected org.flowable.spring.job.service.SpringAsyncHistoryExecutor asyncHistoryExecutor
    • Constructor Detail

      • IndexingServiceImpl

        public IndexingServiceImpl​(boolean indexingEnabled,
                                   ElasticsearchClient elasticsearchClient,
                                   ObjectSerializationService objectSerializationService,
                                   IndexManager indexManager,
                                   com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                   org.flowable.spring.job.service.SpringAsyncHistoryExecutor asyncHistoryExecutor,
                                   java.util.List<BulkIndexRequestInterceptor> bulkIndexRequestInterceptors)
    • Method Detail

      • transformObjectToIndexedDataObjects

        protected java.util.List<IndexedDataObject> transformObjectToIndexedDataObjects​(com.fasterxml.jackson.databind.node.ObjectNode objectNode,
                                                                                        java.lang.String idFieldName)
      • serializeObject

        protected com.fasterxml.jackson.databind.node.ObjectNode serializeObject​(java.lang.Object object)
      • scheduleIndexing

        public void scheduleIndexing​(java.lang.String type,
                                     com.fasterxml.jackson.databind.node.ObjectNode dataNode,
                                     java.lang.String tenantId)
        Description copied from interface: IndexingService
        Schedule the json directly to be indexed using the provided type.
        Specified by:
        scheduleIndexing in interface IndexingService
      • deleteByQuery

        public void deleteByQuery​(java.lang.String aliasName,
                                  com.fasterxml.jackson.databind.node.ObjectNode query)
        Description copied from interface: LowLevelIndexingService
        Delete indexed objects based on a query.
        Specified by:
        deleteByQuery in interface LowLevelIndexingService
      • scheduleUpdateByQuery

        public void scheduleUpdateByQuery​(java.lang.String mappingType,
                                          com.fasterxml.jackson.databind.node.ObjectNode updateByQueryBody)
        Description copied from interface: IndexingService
        Schedule an update by query with an abitrary body. The mappingType parameter is used to determine which indexes this will be applied to.
        Specified by:
        scheduleUpdateByQuery in interface IndexingService
      • updateByQuery

        public void updateByQuery​(java.lang.String mappingType,
                                  com.fasterxml.jackson.databind.node.ObjectNode data)
        Description copied from interface: LowLevelIndexingService
        Perform Update by Query for the given Mapping type.
        Specified by:
        updateByQuery in interface LowLevelIndexingService
        Parameters:
        mappingType - the type of the mapping for which the update should be done
        data - the update by query request data
      • scheduleIndexedObjectDelete

        public void scheduleIndexedObjectDelete​(java.lang.String aliasName,
                                                java.lang.String id)
        Description copied from interface: IndexingService
        Schedule a delete of an object from an index.
        Specified by:
        scheduleIndexedObjectDelete in interface IndexingService
      • addToCurrentBulkRequestAsUpsert

        public void addToCurrentBulkRequestAsUpsert​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext,
                                                    com.fasterxml.jackson.databind.node.ObjectNode data,
                                                    java.lang.String idFieldName)
        Description copied from interface: LowLevelIndexingService
        Adds the ObjectNode data as an upsert (i.e. merge if exist, insert if not) to the current bulk request (or creates a bulk request if needed). The bulk request is executed at the end of the transactions, when all items for indexing have been added.
        Specified by:
        addToCurrentBulkRequestAsUpsert in interface LowLevelIndexingService
      • addToCurrentBulkRequestAsFullIndex

        public void addToCurrentBulkRequestAsFullIndex​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext,
                                                       java.lang.String type,
                                                       java.lang.String id,
                                                       com.fasterxml.jackson.databind.node.ObjectNode data,
                                                       java.lang.String idFieldName)
        Description copied from interface: LowLevelIndexingService
        Adds the ObjectNode data as a full index (i.e. replace the current indexed document if any exists) to the current bulk request (or creates a bulk request if needed). The bulk request is executed at the end of the transactions, when all items for indexing have been added. The {type, id} parameters are not used during indexing, but is registered internally and can be used to check whether indexing was already triggered via the LowLevelIndexingService.isFullIndexRegisteredOnCurrentBulkRequest(CommandContext, String, String) method. This allows to avoid costly recalculation of data or doing the same indexing operation multiple times in ES. Note that this method doesn't apply that check automatically, and the caller is responsible for calling it.
        Specified by:
        addToCurrentBulkRequestAsFullIndex in interface LowLevelIndexingService
      • addToCurrentBulkRequestAsUpsertWithScript

        public void addToCurrentBulkRequestAsUpsertWithScript​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext,
                                                              com.fasterxml.jackson.databind.node.ObjectNode dataNode,
                                                              com.fasterxml.jackson.databind.node.ObjectNode scriptNode,
                                                              java.lang.String idFieldName)
        Description copied from interface: LowLevelIndexingService
        Adds the ObjectNode data as an upsert (i.e. merge if exist, insert if not) using an update script to the current bulk request (or creates a bulk request if needed). The bulk request is executed at the end of the transactions, when all items for indexing have been added.
        Specified by:
        addToCurrentBulkRequestAsUpsertWithScript in interface LowLevelIndexingService
      • determineIndex

        protected java.lang.String determineIndex​(com.fasterxml.jackson.databind.node.ObjectNode objectNode,
                                                  IndexedDataObject indexedDataObject)
      • determineIndex

        protected java.lang.String determineIndex​(IndexMapping indexMapping)
      • createHistoryJobEntity

        protected org.flowable.job.service.impl.persistence.entity.HistoryJobEntity createHistoryJobEntity​(java.lang.String handlerType)