# Business Logic — JKKSodSendCC.editInMsgESC0051D010() [612 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKSodSendCC` |
| Layer | Common Component (CC) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKSodSendCC.editInMsgESC0051D010()

This method is the **telephone service order message builder** for the SOD (Service Order Data) dispatch system used in K-Opticom's customer infrastructure platform. Its business purpose is to take raw telephone service order data from `telSvcOrderInfo` and map it into a structured `CAANMsg` message (`ESC0051D010CBSMsg`) that will be sent to downstream CBS (CBS = Central Business System) components for order processing. The method acts as a data-transformation bridge between the order-entry layer and the service-component execution layer.

The method handles multiple **service types** distinguished by the `telSvcOrderCd` (Telephone Service Order Code) from `telSvcOrderInfo`: service code **"26"** (Multi-Function Router Setup — 多機能ルータ設定), service code **"20"** (OLS — Optical Line System), and service code **"28"** (ENUM Setup — ENUM設定). When service code "26" is detected, the method applies specialized mapping logic via the `editOlsTerms4FatRouterSet` helper (which handles SIP, VA auth, and routing fields differently for new vs. change orders). When service code "28" is detected, it maps ENUM-specific fields (TELNO, NW_ROUTING_NO, SVC_DIV, DOMAIN).

The method implements a **delegation + template-building pattern**: it creates a typed message template (`CAANMsg`), initializes null-mapping, sets common fields unconditionally, branches conditionally based on service type, then delegates final assembly to `editInMsgCmn`. The method was extended in ANK-2113-00-00 to accept `updTrnId` and `odrDtlCd` parameters to handle SOD priority assignment logic for new, change, cancel, and deregister scenarios involving OLS or multi-function router orders.

It is called by `JKKSodSendCC.executeSodSend()` as part of the end-to-end order dispatch flow, where it transforms telephone service order data before invoking the corresponding CBS service component.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsgESC0051D010"])
    CREATE_TEMPLATE["Create CAANMsg template"]
    NULL_MAPPING["fillCAANMSGNullMapping"]
    BASIC_CMN["editInMsgBasicCmn"]
    SET_TEMPLATE_ID["Set TEMPLATEID = ESC0051D010"]
    SET_COMMON["Set common fields: FUNC_CODE, SVC_KEI_NO, IP_AD, BAS_ID, VLAN_ID, VA_MACAD, etc."]
    CHECK_ROUTER{TELSVC_ORDER_CD == 26?}
    ROUTER_SET["editOlsTerms4FatRouterSet"]
    ROUTER_NON_SET["Set non-router fields: VA_NINSHO_KEY, SIP_USER_ID, MAIN_TELNO, SUB_TELNO, etc."]
    POST_SET["Set post-branch common fields: MAIN_TELNO_INCOMSET, TEL_PORT_SKT_SET, CHANNEL_CNT, DAIHYO_AD, HTB_TCHI_FLG, KOTNMT_SKBT_NO_1-10, ITNTOKI_*, EMG_*, SIP_DN, SIP_NRN, PORT_NO, etc."]
    TAKINORT_MACAD["Set TAKINORT_MACAD"]
    CHECK_ROUTER_NINSHO{TELSVC_ORDER_CD == 26 AND YOKYU_SBT_CD == 02?}
    ROUTER_NINSHO_SET["Set OLD_TAKINORT_NINSHO_KEY, TAKINORT_NINSHO_KEY"]
    NON_ROUTER_SET["Set PPPoE, DHCP, LAN, VoIP, B2BUA, IPv6, L2TP fields"]
    CHECK_PRIORITY{Svc Order 20 or 26 AND New/Change?}
    CHECK_UPD_TRN_ID{updTrnId contains EO2B20160J0 or EO2IR0110J0?}
    SET_LOW_PRIORITY["Set SVC_ORDER_DTAIL_CD = 01 (Low)"]
    CHECK_ODR_CHK{ODR_CHK_FLG == true?}
    SET_HIGH_PRIORITY["Set SVC_ORDER_DTAIL_CD = 02 (High)"]
    CHECK_HENPIN{isHenpinToroku?}
    CHECK_ODR_DTL{odrDtlCd != null?}
    SET_HIGH_PRIORITY2["Set SVC_ORDER_DTAIL_CD = 02 (High)"]
    SET_ODR_DTCD["Set SVC_ORDER_DTAIL_CD = odrDtlCd"]
    ELSE_PRIORITY["Set SVC_ORDER_DTAIL_CD = 01 (Low)"]
    CHECK_FAT_ROUTER{TELSVC_ORDER_CD == 26?}
    ANSHIN_SET["Set ANSHIN_HCS and AREACD fields"]
    CHECK_ENUM{TELSVC_ORDER_CD == 28?}
    ENUM_SET["Set ENUM fields: TELNO, NW_ROUTING_NO, SVC_DIV, DOMAIN"]
    FINAL_CMN["editInMsgCmn"]
    RETURN(["Return result"])

    START --> CREATE_TEMPLATE --> NULL_MAPPING --> BASIC_CMN --> SET_TEMPLATE_ID --> SET_COMMON
    SET_COMMON --> CHECK_ROUTER
    CHECK_ROUTER --> |Yes| ROUTER_SET
    CHECK_ROUTER --> |No| ROUTER_NON_SET
    ROUTER_SET --> POST_SET
    ROUTER_NON_SET --> POST_SET
    POST_SET --> TAKINORT_MACAD
    TAKINORT_MACAD --> CHECK_ROUTER_NINSHO
    CHECK_ROUTER_NINSHO --> |Yes| ROUTER_NINSHO_SET
    CHECK_ROUTER_NINSHO --> |No| NON_ROUTER_SET
    ROUTER_NINSHO_SET --> CHECK_PRIORITY
    NON_ROUTER_SET --> CHECK_PRIORITY
    CHECK_PRIORITY --> |Yes (New/Change)| CHECK_UPD_TRN_ID
    CHECK_PRIORITY --> |No| CHECK_OTHER_BRANCH
    CHECK_UPD_TRN_ID --> |Yes| SET_LOW_PRIORITY
    CHECK_UPD_TRN_ID --> |No| CHECK_ODR_CHK
    SET_LOW_PRIORITY --> CHECK_HENPIN
    CHECK_ODR_CHK --> |Yes| SET_LOW_PRIORITY
    CHECK_ODR_CHK --> |No| SET_HIGH_PRIORITY
    SET_HIGH_PRIORITY --> CHECK_HENPIN
    CHECK_HENPIN --> |Yes| SET_HIGH_PRIORITY
    CHECK_HENPIN --> |No| CHECK_ODR_DTL
    CHECK_ODR_DTL --> |Yes| SET_ODR_DTCD
    CHECK_ODR_DTL --> |No| ELSE_PRIORITY
    SET_ODR_DTCD --> CHECK_OTHER_BRANCH
    ELSE_PRIORITY --> CHECK_OTHER_BRANCH
    CHECK_OTHER_BRANCH{Svc Order 20 or 26 AND Cancel/Deregister?}
    CHECK_OTHER_BRANCH --> |Yes| CHECK_HENPIN
    CHECK_OTHER_BRANCH --> |No| ELSE_PRIORITY
    CHECK_FAT_ROUTER --> |Yes| ANSHIN_SET
    CHECK_FAT_ROUTER --> |No| CHECK_ENUM
    ANSHIN_SET --> CHECK_ENUM
    CHECK_ENUM --> |Yes| ENUM_SET
    CHECK_ENUM --> |No| FINAL_CMN
    ENUM_SET --> FINAL_CMN
    FINAL_CMN --> RETURN
