# Business Logic — JKKEmgRrksNmUpdCC.execute() [207 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKEmgRrksNmUpdCC` |
| Layer | CC / Common Component (Custom business component shared across screens) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKEmgRrksNmUpdCC.execute()

This method performs **emergency contact name synchronization** for customer contracts within the telecom service management domain. When customer information (name and phonetic name/kana) changes in the customer master, this component propagates those updates to all associated service contract lines that serve as emergency contact targets. The method follows a **delegation with routing** pattern: it first resolves the customer's authoritative name and kana from the customer master, then iterates over every service contract line belonging to that customer, retrieving each line's emergency contact names and comparing them against the master data. Where a discrepancy is detected, the method optionally validates a reactivation eligibility period (for contracts that have been disconnected or cancelled) before issuing a Service Order Data (SOD) request to record the service contract change in the downstream order fulfillment system.

The method handles four distinct service states: (1) active contracts — immediately propagate name changes and issue SOD; (2) suspended contracts — validate reactivation eligibility before proceeding; (3) DSL disconnected contracts — apply the same reactivation check; (4) cancelled contracts — likewise validate before updating. The design implements a **gate-and-route** pattern where the service contract line status determines whether an additional business rule check (`dslYmdKaihkPsbPrdCheck`) is applied, ensuring that emergency contact updates on reactivated contracts respect contractual reactivation windows.

As a shared common component, this method is called from multiple screen-level controllers including customer addition/branch registration, address information changes, reservation handling, and billing updates — making it a central synchronization point for customer name consistency across the service contract hierarchy.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["Start: execute(params)"])
    GET_MAP["Get ccMsg from param.getData(fixedText)"]
    INIT["Initialize: sysid, idoDiv, ck0011CustNm, ck0011CustKana"]

    GET_SYSID["Get sysid and idoDiv from ccMsg"]
    GET_MSKM["Get mskmDtlNoPram from ccMsg"]

    CALL_EKK0081B004["CALL: getEkk0081B004(handle, sysid, FUNC_CD_1)"]
    CHECK_EKK0081B004["eckk0081b004List != null && size > 0"]

    CALL_ECK0011A010["CALL: getEck0011a010(handle, sysid, FUNC_CD_2)"]
    CHECK_ECK0011A010["eck0011a010List != null && size > 0"]

    GET_CUST_INFO["Get cust_nm, cust_kana from eck0011a010Map"]
    EDIT_CUST_NM["editStrLength(ck0011CustNm, 20)"]

    CONVERT_KANA_HALF["convertHalf(ck0011CustKana)"]
    GET_CHAR_37["getChar(custKanaHalf, 37)"]
    CHECK_HANGING["custKanaHalfLastChar is full-width half dot or half dot"]
    EDIT_KANA_35["editStrLength(custKanaHalf, 35)"]
    EDIT_KANA_36["editStrLength(custKanaHalf, 36)"]
    CONVERT_KANA_FULL["convertFull(custKanaHalf)"]

    OUTER_LOOP_START["Outer loop: i = 0 to ekk0081b004List.size"]
    GET_TRGT_SVC["Get trgtTelSvcKeiNo from ekk0081b004Map"]

    CALL_EKK0191B001["CALL: getEkk0191b001(handle, trgtSvcKeiNo, FUNC_CD_4)"]
    CHECK_EKK0191B001["ekk0191b001List != null && size > 0"]

    INNER_LOOP_START["Inner loop: j = 0 to ekk0191b001List.size"]
    GET_SVC_UCWK_INFO["Get svc_kei_ucwk_no, svc_kei_ucwk_stat"]
    CHECK_STATUS["svc_kei_ucwk_stat >= STP or DSL_ZM or CANCEL_ZM"]

    CALL_EKK0191A010["CALL: getEkk0191a010(handle, svc_ucwk_no, FUNC_CD_4)"]
    CHECK_EKK0191A010["ekk0191a010List != null && size > 0"]

    GET_EMG_INFO["Get emg_ksh_nm, emg_ksh_kana"]
    CMP_NAMES["ck0011CustNm != trgtEmgShNm OR ck0011CustKana != trgtEmgShKana"]

    CALL_EKK0161A010["CALL: getEkk0161a010(handle, svc_ucwk_no, gene_add_dtm, FUNC_CD_1)"]
    DSL_CHECK["Is DSL_ZM or CANCEL_ZM?"]
    CALL_DSL_CHECK["CALL: dslYmdKaihkPsbPrdCheck(handle, svc_ucwk_stat, map)"]
    CHECK_DSL_RESULT["dslYmdKaihkPsbPrdCheck returns false"]
    DO_CONTINUE["continue inner loop"]

    CALL_EKK0191C060["CALL: getEkk0191c060(handle, ekk0161a010Map, ekk0191a010Map, ck0011CustNm, ck0011CustKana, idoDiv, FUNC_CD_1)"]
    NOT_DSL_CANCEL["Is NOT DSL_ZM AND NOT CANCEL_ZM?"]

    PREP_SOD_DATA["Prepare hakkoSodCcTrgtData: put trgtDataList, funcCode"]
    SOD_BUILD["Build sodMap: sysid, idoDiv, svcKeiNo, svc_ucwk_info"]
    CALL_HAKKOSOD["CALL: JKKHakkoSODCC.hakkoSOD(handle, param, hakkoSodCcTrgtData)"]

    END_LOOP_OUTER["End outer loop iteration"]
    END_LOOP_INNER["End inner loop iteration"]
    EXCEPT_BLOCK["Catch: JSYejbLog.printStackTrace"]
    END_NODE(["Return param"])

    START --> GET_MAP --> INIT --> GET_SYSID --> GET_MSKM --> CALL_EKK0081B004 --> CHECK_EKK0081B004
    CHECK_EKK0081B004 -- true --> CALL_ECK0011A010 --> CHECK_ECK0011A010
    CHECK_ECK0011A010 -- true --> GET_CUST_INFO --> EDIT_CUST_NM --> CONVERT_KANA_HALF --> GET_CHAR_37 --> CHECK_HANGING
    CHECK_HANGING -- true --> EDIT_KANA_35 --> CONVERT_KANA_FULL
    CHECK_HANGING -- false --> EDIT_KANA_36 --> CONVERT_KANA_FULL
    CHECK_EKK0081B004 -- false --> END_NODE
    CHECK_ECK0011A010 -- false --> END_NODE
    CONVERT_KANA_FULL --> OUTER_LOOP_START
    OUTER_LOOP_START --> GET_TRGT_SVC --> CALL_EKK0191B001 --> CHECK_EKK0191B001
    CHECK_EKK0191B001 -- true --> INNER_LOOP_START
    CHECK_EKK0191B001 -- false --> END_NODE
    INNER_LOOP_START --> GET_SVC_UCWK_INFO --> CHECK_STATUS
    CHECK_STATUS -- true --> CALL_EKK0191A010 --> CHECK_EKK0191A010
    CHECK_EKK0191A010 -- true --> GET_EMG_INFO --> CMP_NAMES
    CMP_NAMES -- true --> CALL_EKK0161A010 --> DSL_CHECK
    DSL_CHECK -- true --> CALL_DSL_CHECK --> CHECK_DSL_RESULT
    CHECK_DSL_RESULT -- true --> CALL_EKK0191C060 --> NOT_DSL_CANCEL
    CHECK_DSL_RESULT -- false --> DO_CONTINUE --> END_LOOP_INNER --> INNER_LOOP_START
    CHECK_STATUS -- false --> END_LOOP_INNER --> INNER_LOOP_START
    DO_CONTINUE --> END_LOOP_INNER --> INNER_LOOP_START
    CALL_EKK0191A010 -- false --> END_LOOP_INNER --> INNER_LOOP_START
    CMP_NAMES -- false --> END_LOOP_INNER --> INNER_LOOP_START
    NOT_DSL_CANCEL -- true --> PREP_SOD_DATA --> SOD_BUILD --> CALL_HAKKOSOD --> END_LOOP_OUTER --> OUTER_LOOP_START
    NOT_DSL_CANCEL -- false --> END_LOOP_OUTER --> OUTER_LOOP_START
    END_NODE --> EXCEPT_BLOCK --> END_NODE
