File

core/dynamic-component/managedObject-resolver.ts

Description

A DynamicDetailsResolver responsible to resolve managedObjects for dynamic components. This service implements bulk resolving. This reduces the number of requests made to the backend by querying multiple managedObjectIds in a single request.

Extends

DynamicBulkIIdentifiedResolver

Index

Properties
Methods

Constructor

constructor(dynamicResolver: DynamicResolverService, inventory: InventoryService)
Parameters :
Name Type Optional
dynamicResolver DynamicResolverService No
inventory InventoryService No

Methods

Protected Async getStatusDetails
getStatusDetails(moId: string)
Parameters :
Name Type Optional
moId string No
Returns : unknown
Protected Async loadAChunkOfManagedObjects
loadAChunkOfManagedObjects(uniqIds: string[])
Parameters :
Name Type Optional
uniqIds string[] No
Returns : Promise<literal type>
Protected Async loadManagedObjectsInChunks
loadManagedObjectsInChunks(uniqIds: string[], bulkRequestId: number)
Parameters :
Name Type Optional
uniqIds string[] No
bulkRequestId number No
Returns : Promise<literal type>
Protected performBulkRequest
performBulkRequest(uniqIds: string[], bulkRequestId: number)
Parameters :
Name Type Optional
uniqIds string[] No
bulkRequestId number No
Returns : Promise | Observable
buildRetrievalAlert
buildRetrievalAlert(entity: Partial, errors: DynamicBulkRetrievalError[])
Parameters :
Name Type Optional
entity Partial<T> No
errors DynamicBulkRetrievalError[] No
Protected extractIdsToBeRetrieved
extractIdsToBeRetrieved(valueBehindAttribute: Partial | Array>)
Parameters :
Name Type Optional
valueBehindAttribute Partial<T> | Array<Partial<T>> No
Returns : string | []
Protected serializeSingleObject
serializeSingleObject(obj: T)
Parameters :
Name Type Optional
obj T No
Returns : Partial<T>
addIdsToBeLoaded
addIdsToBeLoaded(bulkRequestId: number, ...ids: string[])

Adds a single id or an array of ids to the idsGroupedByBulkId Map for the provided bulkRequestId.

Parameters :
Name Type Optional
bulkRequestId number No
ids string[] No
Returns : void
getResult$
getResult$(bulkRequestId: number)

Provides an Observable of the results of the given bulkRequestId.

Parameters :
Name Type Optional
bulkRequestId number No
Returns : Observable<literal type>
Protected isEntityOfId
isEntityOfId(obj: T, id: string)

Checks wether an object is of given id. Will by default compare the id attribute with the given id.

Parameters :
Name Type Optional
obj T No
id string No
Returns : boolean
resolve
resolve(config: any, attribute: string, bulkRequestId: number)
Parameters :
Name Type Optional
config any No
attribute string No
bulkRequestId number No
serialize
serialize(config: any, attribute: string)

Default implementation compatible with serializing an object or an Array of objects. Calls serializeSingleObject for an object and for every entry within the array.

Parameters :
Name Type Optional
config any No
attribute string No
Returns : Partial | Array

Properties

Protected Readonly maxNumberOfManagedObjectsPerRequest
Type : number
Default value : 50
Protected queryFilter
Type : any
Default value : {}
Protected typeForErrorMessage
Type : string
Default value : 'managedObject'
Protected idsGroupedByBulkId
Default value : new Map<number, string[]>()

Map containing the ids to be retrieved per bulk request.

resultsOfBulkLoad
Type : Observable<literal type>

Provides an Observable of the results of all bulk requests.

results matching ""

    No results matching ""