```

**Processing overview:**

1. **Template creation & null mapping**: Creates a `CAANMsg` template typed as `ESC0051D010CBSMsg` and fills in null-value mappings.
2. **Common fields setup**: Applies base common message settings via `editInMsgBasicCmn`, then sets the template ID, function code, and all fields that are shared across service types (service contract numbers, IP address, BAS-ID, VLAN-ID, VA MAC address, etc.).
3. **Multi-function router branch (TELSVC_ORDER_CD == "26")**: If the service order code is "26" (Multi-Function Router Setup), `editOlsTerms4FatRouterSet` is called to handle the special SIP/VA auth field mapping for router orders. Otherwise, the non-router fields (VA auth key, SIP user IDs, main/sub telephone numbers, etc.) are set directly.
4. **Post-branch common fields**: After the router/non-router divergence, a large set of common fields is set regardless of which branch was taken. This includes call waiting settings, channel count, SIP user info, terminal identifiers, phone number notification flags, area codes, weather report group IDs, web/RMT passwords, calling plan flags, forwarding flags, device type codes, emergency contact info, SIP-DN/NRN fields, and port numbers.
5. **TAKINORT (multi-function router) MAC address**: Sets the multi-function router MAC address from `JKKSodSendReqConst`.
6. **TAKINORT auth key condition**: If the service order is "26" (Multi-Function Router) AND the request type is "02" (New — 新規), sets the TAKINORT authentication key fields.
7. **Non-router PPPoE/IPv6/LAN fields**: Sets all network-layer configuration fields (PPPoE session settings, DHCP, LAN modes, VoIP, B2BUA, protocol type, IPv6 zone control, router/auth IDs, connection mode, auto-disconnect mode, L2TP auth, PPPoE bridge mode, Ping response modes, VA auth IDs, OLS contract settings, IPv6 address/interface ID, home device model, GE-PON integration, priority identification).
8. **Service order priority assignment**: A three-branch logic determines the `SVC_ORDER_DTAIL_CD` value ("01" = Low / "02" = High) based on service order type and request type:
   - **New/Change** for OLS or Multi-Function Router: If the update transaction ID contains machine release registration IDs, or if `ODR_CHK_FLG` is true, sets Low priority; otherwise High.
   - **Cancel/Deregister** for OLS or Multi-Function Router: If return registration ID is present, sets High; if `odrDtlCd` is provided, uses it directly; otherwise sets Low.
   - **Everything else**: Defaults to Low priority.
9. **Anshin HCS (安心着信 —安心来电) fields**: If service order code is "26", sets the Anshin来电 (incoming call notification with voice announcement) contract fields.
10. **ENUM fields**: If service order code is "28" (ENUM Setup), sets ENUM-specific fields (telephone number, network routing number, service division, domain).
11. **Final assembly**: Delegates to `editInMsgCmn` to produce the final S/I (Service Interface) output.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying the overall request context, including model groups, control maps, and session handle data used by called service components |
| 2 | `telSvcOrderInfo` | `HashMap<String, Object>` | Telephone service order data container — holds all raw order fields pulled from the order entry system. Keyed by `TSOI_*` constants (e.g., `TSOI_SVC_KEI_NO` for service contract number, `TSOI_TEL_SVC_ORDER_CD` for service order code). Contains fields for service contracts, IP/BAS/VLAN network configuration, SIP/VOIP settings, device info, emergency contact, and optional multi-function router fields. |
| 3 | `updTrnId` | `String` | Update transaction ID — identifies the source screen/work that triggered the order update. Used to determine SOD priority: IDs like `EO2B20160J0` (machine release registration completion) and `EO2IR0110J0` (transfer-completion device inheritance) trigger low-priority processing; return registration IDs (`EO50D0210J0`, `DKW00303`, `DKW02902`) trigger high-priority processing for cancel/deregister orders. |
| 4 | `odrDtlCd` | `String` | Order detail code — when not null, directly sets `SVC_ORDER_DTAIL_CD` for cancel/deregister scenarios, allowing the screen to override the default priority assignment. Related to address change confirmation logic. |

**Additional fields read:**
- `JKKSodSendConstCC.ODR_CHK_FLG` — Boolean flag from `telSvcOrderInfo` that controls priority assignment for non-updated transaction orders. When true, sets Low priority to prevent priority override.
- `JKKSodSendReqConst.TAKINORT_NINSHO_KEY` — Used for TAKINORT authentication key adjustment during change orders.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKSodSendCC.fillCAANMSGNullMapping` | - | - | Initializes null-value mappings on the CAANMsg template for all fields of `ESC0051D010CBSMsg` |
| U | `JKKSodSendCC.editInMsgBasicCmn` | - | - | Sets common message baseline fields (shared across all ESC message builders) |
| - | `JKKSodSendCC.convBlankToNull` | - | - | Utility: converts empty strings to null for template field values |
| C | `JKKSodSendCC.editOlsTerms4FatRouterSet` | - | - | Handles multi-function router-specific field mapping (SIP user IDs, VA auth keys, telephone numbers for up to 2 lines); clears old fields and sets new fields for new orders; adjusts for change orders |
| U | `JKKSodSendCC.editInMsgCmn` | - | - | Finalizes message assembly and returns the S/I output HashMap |
| - | `JKKSodSendCC.isHenpinToroku` | - | - | Checks if `updTrnId` contains return registration system IDs |
| - | `JKKSodSendCC.convNullToBlank` | - | - | Utility: converts null to blank string for template field values |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JKKSodSendCC.executeSodSend` | `executeSodSend` -> `editInMsgESC0051D010` -> `editInMsgBasicCmn` [U] -> `editOlsTerms4FatRouterSet` [C] -> `editInMsgCmn` [U] | `editInMsgBasicCmn` [U], `editOlsTerms4FatRouterSet` [C], `editInMsgCmn` [U], `isHenpinToroku` [-], `convBlankToNull` [-], `convNullToBlank` [-] |

**Note:** The only direct caller found is `JKKSodSendCC.executeSodSend()`, which iterates over service order info lists, checks for telephone service orders (service code 20 = OLS, 26 = Multi-Function Router, 28 = ENUM), optionally calls `editInMsgEKK1081B001` + `callSvcInter` for order release conditions, then invokes `editInMsgESC0051D010` to build the ESC message before calling `callSvcInter` to dispatch it.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `Create CAANMsg template` (L998)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(ESC0051D010CBSMsg.class.getName())` |