```

**Branch Summary:**

| Step | Condition | Actual Value | Business Meaning |
|------|-----------|-------------|------------------|
| Status gate | `trgtSvcKeiUcwkStat >= CD00037_STAT_STP` | `CD00037_STAT_STP` = "Suspended" status code | Only process contracts that are suspended or worse (disconnected/cancelled) |
| Status gate | `trgtSvcKeiUcwkStat == CD00037_DSL_ZM` | `CD00037_DSL_ZM` = "DSL disconnected" status | DSL service has been disconnected |
| Status gate | `trgtSvcKeiUcwkStat == CD00037_CANCEL_ZM` | `CD00037_CANCEL_ZM` = "Cancelled" status | Service contract has been cancelled |
| Recalc check | `dslYmdKaihkPsbPrdCheck` | — | Validates whether the service is within the reactivation-possible period for disconnected/cancelled contracts |
| Name change | `ck0011CustNm != trgtEmgKshNm || ck0011CustKana != trgtEmgKshKana` | — | Customer master name differs from emergency contact name stored on the contract line |
| Name length | `editStrLength(ck0011CustNm, 20)` | 20 chars | Emergency contact name is capped at 20 characters |
| Name length | `editStrLength(custKanaHalf, 35 or 36)` | 35 chars (if trailing full/half-width dot) or 36 chars | Emergency contact kana is capped at 36 characters (35 if trailing special character) |
| SOD trigger | NOT DSL_ZM AND NOT CANCEL_ZM | — | SOD is NOT issued for disconnected or cancelled contracts; only for active/suspended contracts |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle providing transaction and connection context. Carries the database session for all SC (Service Component) calls, including data retrieval and SOD issuance. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter container that holds all data exchanged between the caller screen/controller and the business component. It is populated with customer name mapping data (via `fixedText` key), SOD target data (`hakko_sod_cc_trgt_data`), and returned to the caller after processing. |
| 3 | `fixedText` | `String` | Service message key used as a map key to retrieve and store data within the `param` container. This identifies the specific message mapping block (e.g., `"JKKEmgRrksNmUpdCC"`). Used to access `ccMsg` (customer info mapping) and to set `hakko_sod_cc_trgt_data`. |

**Instance fields / external state read:**

| Field / Source | Usage |
|----------------|-------|
| `JPCModelConstant.FUNC_CD_1` through `FUNC_CD_4` | Functional code constants used to distinguish between different query modes across the SC calls (customer master, service contract list, service contract detail, service contract agreement). |
| `JKKStrConst.CD00037_STAT_STP` | Minimum status code threshold — only contracts at suspended status or below are processed. |
| `JKKStrConst.CD00037_DSL_ZM` | DSL disconnected status code — triggers reactivation period check. |
| `JKKStrConst.CD00037_CANCEL_ZM` | Cancelled status code — triggers reactivation period check. |
| `JKKHakkoSODConstCC` constants | Keys used to build the SOD target data map: `TRGT_DATA_LIST`, `INFO_SYSID`, `IDO_DIV_HTELNOINFOCHGE`, `SOD_KIHON_INFO`, `SVC_KEI_INFO`, `OPSVKEI_INFO`, `SVC_KEI_UCWK_INFO`, `INFO_SVC_KEI_NO`, `INFO_CHBF_SVC_KEI_UCWK_GENE_ADD_DTM`, `INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM`. |
| `JCMConstants.FUNC_CODE_KEY` | Key for storing the function code in the SOD target data. |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getEkk0081B004` | EKK0081B004 | EKK0081B004 (Service Contract List per SYSID) | Retrieves the list of service contracts associated with the customer SYSID. Used for service contract line iteration. |
| R | `getEck0011a010` | ECK0011A010 | ECK0011A010 (Customer Single Inquiry) | Retrieves customer master data including name (cust_nm) and phonetic name (cust_kana) by SYSID. Source of authoritative customer names. |
| R | `getEkk0191b001` | EKK0191B001 | EKK0191B001 (Service Contract Detail per Service Contract No.) | Retrieves detailed service contract lines for a given target service contract number. Provides svc_kei_ucwk_no and svc_kei_ucwk_stat for each line. |
| R | `getEkk0191a010` | EKK0191A010 | EKK0191A010 (Service Contract Agreement Inquiry) | Retrieves emergency contact names (emg_ksh_nm, emg_ksh_kana) and generation timestamp from the service contract agreement. |
| R | `getEkk0161a010` | EKK0161A010 | EKK0161A010 (Service Contract Agreement Detail with Gene) | Retrieves detailed service contract agreement data including gene_add_dtm, used for SOD build and reactivation check. |
| U | `getEkk0191c060` | EKK0191C060 | EKK0191C060 (Service Contract Change Data) | Assembles the service contract change data map with updated emergency contact names. Produces gene_add_dtm for the changed record. |
| C | `JKKHakkoSODCC.hakkoSOD` | N/A (SOD Issuance Component) | SOD (Service Order Data) | Issues a new Service Order Data record to trigger downstream service contract change processing. Not a direct DB insert — delegates to JKKHakkoSODCC.hakkoSOD(). |
| U | `dslYmdKaihkPsbPrdCheck` | N/A (Internal Check) | N/A | Validates whether a disconnected or cancelled contract is within its reactivation-possible period. Returns true if update should proceed. |
| U | `editStrLength` | N/A (Internal Utility) | N/A | String length editing utility — truncates customer name to specified length. |
| R | `getChar` | N/A (Internal Utility) | N/A | Extracts a character at a given position from a string — used for checking the 37th character of kana. |
| - | `JKKStringConverter.convertHalf` | N/A (Utility) | N/A | Converts full-width characters to half-width (used before kana length calculation). |
| - | `JKKStringConverter.convertFull` | N/A (Utility) | N/A | Converts half-width characters back to full-width (used after kana length calculation). |
| - | `JKKStringUtil.nullToBlank` | N/A (Utility) | N/A | Null-safe string conversion — replaces null with empty string. |
| - | `JKKCommonUtil.isNull` | N/A (Utility) | N/A | Null check utility — returns true if the object is null or empty. |

