3. Modify MARC_BIB
Description
Modify action was designed to be applied on the incoming MARC Bib record before mapping any other entities, to ensure such behavior it should be placed at the beginning of the Job Profile. However, Modify action can also be applied at the end of the Job Profile, following actions on MARC Bib/Instance, in that case Modify will affect existing record that was acted upon in the context of the Job. Following are the supported scenarios using Modify action.
1. Modify Incoming MARC Bib + Create Instance
NB In this case Create Instance action can be followed by Create Holdings and Create Item actions. They've been omitted for brevity.
Flow (Updated with changes made in Quesnelia R1 2024)
[1-4] UploadDefinition is created for importing files in mod-data-import
[2-3] JobExecution is created in mod-srm
[5-7] MARC files are uploaded from WEB client to mod-data-import
[6] Uploaded file is split into chunks in mod-data-import
[8-9] User selects the JobProfile and initiates the processing of the uploaded files
[10-11] Profile ID is set for JobExecution
[12] MARC records are packed into batches and put to Kafka queue DI_RAW_RECORDS_CHUNK_READ
[13-15] mod-srm reads batches from the queue, parses MARC records and saves the Incoming records in the DB. JobExecution is set to IN_PROGRESS status on first chunk received.
[15-16] mod-srm reads the profile and creates JSON payload (containing parsed MARC) for processing. Exports it to an appropriate Kafka queue (one message per MARC entry) - DI_INCOMING_MARC_BIB_RECORD_PARSED
[17] mod-inventory processes Modify action on incoming MARC Bib and substitutes MARC_BIBLIOGRAPHIC value in the event payload (no existing entities are affected in this case)
[20] mod-inventory issues DI_SRS_MARC_BIB_RECORD_MODIFIED event
[20-24] mod-inventory reads the message, MARC Bib value from '001' + '003' is moved to '035', after which the Instance is mapped and created via HTTP in mod-inventory-storage. At this point Instance UUID and Instance HRID are generated.
[25-27] Instance HRID is set to '001' MARC_BIB field, Instance ID is set to '999 ff i' field and is saved in mod-srs via HTTP
[30] mod-inventory issues DI_INVENTORY_INSTANCE_CREATED event
[31] mod-inventory reads message and exports to DI_COMPLETED
[32] mod-srm receives DI_COMPLETED event, marks JobExecution as COMPLETED
Diagram (Updated with changes made in Quesnelia R1 2024)
2. Create Instance + Modify MARC Bib
NB: In this case Create Instance action can also be followed by Create Holdings and Create Item actions. They've been omitted for brevity.
Flow
[1-4] UploadDefinition is created for importing files in mod-data-import
[2-3] JobExecution is created in mod-srm
[5-7] MARC files are uploaded from WEB client to mod-data-import
[6] Uploaded file is split into chunks in mod-data-import
[8-9] User selects the JobProfile and initiates the processing of the uploaded files
[10-11] Profile ID is set for JobExecution
[12] MARC records are packed into batches and put to Kafka queue DI_RAW_RECORDS_CHUNK_READ
[13-15] mod-srm reads batches from the queue, parses MARC records and saves the Incoming records in the DB. JobExecution is set to IN_PROGRESS status on first chunk received.
[15-16] mod-srm reads the profile and creates JSON payload (containing parsed MARC) for processing. Exports it to an appropriate Kafka queue (one message per MARC entry) - DI_INCOMING_MARC_BIB_RECORD_PARSED
[17-20] mod-inventory reads the message, MARC Bib value from '001' + '003' is moved to '035', after which the Instance is mapped and created via HTTP in mod-inventory-storage. At this point Instance UUID and Instance HRID are generated.
[21-23] Instance HRID is set to '001' MARC_BIB field, Instance ID is set to '999 ff i' field and is saved in mod-srs via HTTP
[26] mod-inventory issues DI_INVENTORY_INSTANCE_CREATED event
[27] mod-inventory modifies MARC_BIBLIOGRAPHIC, re-maps INSTANCE that are present in the payload (created as a result of the first action)
[28-33] mod-inventory updates Instance in mod-inventory-storage and SRS MARC in mod-srm
[36] mod-inventory issues DI_SRS_MARC_BIB_RECORD_MODIFIED event
[37] mod-inventory reads message and exports to DI_COMPLETED
[38] mod-srm receives DI_COMPLETED event, marks JobExecution as COMPLETED
Diagram
3. Modify MARC Bib + Match and Update Instance
NB: In this case any Match can be used (including MARC-to-MARC Match), and any allowed actions placed under the Match.
Flow
[1-4] UploadDefinition is created for importing files in mod-data-import
[2-3] JobExecution is created in mod-srm
[5-7] MARC files are uploaded from WEB client to mod-data-import
[6] Uploaded file is split into chunks in mod-data-import
[8-9] User selects the JobProfile and initiates the processing of the uploaded files
[10-11] Profile ID is set for JobExecution
[12] MARC records are packed into batches and put to Kafka queue DI_RAW_RECORDS_CHUNK_READ
[13-15] mod-srm reads batches from the queue, parses MARC records and saves the Incoming records in the DB. JobExecution is set to IN_PROGRESS status on first chunk received.
[15-16] mod-srm reads the profile and creates JSON payload (containing parsed MARC) for processing. Exports it to an appropriate Kafka queue (one message per MARC entry) - DI_INCOMING_MARC_BIB_RECORD_PARSED
[17] mod-inventory processes Modify action on incoming MARC Bib and substitutes MARC_BIBLIOGRAPHIC value in the event payload (no existing entities are affected in this case)
[20] mod-inventory issues DI_SRS_MARC_BIB_RECORD_MODIFIED event
[21-22] mod-inventory reads the message, processes Match profile - reads Match criteria and constructs a CQL search query for mod-inventory-storage, sends an HTTP request to get the Instance
[23] mod-inventory processes search result and issues an appropriate event (either DI_INVENTORY_INSTANCE_NOT_MATCHED if no Instance exists satisfying search criteria, or DI_INVENTORY_INSTANCE_MATCHED if such Instance is found)
[24-26] In case Instance is not found Job completes for this particular Job Profile (no other actions are placed under a Non-Match branch of the Job Profile)
[27-33] In case Instance is found - mod-inventory processes Update Instance action. Instance for an update is mapped from the modified version of incoming MARC Bib.
[37] mod-inventory reads message and exports to DI_COMPLETED
[38] mod-srm receives DI_COMPLETED event, marks JobExecution as COMPLETED
Diagram
4. Match and Update Instance + Modify MARC Bib
NB: In this particular case Modify can also be placed either inside the Match block following other actions, or outside the Match block. Modify will be processed in the same way.
NB: Any Match profile and any allowed Actions can be used before the Modify action, however Modify at the end will be processed only if there was an explicit or implicit action on the Instance.
Flow
[1-4] UploadDefinition is created for importing files in mod-data-import
[2-3] JobExecution is created in mod-srm
[5-7] MARC files are uploaded from WEB client to mod-data-import
[6] Uploaded file is split into chunks in mod-data-import
[8-9] User selects the JobProfile and initiates the processing of the uploaded files
[10-11] Profile ID is set for JobExecution
[12] MARC records are packed into batches and put to Kafka queue DI_RAW_RECORDS_CHUNK_READ
[13-15] mod-srm reads batches from the queue, parses MARC records and saves the Incoming records in the DB. JobExecution is set to IN_PROGRESS status on first chunk received.
[15-16] mod-srm reads the profile and creates JSON payload (containing parsed MARC) for processing. Exports it to an appropriate Kafka queue (one message per MARC entry) - DI_INCOMING_MARC_BIB_RECORD_PARSED
[17-18] mod-inventory reads the message, processes Match profile - reads Match criteria and constructs a CQL search query for mod-inventory-storage, sends an HTTP request to get the Instance
[19] mod-inventory processes search result and issues an appropriate event (either DI_INVENTORY_INSTANCE_NOT_MATCHED if no Instance exists satisfying search criteria, or DI_INVENTORY_INSTANCE_MATCHED if such Instance is found)
[20-22] In case Instance is not found Job completes for this particular Job Profile (no other actions are placed under a Non-Match branch of the Job Profile)
[23-29] In case Instance is found - mod-inventory processes Update Instance action. Instance for an update is mapped from the incoming MARC Bib and Instance is updated in mod-inventory-storage, SRS MARC is updated in mod-srs
[33] mod-inventory processes Modify action, modifies MARC_BIBLIOGRAPHIC, re-maps INSTANCE that are present in the payload (found and placed in the context as a result of the Match)
[34-39] mod-inventory updates Instance in mod-inventory-storage and SRS MARC in mod-srs
[42] mod-inventory issues DI_SRS_MARC_BIB_RECORD_MODIFIED event
[43] mod-inventory reads message and exports to DI_COMPLETED
[44] mod-srm receives DI_COMPLETED event, marks JobExecution as COMPLETED
Diagram
5. Match and update MARC Bib, holdings + modify MARC Bib (Available since Trillium)
Flow
[1-4] UploadDefinition is created for importing files in mod-data-import
[2-3] JobExecution is created in mod-source-record-manager
[5] MARC files are uploaded from WEB client to mod-data-import
[6] Uploaded file is saved chunk by chunk in mod-data-import
[8-9] User selects the Job Profile and initiates the processing of the uploaded file
[10-11] The job profile ID is set for JobExecution
[12-13] MARC file is split into batches of MARC records and put to Kafka queue DI_RAW_RECORDS_CHUNK_READ
[14-15] mod-srm reads batches from the DI_RAW_RECORDS_CHUNK_READ queue, parses MARC records, and saves the incoming records to the DB to provide them for data import logs. JobExecution is set to IN_PROGRESS status on a first chunk receiving.
[16-17] mod-srm reads the profile and creates JSON payload (containing parsed MARC) for processing. Sends it to an appropriate Kafka queue (one message per MARC entry) - DI_MARC_FOR_UPDATE_RECEIVED
[18-19] mod-inventory reads the message and processes MARC-BIB match profile - tries to find a MARC-BIB in mod-source-record-storage using match criteria from the match profile. Processes MARC-BIB search result and issues an appropriate event (DI_SRS_MARC_BIB_RECORD_NOT_MATCHED if no MARC-BIB record exists satisfying search criteria, or DI_SRS_MARC_BIB_RECORD_MATCHED if such MARC-BIB record is found)
[20] If MARC-BIB is not found - mod-inventory sends DI_COMPLETED since no other profiles are placed for "non-matches" branch of the MARC-BIB Match Profile. The processing flow for the particular incoming record is completed. The sent event contains result event indication (DI_SRS_MARC_BIB_RECORD_NOT_MATCHED) denoting MARC-BIB matching result
[21] mod-srm receives DI_COMPLETED and updates the import job progress
[22] If MARC-BIB record is found - mod-inventory sends DI_SRS_MARC_BIB_RECORD_MATCHED
[23-24] mod-inventory reads the message and processes holdings match profile - searches holdings record in mod-inventory-storage using match criteria from the match profile. Processes holdings search result and issues an appropriate event (DI_INVENTORY_HOLDING_NOT_MATCHED if no holdings record is found, or DI_INVENTORY_HOLDING_MATCHED if holding found)
[25] If holding is not found - mod-inventory sends DI_COMPLETED since no other profiles are placed for "non-matches" branch of the Holdings Match Profile. The processing flow for the particular incoming record is completed. The sent event contains result event indication (DI_INVENTORY_HOLDING_NOT_MATCHED) denoting holdings matching result
[26] mod-srm receives DI_COMPLETED and updates the import job progress
[27] If holding is found - mod-inventory sends DI_INVENTORY_HOLDING_MATCHED
[28-29] mod-source-record-storage reads the message and performs 1st phase of the update MARC-BIB action profile processes. Updates MARC-BIB record found on the 10th step according to mapping profile linked to the update action profile. Saves the updated record as a new ACTUAL version to the DB and sends DI_SRS_MARC_BIB_RECORD_MODIFIED_READY_FOR_POST_PROCESSING
[30-33] mod-inventory reads the message and performs 2nd phase of the update MARC-BIB action profile processes. The module re-maps the related instance according to the default mapping rules and saves the updated instance in mod-inventory-storage. If the instance update succeeds, the module sends DI_SRS_MARC_BIB_RECORD_UPDATED
[34-37] mod-inventory reads the message and processes update holdings action profile - maps holding according to mapping profile linked to the update action profile, saves updated holding in mod-inventory-storage and sends DI_INVENTORY_HOLDING_UPDATED
[38-47] mod-inventory reads the message and processes modify MARC-BIB action profile - modifies the MARC-BIB record according to a mapping profile linked to the modify MARC-BIB action profile, saves the modified/changed MARC-BIB record in mod-source-record-storage. Further, the module re-maps the related instance according to the default mapping rules, saves the updated instance in mod-inventory-storage and sends DI_SRS_MARC_BIB_RECORD_MODIFIED
[47] In case of a successful a modify MARC-BIB action profile processing the mod-inventory sends DI_COMPLETED event
[47-48] mod-srm receives DI_COMPLETED event and marks JobExecution status as "COMMITTED" if all incoming record have been processed without errors, otherwise sets JobExecution status to "ERROR"
Diagram