**Block 2** — [CALL] `Null mapping and basic CMN setup` (L1000–1004)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `fillCAANMSGNullMapping(template, new ESC0051D010CBSMsg().getContents())` // null mapping [-> all ESC0051D010 fields] |
| 2 | CALL | `editInMsgBasicCmn(param, template)` // common base settings |
| 3 | SET | `template.set(TEMPLATEID, "ESC0051D010")` // SIF template ID |

**Block 3** — [SET] `Common field population` (L1006–1055)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(FUNC_CODE, telSvcOrderInfo.get(TSOI_FUNC_CD))` // Function code from order info |
| 2 | SET | `template.set(SVC_KEI_NO, convBlankToNull(telSvcOrderInfo.get(TSOI_SVC_KEI_NO)))` // Service contract number |
| 3 | SET | `template.set(SVC_KEI_UCWK_NO, convBlankToNull(...TSOI_SVC_KEI_UCWK_NO))` // Service contract detail number |
| 4 | SET | `template.set(OP_SVC_KEI_NO, convBlankToNull(...TSOI_OP_SVC_KEI_NO))` // Option service contract number |
| 5 | SET | `template.set(KKTK_SCV_KEI_NO, convBlankToNull(...TSOI_KKTK_SCV_KEI_NO))` // Equipment provider service contract number |
| 6 | SET | `template.set(YOKYU_MT_APL_SBT_CD, convBlankToNull(...TSOI_YOKYU_MT_APL_SBT_CD))` // Requestor app type code |
| 7 | SET | `template.set(TEL_SVC_ORDER_CD, convBlankToNull(...TSOI_TEL_SVC_ORDER_CD))` // Telephone service order code |
| 8 | SET | `template.set(YOKYU_SBT_CD, convBlankToNull(...TSOI_YOKYU_SBT_CD))` // Request type code |
| 9 | SET | `template.set(DELTG_TEL_SVC_ORDER_NO, convBlankToNull(...TSOI_DELTG_TEL_SVC_ORDER_NO))` // Target deletion order number |
| 10 | SET | `template.set(SCHEDULE_YMD, convBlankToNull(...TSOI_SCHEDULE_YMD))` // Schedule date |
| 11 | SET | `template.set(OLD_NINSHO_ID, convBlankToNull(...TSOI_OLD_NINSHO_ID))` // Old authentication ID |
| 12 | SET | `template.set(NINSHO_ID, convBlankToNull(...TSOI_NINSHO_ID))` // Authentication ID |
| 13–24 | SET | Similar old/new pairs: OLD_NINSHO_ID_PWD, NINSHO_ID_PWD, OLD_IP_AD, IP_AD, OLD_NETMASK, NETMASK, OLD_BAS_ID, BAS_ID, OLD_MLTISE_CNT, MLTISE_CNT, OLD_BAS_HOST_ID, BAS_HOST_ID, OLD_VLAN_ID, VLAN_ID, OLD_SVC_ID, SVC_ID, VA_MACAD |

**Block 4** — [IF/ELSE] `Multi-Function Router vs Non-Router branch` `TELSVC_ORDER_CD == "26"` (L1057–1168)

| # | Type | Code |
|---|------|------|
| 1 | SET | `teSvcOdrCd = telSvcOrderInfo.get(TSOI_TEL_SVC_ORDER_CD)` // Service order code extracted |
| 2 | SET | `yokyuSbtCd = telSvcOrderInfo.get(TSOI_YOKYU_SBT_CD)` // Request type code extracted |
| 3 | IF | `if ("26".equals(teSvcOdrCd))` // Service code "26" = Multi-Function Router Setup [多機能ルータ設定] |
| 3.1 | CALL | `editOlsTerms4FatRouterSet(template, yokyuSbtCd, telSvcOrderInfo)` |
| 3.2 | ELSE | Non-router path |
| 3.3 | SET | `template.set(OLD_VA_NINSHO_KEY, convBlankToNull(...TSOI_OLD_VA_NINSHO_KEY))` // Old VA auth key |
| 3.4 | SET | `template.set(VA_NINSHO_KEY, convBlankToNull(...TSOI_VA_NINSHO_KEY))` // VA auth key |
| 3.5 | SET | `template.set(OLD_SIP_USER_ID_1, convBlankToNull(...TSOI_OLD_SIP_USER_ID_1))` // Old SIP user ID #1 |
| 3.6 | SET | `template.set(SIP_USER_ID_1, convBlankToNull(...TSOI_SIP_USER_ID_1))` // SIP user ID #1 |
| 3.7 | SET | `template.set(OLD_SIP_USER_ID_PWD_1, convBlankToNull(...TSOI_OLD_SIP_USER_ID_PWD_1))` // Old SIP user ID password #1 |
| 3.8 | SET | `template.set(SIP_USER_ID_PWD_1, convBlankToNull(...TSOI_SIP_USER_ID_PWD_1))` // SIP user ID password #1 |
| 3.9 | SET | `template.set(OLD_SIP_SERVER_DOMAIN_1, convBlankToNull(...TSOI_OLD_SIP_SERVER_DOMAIN_1))` // Old SIP server domain #1 |
| 3.10 | SET | `template.set(SIP_SERVER_DOMAIN_1, convBlankToNull(...TSOI_SIP_SERVER_DOMAIN_1))` // SIP server domain #1 |
| 3.11 | SET | `template.set(OLD_SIP_SERVER_AD_1, convBlankToNull(...TSOI_OLD_SIP_SERVER_AD_1))` // Old SIP server address #1 |
| 3.12 | SET | `template.set(SIP_SERVER_AD_1, convBlankToNull(...TSOI_SIP_SERVER_AD_1))` // SIP server address #1 |
| 3.13–3.20 | SET | Similar old/new pairs: MAIN_TELNO_1, SUB_TELNO_1, SIP_DOJI_CONNECT_CNT, EOH_TELNO_TCHI_SET, SIP_USER_ID_2, SIP_USER_ID_PWD_2, SIP_SERVER_DOMAIN_2, SIP_SERVER_AD_2, MAIN_TELNO_2 |

**Block 5** — [SET] `Post-branch common fields` (L1168–1295)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(OLD_MAIN_TELNO_INCOMSET_1, convBlankToNull(...TSOI_OLD_MAIN_TELNO_INCOMSET_1))` // Old main telephone incoming setting #1 |
| 2 | SET | `template.set(MAIN_TELNO_INCOMSET_1, convBlankToNull(...TSOI_MAIN_TELNO_INCOMSET_1))` // Main telephone incoming setting #1 |
| 3 | SET | `template.set(OLD_MAIN_TELNO_INCOMSET_2, convBlankToNull(...TSOI_OLD_MAIN_TELNO_INCOMSET_2))` // Old main telephone incoming setting #2 |
| 4 | SET | `template.set(MAIN_TELNO_INCOMSET_2, convBlankToNull(...TSOI_MAIN_TELNO_INCOMSET_2))` // Main telephone incoming setting #2 |
| 5 | SET | `template.set(OLD_TEL_PORT_SKT_SET, convBlankToNull(...TSOI_OLD_TEL_PORT_SKT_SET))` // Old telephone port socket setting |
| 6 | SET | `template.set(TEL_PORT_SKT_SET, convBlankToNull(...TSOI_TEL_PORT_SKT_SET))` // Telephone port socket setting |
| 7 | SET | `template.set(OLD_CHANNEL_CNT, convBlankToNull(...TSOI_OLD_CHANNEL_CNT))` // Old channel count |
| 8 | SET | `template.set(CHANNEL_CNT, convBlankToNull(...TSOI_CHANNEL_CNT))` // Channel count |
| 9 | SET | `template.set(OLD_SIP_USER_ID, convBlankToNull(...TSOI_OLD_SIP_USER_ID))` // Old SIP user ID |
| 10 | SET | `template.set(SIP_USER_ID, convBlankToNull(...TSOI_SIP_USER_ID))` // SIP user ID |
| 11 | SET | `template.set(OLD_SIP_USER_ID_PWD, convBlankToNull(...TSOI_OLD_SIP_USER_ID_PWD))` // Old SIP user ID password |
| 12 | SET | `template.set(SIP_USER_ID_PWD, convBlankToNull(...TSOI_SIP_USER_ID_PWD))` // SIP user ID password |
| 13–24 | SET | Similar old/new pairs: DAIHYO_AD, DAIHYO_TELNO, TNMT_SKBT_NO, MAIN_AD, OLD_MAIN_TEL_NO, MAIN_TEL_NO, TNMT_SBT, HTB_TCHI_FLG, CKI_CD, OLD_CKI_CD, TENKI_YOHO_GRP_ID, KNYSHA_CLASS, WEB_CUSCON_PWD, RMT_CUSCON_PWD, DRCTRY_NO, ROUTING_NO, CATPHONE_KEI_FLG, TENSO_TEL_KEI_FLG, STI_KO_TENSO_KEI_FLG, HTB_DSP_KEI_FLG, SUB_AD, SUB_TEL_NO, HITCHI_KYOHI_KEI_FLG, MWKTEL_KYOHI_KEI_FLG, STINO_INCMHI_KEI_FLG, DAIHYO_TRAT_KEI_HSK |