## 5. Dependency Trace

Direct callers found: 5 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JCKCustAddBnktUpdCC` (Customer Addition - Branch) | `JCKCustAddBnktUpdCC.execute()` → creates `JKKEmgRrksNmUpdCC` instance → `execute(handle, param, "JKKEmgRrksNmUpdCC")` | `getEkk0081B004 [R]`, `getEck0011a010 [R]`, `getEkk0191b001 [R]`, `getEkk0191a010 [R]`, `getEkk0161a010 [R]`, `getEkk0191c060 [U]`, `hakkoSOD [C]` |
| 2 | `JKKAdInfChgCC` (Address Information Change) | `JKKAdInfChgCC.kshAdUpd()` → creates `JKKEmgRrksNmUpdCC` instance → `execute(keepSesHandle.get(), param, "JKKEmgRrksNmUpdCC")` | `getEkk0081B004 [R]`, `getEck0011a010 [R]`, `getEkk0191b001 [R]`, `getEkk0191a010 [R]`, `getEkk0161a010 [R]`, `getEkk0191c060 [U]`, `hakkoSOD [C]` |
| 3 | `JKKIdoRsvHanei` (Installation Reservation Handling) | `JKKIdoRsvHanei.callJKKEmgRrksNmUpdCC()` → invokes `execute()` | `getEkk0081B004 [R]`, `getEck0011a010 [R]`, `getEkk0191b001 [R]`, `getEkk0191a010 [R]`, `getEkk0161a010 [R]`, `getEkk0191c060 [U]`, `hakkoSOD [C]` |
| 4 | `JKKKeiHimoUpdCC` (Billing Amount Update) | `JKKKeiHimoUpdCC.JKKEmgRrksNmUpdCC()` → creates instance → `execute(handle, param, "JKKEmgRrksNmUpdCC")` | `getEkk0081B004 [R]`, `getEck0011a010 [R]`, `getEkk0191b001 [R]`, `getEkk0191a010 [R]`, `getEkk0161a010 [R]`, `getEkk0191c060 [U]`, `hakkoSOD [C]` |
| 5 | `JKKKeiHimoUpdShosaMaeCC` (Billing Amount Update - Pre-Inspection) | `JKKKeiHimoUpdShosaMaeCC.JKKEmgRrksNmUpdCC()` → creates instance → `execute(handle, param, "JKKEmgRrksNmUpdCC")` | `getEkk0081B004 [R]`, `getEck0011a010 [R]`, `getEkk0191b001 [R]`, `getEkk0191a010 [R]`, `getEkk0161a010 [R]`, `getEkk0191c060 [U]`, `hakkoSOD [C]` |
| 6 | `JCKKeishaChgOrsCC` (Company Change - Alternate) | `JCKKeishaChgOrsCC` → `new JKKEmgRrksNmUpdCC().execute(handle, param, EMG_RRK_SNM_UPD_CC_MAP)` | `getEkk0081B004 [R]`, `getEck0011a010 [R]`, `getEkk0191b001 [R]`, `getEkk0191a010 [R]`, `getEkk0161a010 [R]`, `getEkk0191c060 [U]`, `hakkoSOD [C]` |

**Call chains from entry points to terminal operations:**

```
Screen/Controller.execute()
  └── new JKKEmgRrksNmUpdCC().execute(handle, param, fixedText)
        └── getEkk0081B004() [R] — Service Contract List
        └── getEck0011a010() [R] — Customer Master
        └── getEkk0191b001() [R] — Service Contract Detail
        └── getEkk0191a010() [R] — Service Contract Agreement
        └── getEkk0161a010() [R] — Service Contract Agreement Detail
        └── dslYmdKaihkPsbPrdCheck() [U] — Reactivation Period Check
        └── getEkk0191c060() [U] — Service Contract Change Data
        └── JKKHakkoSODCC.hakkoSOD() [C] — SOD Issuance (Create)
