def METHOD_NAME(business: Business,  # pylint: disable=too-many-branches
            filing: Dict,
            filing_rec: Filing,
            filing_meta: FilingMeta,
            filing_event_data: Dict):  # pylint: disable=too-many-branches
    """Process the incoming registration filing."""
    # Extract the filing information for registration
    registration_filing = filing.get('filing', {}).get('registration')
    filing_meta.registration = {}
    corp_num = registration_filing['business']['identifier']
    if not registration_filing:
        # raise QueueException(f'Registration legal_filing:registration missing from {filing_rec.id}')
        raise Exception(f'Registration legal_filing:registration missing from {filing_rec.id}')
    if business:
        # raise QueueException(f'Business Already Exist: Registration legal_filing:registration {filing_rec.id}')
        raise Exception(f'Business Already Exist: Registration legal_filing:registration {filing_rec.id}')
    business_info_obj = registration_filing.get('nameRequest')
    # Initial insert of the business record
    business = Business()
    business = business_info.update_business_info(corp_num, business, business_info_obj, filing_rec)
    if start_date := registration_filing.get('startDate'):
        business.start_date = datetime.fromisoformat(start_date) + timedelta(hours=8)
    business.founding_date = filing_event_data['c_recognition_dts_pacific']
    business.admin_freeze = filing_event_data['c_is_frozen']
    business_obj = registration_filing.get('business', {})
    if (naics := registration_filing.get('business', {}).get('naics')):
        business_info.update_naics_info(business, naics)
    business.tax_id = business_obj.get('taxId', None)
    business.state = Business.State.ACTIVE
    if nr_number := business_info_obj.get('nrNumber', None):
        filing_meta.registration = {**filing_meta.registration,
                                    **{'nrNumber': nr_number,
                                       'legalName': business_info_obj.get('legalName', None)}}
    if not business:
        # raise QueueException(f'Registration {filing_rec.id}, Unable to create business.')
        raise Exception(f'Registration {filing_rec.id}, Unable to create business.')
    if offices := registration_filing['offices']:
        update_offices(business, offices)
    if parties := registration_filing.get('parties'):
        update_parties(business, parties, filing_rec)
    # update court order, if any is present
    with suppress(IndexError, KeyError, TypeError):
        court_order_json = dpath.util.get(filing, '/registration/courtOrder')
        filings.update_filing_court_order(filing_rec, court_order_json)
    if lt_notation := filing_event_data.get('lt_notation'):
        filing_rec.comments.append(
            Comment(
                comment=lt_notation,
                staff_id=filing_rec.submitter_id
            )
        )
    # Update the filing json with identifier and founding date.
    registration_json = copy.deepcopy(filing_rec.filing_json)
    registration_json['filing']['business'] = {}
    registration_json['filing']['business']['identifier'] = business.identifier
    registration_json['filing']['registration']['business']['identifier'] = business.identifier
    registration_json['filing']['business']['legalType'] = business.legal_type
    registration_json['filing']['business']['foundingDate'] = business.founding_date.isoformat()
    filing_rec._filing_json = registration_json  # pylint: disable=protected-access; bypass to update filing data
    return business, filing_rec, filing_meta