**Block 6** — [SET] `Sub-device identifiers and forwarding` (L1295–1360)

| # | Type | Code |
|---|------|------|
| 1–10 | SET | `template.set(KOTNMT_SKBT_NO_1 through KOTNMT_SKBT_NO_10, convBlankToNull(...TSOI_OLD_KOTNMT_SKBT_NO_1 through ...TSOI_KOTNMT_SKBT_NO_10))` // Sub-device IDs 1 through 10 |
| 11 | SET | `template.set(ITNTOKI_ADD_CD, convBlankToNull(...TSOI_ITNTOKI_ADD_CD))` // Port forwarding token registration code |
| 12 | SET | `template.set(ITNTOKI_SBT_CD, convBlankToNull(...TSOI_ITNTOKI_SBT_CD))` // Port forwarding token type code |
| 13 | SET | `template.set(ITNTOKI_GUIDNS_ITENM_TELNO, convBlankToNull(...TSOI_ITNTOKI_GUIDNS_ITENM_TELNO))` // Port forwarding token guidance source number |
| 14 | SET | `template.set(ITNTOKI_GUIDNS_ITENS_TELNO, convBlankToNull(...TSOI_ITNTOKI_GUIDNS_ITENS_TELNO))` // Port forwarding token guidance destination number |
| 15 | SET | `template.set(N_0ABJ_NO, convBlankToNull(...TSOI_N_0ABJ_NO))` // N_0ABJ number |
| 16 | SET | `template.set(N_050_NO, convBlankToNull(...TSOI_N_050_NO))` // N_050 number |