```

## 6. Per-Branch Detail Blocks

**Block 1** — TRY-CATCH (L116)

> Wraps the entire processing logic in an exception handler. All SC calls and data manipulation occur within this block. Exceptions are logged via `JSYejbLog.printStackTrace` but not re-thrown, ensuring the method always returns `param`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMsg = (Map<String, Object>) param.getData(fixedText)` // Retrieve customer info mapping from param [-> FIXED_TEXT_MAP_KEY] |
| 2 | SET | `sysid = ""` // Initialize SYSID [-> EMPTY_STRING] |
| 3 | SET | `idoDiv = ""` // Initialize service division [-> EMPTY_STRING] |
| 4 | SET | `ck0011CustNm = ""` // Initialize customer name for emergency contact [-> EMPTY_STRING] |
| 5 | SET | `ck0011CustKana = ""` // Initialize kana name for emergency contact [-> EMPTY_STRING] |
| 6 | SET | `mskmDtlNoPram = JKKStringUtil.nullToBlank((String) ccMsg.get("mskm_dtl_no"))` // Service contract detail number — retrieved but noted as unnecessary to update since it is already updated by the service contract list (calendar) application |

**Block 2** — CALL: Service Contract List per SYSID (L140)

> Retrieves the list of service contracts associated with the customer SYSID. This is the first SC call that determines the iteration scope.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081b004List = new ArrayList<HashMap<String, Object>>()` // Initialize empty list [-> EMPTY_LIST] |
| 2 | CALL | `ekk0081b004List = getEkk0081B004(handle, param, fixedText, sysid, JPCModelConstant.FUNC_CD_1)` // [R] EKK0081B004 — Get service contracts by SYSID |

**Block 3** — IF: Service Contract List Has Data (L142) `[EKK0081B004_RETURNS_DATA]` (L142)

> Guard condition: only proceed if at least one service contract exists for this SYSID.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `!JKKCommonUtil.isNull(ekk0081b004List) && ekk0081b004List.size() > 0` // Check list is non-null and has records |

**Block 4** — CALL: Customer Master Inquiry (L146)

> Retrieves the authoritative customer name and phonetic name (kana) from the customer master table using SYSID. This is the source of truth for customer identity.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eck0011a010List = new ArrayList<HashMap<String, Object>>()` // Initialize empty list [-> EMPTY_LIST] |
| 2 | CALL | `eck0011a010List = getEck0011a010(handle, param, fixedText, sysid, JPCModelConstant.FUNC_CD_2)` // [R] ECK0011A010 — Customer single inquiry by SYSID |

**Block 5** — IF: Customer Master Has Data (L148) `[ECK0011A010_RETURNS_DATA]` (L148)

> Guard condition: customer master returned data. Only then extract names.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `!JKKCommonUtil.isNull(eck0011a010List) && eck0011a010List.size() > 0` // Check customer data available |

**Block 6** — SET: Extract Customer Names (L152)

> Extracts raw customer name and kana from the first record of the customer master result.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eck0011a010Map = eck0011a010List.get(0)` // Take first (only) customer record |
| 2 | SET | `ck0011CustNm = JKKStringUtil.nullToBlank((String) eck0011a010Map.get("cust_nm"))` // [R] Customer name from master |
| 3 | SET | `ck0011CustKana = JKKStringUtil.nullToBlank((String) eck0011a010Map.get("cust_kana"))` // [R] Customer kana from master |

**Block 7** — SET: Truncate Customer Name (L162) `[IT1-2018-0000169 ADD]`

> Emergency contact name cannot exceed 20 characters. Truncate the customer name to 20 chars as the emergency contact target.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ck0011CustNm = editStrLength(ck0011CustNm, 20)` // [U] Truncate to 20 chars — per IT1-2018-0000169 |

