Search in sources :

Example 1 with TableRecordReferenceSet

use of org.adempiere.util.lang.impl.TableRecordReferenceSet in project metasfresh-webui-api by metasfresh.

the class DocumentCacheInvalidationDispatcher method resetNow.

private void resetNow(@NonNull final DocumentToInvalidateMap documentsToInvalidate) {
    logger.trace("resetNow: {}", documentsToInvalidate);
    try (final IAutoCloseable c = documents.getWebsocketPublisher().temporaryCollectOnThisThread()) {
        documentsToInvalidate.toCollection().forEach(documents::invalidate);
    }
    // 
    final TableRecordReferenceSet rootRecords = documentsToInvalidate.getRootRecords();
    viewsRepository.notifyRecordsChanged(rootRecords);
}
Also used : TableRecordReferenceSet(org.adempiere.util.lang.impl.TableRecordReferenceSet) IAutoCloseable(org.adempiere.util.lang.IAutoCloseable)

Example 2 with TableRecordReferenceSet

use of org.adempiere.util.lang.impl.TableRecordReferenceSet in project metasfresh-webui-api by metasfresh.

the class AbstractCustomView method notifyRecordsChanged.

@Override
public final void notifyRecordsChanged(@NonNull final TableRecordReferenceSet recordRefs) {
    if (recordRefs.isEmpty()) {
        // nothing to do, but shall not happen
        return;
    }
    final TableRecordReferenceSet recordRefsEligible = recordRefs.filter(this::isEligibleInvalidateEvent);
    if (recordRefsEligible.isEmpty()) {
        // nothing to do
        return;
    }
    final DocumentIdsSelection documentIdsToInvalidate = getDocumentIdsToInvalidate(recordRefsEligible);
    if (documentIdsToInvalidate.isEmpty()) {
        // nothing to do
        return;
    }
    rowsData.invalidate(documentIdsToInvalidate);
    ViewChangesCollector.getCurrentOrAutoflush().collectRowsChanged(this, documentIdsToInvalidate);
}
Also used : TableRecordReferenceSet(org.adempiere.util.lang.impl.TableRecordReferenceSet) DocumentIdsSelection(de.metas.ui.web.window.datatypes.DocumentIdsSelection)

Aggregations

TableRecordReferenceSet (org.adempiere.util.lang.impl.TableRecordReferenceSet)2 DocumentIdsSelection (de.metas.ui.web.window.datatypes.DocumentIdsSelection)1 IAutoCloseable (org.adempiere.util.lang.IAutoCloseable)1