**Block 7** — [SET] `Emergency contact fields` (L1360–1375)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EMG_TELNO, convBlankToNull(...TSOI_EMG_TELNO))` // Emergency telephone number |
| 2 | SET | `template.set(EMG_NM, convBlankToNull(...TSOI_EMG_NM))` // Emergency contact name |
| 3 | SET | `template.set(EMG_KANA, convBlankToNull(...TSOI_EMG_KANA))` // Emergency contact name (katakana) |
| 4 | SET | `template.set(EMG_AD_CD, convBlankToNull(...TSOI_EMG_AD_CD))` // Emergency contact address code |
| 5 | SET | `template.set(EMG_AD, convBlankToNull(...TSOI_EMG_AD))` // Emergency contact address |
| 6 | SET | `template.set(EMG_BNCHIGO, convBlankToNull(...TSOI_EMG_BNCHIGO))` // Emergency contact block number |
| 7 | SET | `template.set(EMG_AD_HOKI, convBlankToNull(...TSOI_EMG_AD_HOKI))` // Emergency contact address supplement |

**Block 8** — [SET] `SIP-DN/NRN and port fields` (L1375–1400)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(SIP_DN_1, convBlankToNull(...TSOI_SIP_DN_1))` // SIP-DN #1 |
| 2 | SET | `template.set(SIP_NRN_1, convBlankToNull(...TSOI_SIP_NRN_1))` // SIP-NRN #1 |
| 3 | SET | `template.set(SIP_DN_2, convBlankToNull(...TSOI_SIP_DN_2))` // SIP-DN #2 |
| 4 | SET | `template.set(SIP_NRN_2, convBlankToNull(...TSOI_SIP_NRN_2))` // SIP-NRN #2 |
| 5 | SET | `template.set(SIP_DN, convBlankToNull(...TSOI_SIP_DN))` // SIP-DN |
| 6 | SET | `template.set(SIP_NRN, convBlankToNull(...TSOI_SIP_NRN))` // SIP-NRN |
| 7 | SET | `template.set(PORT_NO_1, convBlankToNull(...TSOI_PORT_NO_1))` // Port number #1 |
| 8 | SET | `template.set(PORT_NO_2, convBlankToNull(...TSOI_PORT_NO_2))` // Port number #2 |
| 9 | SET | `template.set(HTB_TCHI_FLG_1, convBlankToNull(...TSOI_HTB_TCHI_FLG_1))` // Number notification flag #1 |
| 10 | SET | `template.set(HTB_TCHI_FLG_2, convBlankToNull(...TSOI_HTB_TCHI_FLG_2))` // Number notification flag #2 |