**Block 8** — SET: Truncate Kana Name (L166) `[OM-2020-0001133 MOD]`

> Emergency contact kana cannot exceed 36 characters. Full-width to half-width conversion is performed first (since full-width characters count as 1 char in half-width but would be 2 bytes). If the 37th character is a full-width half dot (ﾞ) or half dot (ﾟ), truncate to 35 chars instead to account for the byte expansion when converting back to full-width.

| # | Type | Code |
|---|------|------|
| 1 | SET | `custKanaHalf = JKKStringConverter.convertHalf(ck0011CustKana)` // Convert to half-width for accurate counting |
| 2 | SET | `custKanaHalfLastChar = getChar(custKanaHalf, 37)` // Get 37th character (index 37 = position 37) |
| 3 | EXEC | `!"".equals(custKanaHalfLastChar) && ("ﾞ".equals(custKanaHalfLastChar) || "ﾟ".equals(custKanaHalfLastChar))` // Check if 37th char is full-width half dot or half dot |

**Block 8.1** — IF: Kana 37th Char is Full/Half-Width Dot (L172)

> When the trailing character is a special dot, truncating to 36 would cause the full-width conversion to expand beyond 36 visible characters. Use 35 as the safe truncation limit.

| # | Type | Code |
|---|------|------|
| 1 | SET | `custKanaHalf = editStrLength(custKanaHalf, 35)` // [U] Truncate to 35 chars |

**Block 8.2** — ELSE: Normal Case (L176)

| # | Type | Code |
|---|------|------|
| 1 | SET | `custKanaHalf = editStrLength(custKanaHalf, 36)` // [U] Truncate to 36 chars |

**Block 8.3** — SET: Convert Back to Full-Width (L180)

| # | Type | Code |
|---|------|------|
| 1 | SET | `ck0011CustKana = JKKStringConverter.convertFull(custKanaHalf)` // [U] Convert truncated half-width back to full-width |

**Block 9** — OUTER FOR LOOP: Iterate Over Service Contracts (L185)

> Iterates over each service contract line found in the service contract list (per SYSID). For each contract line, retrieves the target service contract number and processes its details.

| # | Type | Code |
|---|------|------|
| 1 | SET | `i = 0; i < ekk0081b004List.size(); i++` // Outer loop index |
| 2 | SET | `ekk0081b004Map = new HashMap<String, Object>()` // Initialize map [-> EMPTY_MAP] |
| 3 | SET | `ekk0081b004Map = ekk0081b004List.get(i)` // Get i-th service contract record |
| 4 | SET | `trgtTelSvcKeiNo = JKKStringUtil.nullToBlank((String) ekk0081b004Map.get("trgt_svc_kei_no"))` // Target service contract number |

**Block 10** — CALL: Service Contract Detail List (L190)

> Retrieves all service contract detail lines for a given service contract number. Each line has its own status and emergency contact configuration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0191b001List = new ArrayList<HashMap<String, Object>>()` // Initialize empty list [-> EMPTY_LIST] |
| 2 | CALL | `ekk0191b001List = getEkk0191b001(handle, param, fixedText, trgtTelSvcKeiNo, JPCModelConstant.FUNC_CD_4)` // [R] EKK0191B001 — Service contract detail list by service contract number |

**Block 11** — IF: Service Contract Detail Has Data (L193) `[EKK0191B001_RETURNS_DATA]` (L193)

> Guard condition: this service contract has at least one detail line.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `!JKKCommonUtil.isNull(ekk0191b001List) && ekk0191b001List.size() > 0` // Check detail list has records |

**Block 12** — INNER FOR LOOP: Iterate Over Service Contract Detail Lines (L197)

> Iterates over each detail line within the service contract. Each line has its own status and emergency contact names.

| # | Type | Code |
|---|------|------|
| 1 | SET | `j = 0; j < ekk0191b001List.size(); j++` // Inner loop index |
| 2 | SET | `trgtSvcKeiUcwkNo = ""` // Initialize service contract detail work number [-> EMPTY_STRING] |
| 3 | SET | `trgtSvcKeiUcwkStat = ""` // Initialize service contract detail work status [-> EMPTY_STRING] |
| 4 | SET | `trgtEmgKshNm = ""` // Initialize emergency contact name from contract [-> EMPTY_STRING] |
| 5 | SET | `trgtEmgKshKana = ""` // Initialize emergency contact kana from contract [-> EMPTY_STRING] |
| 6 | SET | `ekk0191b001Map = ekk0191b001List.get(j)` // Get j-th detail record |
| 7 | SET | `trgtSvcKeiUcwkNo = JKKStringUtil.nullToBlank((String) ekk0191b001Map.get("svc_kei_ucwk_no"))` // Service contract detail work number |
| 8 | SET | `trgtSvcKeiUcwkStat = JKKStringUtil.nullToBlank((String) ekk0191b001Map.get("svc_kei_ucwk_stat"))` // Service contract detail work status |

**Block 13** — IF: Status Gate — Process Suspended/Disconnected/Cancelled (L203) `[STATUS_GATE]` (L203)

> Only processes detail lines where the status is at or below suspended (STP), or specifically DSL disconnected or cancelled. This ensures that only contracts in a meaningful state get their emergency contact names synchronized.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JKKStrConst.CD00037_STAT_STP.compareTo(trgtSvcKeiUcwkStat) >= 0 || JKKStrConst.CD00037_DSL_ZM.equals(trgtSvcKeiUcwkStat) || JKKStrConst.CD00037_CANCEL_ZM.equals(trgtSvcKeiUcwkStat)` // Status >= Suspended OR DSL_ZM OR CANCEL_ZM |

**Block 14** — CALL: Service Contract Agreement Inquiry (L210)

> Retrieves emergency contact names (emg_ksh_nm, emg_ksh_kana) and the generation timestamp (gene_add_dtm) from the service contract agreement for this detail line.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0191a010List = new ArrayList<HashMap<String, Object>>()` // Initialize empty list [-> EMPTY_LIST] |
| 2 | CALL | `ekk0191a010List = getEkk0191a010(handle, param, fixedText, trgtSvcKeiUcwkNo, JPCModelConstant.FUNC_CD_4)` // [R] EKK0191A010 — Service contract agreement inquiry |

**Block 15** — IF: Agreement Data Returned (L213) `[EKK0191A010_RETURNS_DATA]` (L213)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `!JKKCommonUtil.isNull(ekk0191a010List) && ekk0191a010List.size() > 0` // Check agreement data available |

**Block 16** — SET: Extract Emergency Contact Names (L217)

> Extracts the emergency contact name and kana stored on the service contract agreement.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0191a010Map = ekk0191a010List.get(0)` // Take first agreement record |
| 2 | SET | `trgtEmgKshNm = JKKStringUtil.nullToBlank((String) ekk0191a010Map.get("emg_ksh_nm"))` // [R] Emergency contact name from contract |
| 3 | SET | `trgtEmgKshKana = JKKStringUtil.nullToBlank((String) ekk0191a010Map.get("emg_ksh_kana"))` // [R] Emergency contact kana from contract |

**Block 17** — IF: Name Change Detection (L226) `[NAME_CHANGE_DETECTED]` (L226)

> Compares the customer master names (ck0011CustNm, ck0011CustKana) against the emergency contact names stored on the contract line (trgtEmgKshNm, trgtEmgKshKana). If either differs, a change needs to be propagated.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `!ck0011CustNm.equals(trgtEmgKshNm) || !ck0011CustKana.equals(trgtEmgKshKana)` // Name or kana differs between master and contract |

**Block 18** — CALL: Service Contract Agreement Detail with Gene (L230)

> Retrieves detailed service contract agreement data including the generation timestamp (gene_add_dtm), required for the SOD build and reactivation period check.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0161a010List = new ArrayList<HashMap<String, Object>>()` // Initialize empty list [-> EMPTY_LIST] |
| 2 | CALL | `ekk0161a010List = getEkk0161a010(handle, param, fixedText, trgtSvcKeiUcwkNo, JKKStringUtil.nullToBlank((String) ekk0191a010Map.get("gene_add_dtm")), JPCModelConstant.FUNC_CD_1)` // [R] EKK0161A010 — Agreement detail with gene |
| 3 | SET | `ekk0161a010Map = ekk0161a010List.get(0)` // Take first record |

**Block 18.1** — IF: Reactivation Period Check (DSL_ZM or CANCEL_ZM) (L238) `[REACTIVATION_CHECK]` (L238)

> For disconnected or cancelled contracts, validate whether the reactivation-possible period has not yet expired. If expired, skip this detail line (continue to next).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JKKStrConst.CD00037_DSL_ZM.equals(trgtSvcKeiUcwkStat) || JKKStrConst.CD00037_CANCEL_ZM.equals(trgtSvcKeiUcwkStat)` // Is DSL disconnected or cancelled? |
| 2 | CALL | `dslYmdKaihkPsbPrdCheck(handle, param, fixedText, trgtSvcKeiUcwkStat, ekk0161a010Map)` // [U] Check reactivation possible period |

**Block 18.1.1** — IF: Reactivation Check Failed (L240)

> The reactivation period has expired. Skip processing this detail line by jumping to the next iteration.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `!dslYmdKaihkPsbPrdCheck(...)` // Reactivation check returned false |
| 2 | EXEC | `continue` // Skip to next inner loop iteration |

**Block 19** — CALL: Assemble Service Contract Change Data (L250)