**Block 9** — [SET] `TAKINORT MAC address` (L1402–1404)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(TAKINORT_MACAD, convBlankToNull(...TSKI_TAKINORT_MACAD))` // Multi-function router MAC address [-> TAKINORT_MACAD from JKKSodSendReqConst] |

**Block 10** — [IF] `TAKINORT auth key for new multi-function router orders` `TELSVC_ORDER_CD == "26" AND YOKYU_SBT_CD == "02"` (L1406–1416)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if ("26".equals(teSvcOdrCd) && "02".equals(yokyuSbtCd))` // Service "26" + Request "02" (New — 新規) |
| 2 | SET | `template.set(OLD_TAKINORT_NINSHO_KEY, convBlankToNull(...OLD_TAKINORT_NINSHO_KEY))` // Old multi-function router auth key [-> OLD_TAKINORT_NINSHO_KEY from JKKSodSendReqConst] |
| 3 | SET | `template.set(TAKINORT_NINSHO_KEY, convBlankToNull(...TAKINORT_NINSHO_KEY))` // Multi-function router auth key [-> TAKINORT_NINSHO_KEY from JKKSodSendReqConst] |

**Block 11** — [SET] `Non-router network configuration fields` (L1416–1530)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(OLD_PPPOE_SSON_STSET_CD, convBlankToNull(...OLD_PPPOE_SSON_STSET_CD))` // Old PPPoE session terminal setting code |
| 2 | SET | `template.set(PPPOE_SSON_STSET_CD, convBlankToNull(...PPPOE_SSON_STSET_CD))` // PPPoE session terminal setting code |
| 3–4 | SET | DHCP_YK_MK_CD (DHCP enable/disable code) |
| 5–6 | SET | YLAN_KINO_MODE_SKCD (Wired LAN function mode) |
| 7–8 | SET | MLAN_KINO_MODE_SKCD (Wireless LAN function mode) |
| 9–10 | SET | VOIP_YK_MK_CD (VoIP enable/disable) |
| 11–12 | SET | B2BUA_YK_MK_CD (B2BUA enable/disable) |
| 13–14 | SET | TK_PRTCL_SBT_CD (Service protocol type) |
| 15–16 | SET | IPV6_TAIIKI_CTRL_CD (IPv6 zone control) |
| 17–18 | SET | OLD_TKNRT_RTR_NSID / TKNRT_RTR_NSID (Multi-function router router auth ID) |
| 19–20 | SET | TKNRT_RTR_NSID_PWD (Multi-function router router auth password) |
| 21–22 | SET | IPV6_NINSHO_ID / IPV6_NINSHO_ID_PWD (IPv6 auth ID and password) |
| 23–24 | SET | CONNECT_MODE_CD / AUTO_CUT_MODE_CD / AUTO_CUT_TIME (Connection mode, auto-disconnect mode and time) |
| 25–28 | SET | L2TP_NINSHO_ID / L2TP_NINSHO_ID_SECON (L2TP auth ID and secondary) |
| 29–30 | SET | PPPOE_BRIDGE_SBT_CD / PING_RESPONSE_SBT_CD / IPV6_PING_RSP_SBT_CD |
| 31–36 | SET | OLD_TKNRT_VA_NSID / TKNRT_VA_NSID / TKNRT_VA_NSID_PWD / TKNRT_OLS_KSBT_SETCD / IPV6_CHUSKK_CD / IPV6_AD_IFID / IPV6_TAKNKIKI_MODEL_CD / GEPON_RNKI_TRGT_FLG / YUSEN_KO_SKVAL / YUSEN_KO_FLG_1-2 |

**Block 12** — [IF/ELSE-IF/ELSE] `Service order priority assignment — New/Change` (L1532–1575)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (("20".equals(teSvcOdrCd) || "26".equals(teSvcOdrCd)) && ("02".equals(yokyuSbtCd) || "04".equals(yokyuSbtCd)))` // Svc Order 20/26 AND Request 02 (New — 新規) or 04 (Change — 変更) |
| 2 | IF | `if (updTrnId.indexOf("EO2B20160J0") >= 0 || updTrnId.indexOf("EO2IR0110J0") >= 0)` // Update transaction ID contains machine release registration ID or transfer-completion device inheritance ID |
| 2.1 | SET | `template.set(SVC_ORDER_DTAIL_CD, "01")` // Service order detail code = "01" (Low priority — 低) [-> "01" = 低 = Low priority] |
| 3 | ELSE | |
| 4 | IF | `odrChkFlg = (Boolean)telSvcOrderInfo.get(ODR_CHK_FLG)` |
| 5 | IF | `if (odrChkFlg)` |
| 5.1 | SET | `template.set(SVC_ORDER_DTAIL_CD, "01")` // Low priority to prevent priority override [-> "01" = 低 = Low priority] |
| 5.2 | ELSE | `template.set(SVC_ORDER_DTAIL_CD, "02")` // High priority [-> "02" = 高 = High priority] |