> Builds a data map with the updated emergency contact names, combining the old and new agreement data. This prepares the update payload for the service contract line.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0191c060Map = new HashMap<String, Object>()` // Initialize empty map [-> EMPTY_MAP] |
| 2 | CALL | `ekk0191c060Map = getEkk0191c060(handle, param, fixedText, ekk0161a010Map, ekk0191a010Map, ck0011CustNm, ck0011CustKana, idoDiv, JPCModelConstant.FUNC_CD_1)` // [U] Assemble change data |

**Block 20** — IF: SOD Issuance Decision (NOT DSL_ZM AND NOT CANCEL_ZM) (L254) `[SOD_ISSUANCE_GATE]` (L254)

> SOD (Service Order Data) is NOT issued for disconnected (DSL_ZM) or cancelled (CANCEL_ZM) contracts. Only active or suspended contracts receive an SOD to trigger downstream processing. For disconnected/cancelled contracts, only the emergency contact name is updated locally without SOD issuance.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `!(JKKStrConst.CD00037_DSL_ZM.equals(trgtSvcKeiUcwkStat) || JKKStrConst.CD00037_CANCEL_ZM.equals(trgtSvcKeiUcwkStat))` // NOT disconnected and NOT cancelled |

**Block 20.1** — SET: Prepare SOD Target Data (L261)

> Builds the data structure required by `JKKHakkoSODCC.hakkoSOD()`. The structure is a nested map containing: (a) a target data list, (b) a function code, (c) SOD basic info (sysid, division type), (d) service contract info, (e) optional service info (empty), and (f) service contract detail info (work number, before/after generation timestamps).

| # | Type | Code |
|---|------|------|
| 1 | SET | `hakkoSodCcTrgtData = new HashMap<String, Object>()` // Initialize SOD target data map [-> EMPTY_MAP] |
| 2 | SET | `trgtDataList = new ArrayList<HashMap<String, Object>>()` // Initialize empty list [-> EMPTY_LIST] |
| 3 | SET | `hakkoSodCcTrgtData.put(JKKHakkoSODConstCC.TRGT_DATA_LIST, trgtDataList)` // [-> SET_TRGT_DATA_LIST_KEY] |
| 4 | SET | `hakkoSodCcTrgtData.put(JCMConstants.FUNC_CODE_KEY, JPCModelConstant.FUNC_CD_1)` // [-> SET_FUNC_CODE_KEY, FUNC_CD_1] |
| 5 | SET | `sodMap = new HashMap<String, Object>()` // Initialize SOD map [-> EMPTY_MAP] |
| 6 | SET | `sodKihonInfo = new HashMap<String, Object>()` // Initialize SOD basic info [-> EMPTY_MAP] |
| 7 | SET | `sodKihonInfo.put(JKKHakkoSODConstCC.INFO_SYSID, sysid)` // [-> SET_SOD_SYSID] |
| 8 | SET | `sodKihonInfo.put(JKKHakkoSODConstCC.INFO_IDO_DIV, JKKHakkoSODConstCC.IDO_DIV_HTELNOINFOCHGE)` // [-> SET_SOD_DIVISION_TYPE_HTELNOINFOCHGE] |
| 9 | SET | `sodMap.put(JKKHakkoSODConstCC.SOD_KIHON_INFO, sodKihonInfo)` // Attach basic info |
| 10 | SET | `svcKeiInfo = new HashMap<String, Object>()` // Initialize service contract info [-> EMPTY_MAP] |
| 11 | SET | `svcKeiInfo.put(JKKHakkoSODConstCC.INFO_SVC_KEI_NO, trgtTelSvcKeiNo)` // [-> SET_SVC_CONTRACT_NO] |
| 12 | SET | `sodMap.put(JKKHakkoSODConstCC.SVC_KEI_INFO, svcKeiInfo)` // Attach service contract info |
| 13 | SET | `opSvcInfoMap = new HashMap<String, Object>()` // Initialize optional service info [-> EMPTY_MAP] |
| 14 | SET | `sodMap.put(JKKHakkoSODConstCC.OPSVKEI_INFO, opSvcInfoMap)` // Attach empty optional service info |
| 15 | SET | `svcKeiUcwkInfo = new HashMap<String, Object>()` // Initialize service contract detail info [-> EMPTY_MAP] |
| 16 | SET | `svcKeiUcwkInfo.put(JKKHakkoSODConstCC.INFO_SVC_KEI_UCWK_NO, trgtSvcKeiUcwkNo)` // [-> SET_SVC_KEI_UCWK_NO] |
| 17 | SET | `svcKeiUcwkInfo.put(JKKHakkoSODConstCC.INFO_CHBF_SVC_KEI_UCWK_GENE_ADD_DTM, JKKStringUtil.nullToBlank((String) ekk0191a010Map.get("gene_add_dtm")))` // [-> SET_BEFORE_CHANGE_GENE_DTM] |
| 18 | SET | `svcKeiUcwkInfo.put(JKKHakkoSODConstCC.INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM, JKKStringUtil.nullToBlank((String) ekk0191c060Map.get("gene_add_dtm")))` // [-> SET_AFTER_CHANGE_GENE_DTM] |
| 19 | SET | `sodMap.put(JKKHakkoSODConstCC.SVC_KEI_UCWK_INFO, svcKeiUcwkInfo)` // Attach service contract detail info |
| 20 | SET | `trgtDataList.add(sodMap)` // Add SOD map to target list |
| 21 | EXEC | `param.setData("hakko_sod_cc_trgt_data", hakkoSodCcTrgtData)` // Store in param container |

**Block 20.2** — CALL: SOD Issuance (L268) `[SOD_ISSUANCE]`

> Instantiates and calls the SOD issuance component. Creates a new `JKKHakkoSODCC` instance and delegates SOD creation to `hakkoSOD()`, passing the prepared data map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `hakkkoSodCc = new JKKHakkoSODCC()` // [-> NEW_JKK_HAKKOSOD_CC] |
| 2 | CALL | `hakkkoSodCc.hakkoSOD(handle, param, "hakko_sod_cc_trgt_data")` // [C] Issue SOD — triggers downstream order processing |

**Block 21** — END OF INNER FOR LOOP (L271)

> Returns to `j` loop iteration. Processing continues for the next detail line.

**Block 22** — END OF OUTER FOR LOOP (L273)

> Returns to `i` loop iteration. Processing continues for the next service contract line.

**Block 23** — CATCH: Exception Handling (L277)

> Catches any `Exception` thrown during processing. Logs the error via `JSYejbLog.printStackTrace` at ERROR level with the class context. The exception is NOT re-thrown — processing silently stops and `param` is returned as-is.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JSYejbLog.printStackTrace(JSYejbLog.ERROR, this.getClass(), e, null, null)` // Log error, do not re-throw |

**Block 24** — RETURN (L280)

> Returns the (possibly modified) `param` object to the caller.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` // Return modified request parameter container |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sysid` | Field | System ID — the unique customer identifier used to look up customer master and associated service contracts. |
| `ido_div` | Field | Installation/Service Division — classifies the type of service installation or division category. |
| `cust_nm` | Field | Customer Name — the authoritative legal name of the customer stored in the customer master (ECK0011A010). |
| `cust_kana` | Field | Customer Kana — the phonetic reading (katakana) of the customer name, used for display and emergency contact purposes. |
| `trgt_svc_kei_no` | Field | Target Service Contract Number — the identifier for a service contract line within the service contract list (EKK0081B004). |
| `svc_kei_ucwk_no` | Field | Service Contract Detail Work Number — the unique identifier for a specific service contract detail line (EKK0191B001/EKK0191A010). |
| `svc_kei_ucwk_stat` | Field | Service Contract Detail Work Status — the status code of a service contract line, determining processing eligibility (e.g., active, suspended, disconnected, cancelled). |
| `emg_ksh_nm` | Field | Emergency Contact Name — the contact name stored on the service contract line, to be synchronized with the customer master. |
| `emg_ksh_kana` | Field | Emergency Contact Kana — the phonetic reading of the emergency contact name on the service contract line. |
| `gene_add_dtm` | Field | Generation Addition Date/Time — the timestamp when the service contract agreement record was generated or last modified, used for change detection in SOD. |
| `mskm_dtl_no` | Field | Calendar/Detail Number — service contract detail number from the calendar application; noted as already updated, so not re-set here. |
| `hakko_sod_cc_trgt_data` | Field | SOD Issuance Target Data Key — the param key used to store the assembled SOD target data map for the `hakkoSOD()` call. |
| FUNC_CD_1 | Constant | Functional Code 1 — used as the query mode parameter for SC calls (customer master lookup, SOD basic info). |
| FUNC_CD_2 | Constant | Functional Code 2 — used for customer single inquiry mode. |
| FUNC_CD_4 | Constant | Functional Code 4 — used for service contract inquiry/detail mode. |
| CD00037_STAT_STP | Constant | Status code threshold for "Suspended" — contracts at or below this status are processed. |
| CD00037_DSL_ZM | Constant | DSL Disconnected status code — DSL service has been disconnected; triggers reactivation period check. |
| CD00037_CANCEL_ZM | Constant | Cancelled status code — service contract has been cancelled; triggers reactivation period check. |
| IDO_DIV_HTELNOINFOCHGE | Constant | Service Division Type: "H-TelephoneNumberInformationChange" — indicates the SOD is for telephone number / emergency contact information change. |
| TRGT_DATA_LIST | Constant | SOD Target Data List key — key in the SOD target data map for the list of SOD records. |
| INFO_SYSID | Constant | SOD Info: SYSID key — customer system ID in the SOD basic info. |
| SOD_KIHON_INFO | Constant | SOD Basic Info key — the SOD fundamental data section (sysid, division type). |
| SVC_KEI_INFO | Constant | Service Contract Info key — the service contract number section in the SOD. |
| OPSVKEI_INFO | Constant | Optional Service Info key — optional service data (set empty here). |
| SVC_KEI_UCWK_INFO | Constant | Service Contract Detail Info key — the service contract detail work section (work number, timestamps). |
| INFO_CHBF_SVC_KEI_UCWK_GENE_ADD_DTM | Constant | Before-Change Generation Date-Time — the gene_add_dtm of the original agreement record, used for change tracking. |
| INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM | Constant | After-Change Generation Date-Time — the gene_add_dtm after the update, used for change tracking. |
| SOD | Acronym | Service Order Data — an internal order record created to trigger downstream service provisioning or change processing in the telecom order fulfillment system. |
| SOD Issuance | Business term | The process of creating a Service Order Data record, which propagates the service contract change to downstream systems (installation, billing, etc.). |
| JKKHakkoSODCC | Component | SOD Issuance Common Component — the dedicated component for creating and submitting Service Order Data records. |
| Reactivation Period Check | Business term | A validation that checks whether a disconnected or cancelled contract is still within its allowable reactivation window before allowing emergency contact updates. |
| EKK0081B004 | SC Code | Service Contract List (per SYSID) — SC for retrieving service contracts associated with a customer SYSID. |
| ECK0011A010 | SC Code | Customer Single Inquiry — SC for retrieving customer master data by SYSID. |
| EKK0191B001 | SC Code | Service Contract Detail (per Service Contract No.) — SC for retrieving detail lines of a service contract. |
| EKK0191A010 | SC Code | Service Contract Agreement Inquiry — SC for retrieving emergency contact names from the service contract agreement. |
| EKK0161A010 | SC Code | Service Contract Agreement Detail with Gene — SC for retrieving full agreement detail including generation timestamps. |
| EKK0191C060 | SC Code | Service Contract Change Data — SC for assembling the data map for service contract name changes. |
| AbstractCommonComponent | Component | Base class for common business components — provides shared utility methods and the standard component lifecycle. |
| JSYejbLog | Component | Enterprise logging utility — handles error stack trace logging with level, class context, and additional data. |
| JKKStringUtil | Component | String utility component — provides null-safe operations like `nullToBlank`. |
| JKKStringConverter | Component | String conversion utility — provides full-width/half-width conversion for Japanese character handling. |
| JKKCommonUtil | Component | Common utility — provides null-check helpers like `isNull`. |
| IRequestParameterReadWrite | Interface | Request parameter data container — the standard interface for data exchange between screens and business components. |
| SessionHandle | Class | Database session handle — provides the database connection and transaction context for SC calls. |