**Block 13** — [ELSE-IF/ELSE] `Service order priority assignment — Cancel/Deregister` (L1577–1600)

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (("20".equals(teSvcOdrCd) || "26".equals(teSvcOdrCd)) && ("03".equals(yokyuSbtCd) || "08".equals(yokyuSbtCd)))` // Svc Order 20/26 AND Request 03 (Cancel — 解約) or 08 (Delete — 消去) |
| 2 | IF | `if (isHenpinToroku(updTrnId))` // Update transaction ID contains return registration ID |
| 2.1 | SET | `template.set(SVC_ORDER_DTAIL_CD, "02")` // High priority [-> "02" = 高 = High priority] |
| 3 | ELSE-IF | `else if (odrDtlCd != null)` // Order detail code is provided (address change confirmation) |
| 3.1 | SET | `template.set(SVC_ORDER_DTAIL_CD, odrDtlCd)` // Use the provided order detail code directly |
| 4 | ELSE | `template.set(SVC_ORDER_DTAIL_CD, "01")` // Default to Low priority [-> "01" = 低 = Low priority] |
| 5 | ELSE | (all other cases — default) |
| 5.1 | SET | `template.set(SVC_ORDER_DTAIL_CD, "01")` // Default to Low priority |

**Block 14** — [IF] `Anshin HCS fields for multi-function router` `TELSVC_ORDER_CD == "26"` (L1600–1640)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if ("26".equals(teSvcOdrCd))` // Service code "26" = Multi-Function Router Setup |
| 2 | SET | `template.set(ANSN_HCS_KEI_1_CHGUM, convBlankToNull(...ANSN_HCS_KEI_1_CHGUM))` // Anshin HCS contract #1 change flag |
| 3 | SET | `template.set(ANSN_HCS_KEI_1, convBlankToNull(...ANSN_HCS_KEI_1))` // Anshin HCS contract #1 |
| 4 | SET | `template.set(ANSN_HCS_ID_1_CHGUM, convBlankToNull(...ANSN_HCS_ID_1_CHGUM))` // Anshin HCS ID #1 change flag |
| 5 | SET | `template.set(ANSN_HCS_ID_1, convBlankToNull(...ANSN_HCS_ID_1))` // Anshin HCS ID #1 |
| 6 | SET | `template.set(AREACD_1_CHGUM, convBlankToNull(...AREACD_1_CHGUM))` // Area code #1 change flag |
| 7 | SET | `template.set(AREACD_1, convBlankToNull(...AREACD_1))` // Area code #1 |
| 8–12 | SET | Same pattern for #2: ANSN_HCS_KEI_2_CHGUM, ANSN_HCS_KEI_2, ANSN_HCS_ID_2_CHGUM, ANSN_HCS_ID_2, AREACD_2_CHGUM, AREACD_2 |

**Block 15** — [IF] `ENUM fields` `TELSVC_ORDER_CD == "28"` (L1642–1655)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if ("28".equals(teSvcOdrCd))` // Service code "28" = ENUM Setup |
| 2 | SET | `template.set(TELNO, convBlankToNull(...TELNO))` // Telephone number |
| 3 | SET | `template.set(NW_ROUTING_NO, convBlankToNull(...NW_ROUTING_NO))` // Network routing number |
| 4 | SET | `template.set(SVC_DIV, convBlankToNull(...SVC_DIV))` // Service division |
| 5 | SET | `template.set(DOMAIN, convBlankToNull(...DOMAIN))` // Domain |

**Block 16** — [RETURN] `Final assembly` (L1657)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editInMsgCmn(param, template)` // Finalize and return S/I info |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `telSvcOrderInfo` | Field | Telephone service order info — the central data container holding all telephone service order fields (contract numbers, network settings, SIP/VOIP settings, device info, etc.) |
| `updTrnId` | Field | Update transaction ID — identifies the source screen/work transaction; used for SOD priority determination |
| `odrDtlCd` | Field | Order detail code — override value for service order detail code used in address change confirmation scenarios |
| `TELSVC_ORDER_CD` / `TSOI_TEL_SVC_ORDER_CD` | Field | Telephone service order code — classifies the type of telephone service (20 = OLS, 26 = Multi-Function Router, 28 = ENUM) |
| `YOKYU_SBT_CD` / `TSOI_YOKYU_SBT_CD` | Field | Request type code — classifies the request type (02 = New — 新規, 03 = Cancel — 解約, 04 = Change — 変更, 08 = Delete — 消去) |
| `SVC_ORDER_DTAIL_CD` | Field | Service order detail code — priority indicator ("01" = Low — 低, "02" = High — 高) |
| `ODR_CHK_FLG` | Field | Order check flag — boolean flag that, when true, forces Low priority to prevent priority override |
| SOD | Acronym | Service Order Data — the telecom order fulfillment data pipeline |
| OLS | Business term | Optical Line System — fiber optic line service (service code "20") |
| ENUM | Acronym | E.164 Number Mapping — protocol for mapping telephone numbers to IP addresses (VoIP) |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband service |
| SIP | Acronym | Session Initiation Protocol — signaling protocol for VoIP sessions |
| VA (VA-NINSHO_KEY) | Acronym | Virtual Authentication — authentication key for virtual account access |
| TAKINORT | Business term | Multi-function router (多機能ルータ) — broadband router with multiple functions |
| PPPoE | Acronym | Point-to-Point Protocol over Ethernet — broadband authentication protocol |
| VoIP | Acronym | Voice over IP — voice communication over IP networks |
| B2BUA | Acronym | Back-to-Back User Agent — SIP proxy server architecture |
| BAS-ID | Business term | Broadband Access Server ID — network equipment identifier for broadband access |
| ANSHIN_HCS_KEI | Business term | Anshin Incoming Call Contract (安心着信契約) — premium caller ID notification with voice announcement service |
| AREACD | Business term | Area code — telephone area code associated with Anshin service |
| HTB_TCHI_FLG | Field | Number notification flag (番号通知フラグ) — flag controlling telephone number display to recipients |
| HTB_DSP_KEI_FLG | Field | Number display contract flag (番号表示契約フラグ) — flag for number display service contract |
| KOTNMT_SKBT_NO | Field | Sub-device identification number (子端末識別番号) — identifier for secondary/child devices (up to 10) |
| ITNTOKI_ADD_CD / ITNTOKI_SBT_CD | Field | Port forwarding token registration/type code — port forwarding configuration identifiers |
| EMG_* | Field | Emergency contact information (緊急通報用) — emergency notification contact fields including name, phone, address |
| NINSHO_ID | Field | Authentication ID (認証ID) — user authentication identifier |
| NINSHO_ID_PWD | Field | Authentication ID password (認証IDパスワード) — password for authentication ID |
| SIP_DN | Field | SIP Directory Number — SIP endpoint number |
| SIP_NRN | Field | SIP Number Representation — SIP number representation data |
| IP_AD | Field | IP address (IPアドレス) |
| NETMASK | Field | Network mask (ネットマスク) |
| VLAN_ID | Field | Virtual LAN identifier |
| SVC_KEI_NO | Field | Service contract number (サービス契約番号) |
| SVC_KEI_UCWK_NO | Field | Service contract detail number (サービス契約内訳番号) |
| DAIHYO_AD | Field | Representative address (代表アドレス) — primary IP address |
| DAIHYO_TELNO | Field | Representative telephone number (代表電話番号) — primary contact number |
| TENSO_TEL_KEI_FLG | Field | Call forwarding contract flag (転送電話契約フラグ) |
| STI_KO_TENSO_KEI_FLG | Field | Designated call forwarding contract flag (指定呼転送契約フラグ) |
| HITCHI_KYOHI_KEI_FLG | Field | Non-notification rejection contract flag (非通知拒否契約フラグ) |
| MWKTEL_KYOHI_KEI_FLG | Field | Confusion telephone rejection contract flag (迷惑電話拒否契約フラグ) |
| STINO_INCMHI_KEI_FLG | Field | Designated number incoming rejection contract flag (指定番号着信拒否契約フラグ) |
| TKNRT_RTR_NSID | Field | Multi-function router router authentication ID (多機能ルータルータ認証ID) |
| TKNRT_OLS_KSBT_SETCD | Field | Multi-function router OLS contract type setting code |
| IPV6_TAIIKI_CTRL_CD | Field | IPv6 zone control code (IPv6帯域制御コード) |
| IPV6_CHUSKK_CD | Field | IPv6 core network code (IPv6中心局コード) |
| GEPON_RNKI_TRGT_FLG | Field | GE-PON integration target flag (GE-PON連携対象フラグ) |
| YUSEN_KO_SKVAL | Field | Priority identification value (優先呼識別値) |
| CAANMsg | Technical | Fujitsu message template class — strongly typed message container for CBS communication |
| ESC0051D010CBSMsg | Technical | CBS message class defining all fields for the telephone service order message (ESC = External Service Contract) |
| editInMsgCmn | Method | Common message finalization — combines template with request parameters and returns S/I output |
| editInMsgBasicCmn | Method | Common message basic setup — initializes shared baseline fields across all message builders |
| fillCAANMSGNullMapping | Method | Null-value mapping initialization — ensures all template fields have proper null defaults |
| convBlankToNull | Method | Data utility — converts empty string to null |
| convNullToBlank | Method | Data utility — converts null to empty string |
| isHenpinToroku | Method | Returns true if `updTrnId` contains return registration IDs (EO50D0210J0, DKW00303, DKW02902) |
| editOlsTerms4FatRouterSet | Method | Helper for multi-function router field mapping — handles SIP/VA auth fields differently for new vs. change orders |
| callSvcInter | Method | Service component invoker — calls CBS service components via the service component request framework |
| editInMsgEKK1081B001 | Method | Builds EKK1081B001 message for order release condition check before ESC0051D010 |
| executeSodSend | Method | Orchestrator — main method that iterates over order info lists, builds messages, and dispatches them |
