# Business Logic — JBSbatKKAdChgFmtcelSodUpd.execute() [167 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKAdChgFmtcelSodUpd` |
| Layer | Service |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKAdChgFmtcelSodUpd.execute()

This method is the main entry point for the **Address Change Format Cell Service Order Data (SOD) Update** batch process in K-Opticom's fiber-optic telecommunications customer base system. It handles the backend processing step triggered after a residence (address) change has been confirmed by the front-end screen (`KKSV0709`). When the residence change is finalized, this method gathers all related optional service contract lines (such as FTTH internet, telephone, and additional add-on services) belonging to the confirmed customer contract, builds a structured target data payload per service line, and dispatches it via ESB to a downstream service that performs the actual SOD update in the service order fulfillment system.

The method implements a **dual-mode routing pattern** based on the presence of the `inMap` parameter. When `inMap` is `null`, the method enters **intermediate file processing mode**: it iterates over records written to an intermediate output file (`outputInItem`), enriches each record with progress tracking data, and batch-invokes the SOD update ESB service for all qualifying records in a single call. When `inMap` is not `null`, the method enters **direct processing mode**, where it validates a single incoming record and accumulates it into the output chain for subsequent processing stages.

This service acts as an **aggregator and dispatcher** within the address change business flow — it bridges the internal K-Opticom contract management tables with the external service order data system, ensuring that every optional service contract tied to a changed address is properly notified of the new residence confirmation. The method is invoked as part of the `KKSV0709` business process (specifically via `KKSV0709OPOperation` -> `JKKAdChgFmtcelSodUpdCC.addFmtcelIdoInf`), representing the batch-side SOD update trigger for the residence change format cell flow.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute inMap, outputInItem"])
    START --> BRANCH_1{inMap == null?}

    BRANCH_1 -->|True| BRANCH_TRUE["Branch: Intermediate file processing mode"]
    BRANCH_1 -->|False| BRANCH_FALSE["Branch: Direct processing mode"]

    BRANCH_FALSE --> CHECK_VALID{isSingleCheckKKIFM266_INF1 pass?}
    CHECK_VALID -->|False| THROW_ERR["throw EKKB0090TE error"]
    CHECK_VALID -->|True| ADD_MAP["outputInItem.addOutMapList(inMap)"]
    ADD_MAP --> RETURN_OUTPUT["return outputInItem"]

    BRANCH_TRUE --> CHECK_OUTPUT{outputInItem == null or getOutMapList empty?}
    CHECK_OUTPUT -->|True| RETURN_NULL["return null"]
    CHECK_OUTPUT -->|False| INIT_LIST["trgDataList = new ArrayList()"]

    INIT_LIST --> LOOP_START["for each output map entry i"]
    LOOP_START --> EXTRACT["extract trgMap, trgSvcKeiNo, trgSvcKeiGeneAddDtm, trgKojiakNo"]
    EXTRACT --> BUILD_PRGDTM["build prgdtm from opeDate + sysDate"]
    BUILD_PRGDTM --> CALL_PRG["executeKK_T_PRG_KK_SELECT_025(trgSvcKeiNo, IDO_DIV=00020, STAT=6100, prgdtm)"]
    CALL_PRG --> SELECT_PRG["db_KK_T_PRG.selectNext()"]
    SELECT_PRG --> CHECK_PRG{prgInfo == null?}
    CHECK_PRG -->|True| THROW_PRG["throw EKKB0210CE error"]
    CHECK_PRG -->|False| GET_PRG_DTM["trgPrgDtm = prgInfo.getString(PRG_DTM)"]
    GET_PRG_DTM --> CALL_OP_SVC["executeKK_T_OP_SVC_KEI_KK_SELECT_077(OYA_KEI_SKBT=01, trgSvcKeiNo, FMTCEL, opeDate)"]

    CALL_OP_SVC --> OP_SVC_LOOP["for each opSvcKeiInfo from db_KK_T_OP_SVC_KEI.selectNext()"]
    OP_SVC_LOOP --> CALL_ADCHG["executeKK_T_ADCHG_DTL_KK_SELECT_043(opSvcKeiNo)"]
    CALL_ADCHG --> SELECT_ADCHG["db_KK_T_ADCHG_DTL.selectNext()"]
    SELECT_ADCHG --> CHECK_ADCHG{adchgFimtInfo == null?}
    CHECK_ADCHG -->|True| SKIP_ADCHG["continue (skip this record)"]
    CHECK_ADCHG -->|False| BUILD_SOD_MAP["build sodHakMap with svcKeiNo, gadtm, opSvcKeiNo, opsvkeiGadtm"]
    BUILD_SOD_MAP --> ADD_SOD_LIST["sodHakList.add(sodHakMap)"]
    ADD_SOD_LIST --> END_OP_SVC_LOOP["end opSvcKei loop"]

    SKIP_ADCHG --> END_OP_SVC_LOOP
    END_OP_SVC_LOOP --> CHECK_SOD_EMPTY{sodHakList isEmpty?}
    CHECK_SOD_EMPTY -->|True| BUILD_TARGET["build trgtData HashMap"]
    CHECK_SOD_EMPTY -->|False| BUILD_TARGET

    BUILD_TARGET --> SET_SYSID["trgtData.put(sysid, empty)"]
    SET_SYSID --> SET_SVC_NO["trgtData.put(svc_kei_no, trgSvcKeiNo)"]
    SET_SVC_NO --> SET_OP_SVC["trgtData.put(op_svc_kei_no, empty)"]
    SET_OP_SVC --> SET_IDO_DIV["trgtData.put(ido_div, IDO_DIV_ADCHG_FIX=00020)"]
    SET_IDO_DIV --> SET_PRG_DTM["trgtData.put(prg_dtm, trgPrgDtm)"]
    SET_PRG_DTM --> SET_KOJIAK["trgtData.put(kojiak_no, trgKojiakNo)"]
    SET_KOJIAK --> SET_FMTCEL_CD["trgtData.put(fmtcel_ido_dtl_cd, FMTCEL_IDO_DTL_CD_INIT=00)"]
    SET_FMTCEL_CD --> SET_SOD_LIST["trgtData.put(sod_hak_list, sodHakList)"]
    SET_SOD_LIST --> CHECK_SOD_NON_EMPTY{sodHakList not empty?}
    CHECK_SOD_NON_EMPTY -->|True| ADD_TO_LIST["trgDataList.add(trgtData)"]
    CHECK_SOD_NON_EMPTY -->|False| NO_ADD["skip add (no valid SodHak records)"]

    ADD_TO_LIST --> LOOP_END["end for loop"]
    NO_ADD --> LOOP_END
    LOOP_END --> CHECK_LIST{trgDataList not empty?}
    CHECK_LIST -->|True| BUILD_PARAM["build paramMap, inputMap, outputMap"]
    CHECK_LIST -->|False| RETURN_OUTPUT

    BUILD_PARAM --> SET_USE_CASE["paramMap.put(TELEGRAM_INFO_USECASE_ID, KKSV0709)"]
    SET_USE_CASE --> SET_OP_ID["paramMap.put(TELEGRAM_INFO_OPERATION_ID, KKSV0709OP)"]
    SET_OP_ID --> SET_FIXED_TEXT["inputMap.put(KKSV070901CC, trgDataList)"]
    SET_FIXED_TEXT --> INVOKE_ESB["JCCBatchEsbInterface.invokeService(commonItem, paramMap, inputMap, outputMap)"]
    INVOKE_ESB --> GET_RC["returnCode = outputMap.get(RETURN_CODE)"]
    GET_RC --> CHECK_RC{returnCode != SUCCESS?}
    CHECK_RC -->|True| THROW_SOD["throw EKKB0270CE error"]
    CHECK_RC -->|False| RETURN_OUTPUT
    THROW_SOD --> END_PROCESS(["End / Next"])

    RETURN_NULL --> END_PROCESS
    RETURN_OUTPUT --> END_PROCESS
```

**Conditional Branch Summary:**

| Branch | Condition | Behavior |
|--------|-----------|----------|
| Branch 1A | `inMap == null` | Intermediate file processing mode: iterates over `outputInItem.getOutMapList()`, builds enrichment data per record, and invokes the SOD update ESB service |
| Branch 1B | `inMap != null` | Direct processing mode: validates input via `isSingleCheckKKIFM266_INF1`, accumulates the map into the output chain, and returns immediately |

**Key Constant Values Resolved:**

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `IDO_DIV_ADCHG_FIX` | `"00020"` | Displacement category - Address Change / Confirmation |
| `PRG_STAT_ADCHG_FIN` | `"6100"` | Program status - Address Change Complete |
| `OYA_KEI_SKBT_CD_SVC_KEI` | `"01"` | Parent contract identification code - Service Contract |
| `FMTCEL_IDO_DTL_CD_INIT` | `"00"` | Format cell displacement detail code - Initial value |
| `USECASE_ID` | `"KKSV0709"` | Usecase ID - residence change format cell SOD update |
| `OPERATION_ID` | `"KKSV0709OP"` | Operation ID |
| `FIXED_TEXT` | `"KKSV070901CC"` | User-defined text string used as input map key for ESB payload |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | The incoming message envelope carrying business data. When `null`, it signals the **intermediate file processing mode** where records previously persisted to an intermediate output file are re-processed. When non-null, it carries a **single service contract record** for direct validation and chaining. Its presence determines the entire execution path of the method. |
| 2 | `outputInItem` | `JBSbatOutputItem` | The output item chain that holds intermediate file records. In intermediate processing mode, it provides the list of service contract records (`getOutMapList()`) to be processed. In direct processing mode, the enriched result of the current record is accumulated into it via `addOutMapList()`. |

**Instance Fields Read by the Method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_PRG` | `JBSbatSQLAccess` | Database access object for the `KK_T_PRG` (Program/Progress) table, used to query and update batch processing progress for address change confirmation |
| `db_KK_T_OP_SVC_KEI` | `JBSbatSQLAccess` | Database access object for the `KK_T_OP_SVC_KEI` (Optional Service Contract) table, used to enumerate all optional service lines tied to a parent service contract |
| `db_KK_T_ADCHG_DTL` | `JBSbatSQLAccess` | Database access object for the `KK_T_ADCHG_DTL` (Address Change Details) table, used to verify each optional service contract line has corresponding address change record |
| `super.commonItem` | `JBSbatCommonItem` | Common batch parameters carried from the batch execution context, including the operation date (`opeDate`) used for progress timestamp construction |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBatCommon.getSysDateTimeStamp` | - | - | Calls `getSysDateTimeStamp` in `JCCBatCommon` to retrieve the current system date-time stamp |
| R | `JCCBatchEsbInterface.invokeService` | - | - | Calls `invokeService` in `JCCBatchEsbInterface` to dispatch the ESB service invocation for SOD update |
| - | `JBSbatKKAdChgFmtcelSodUpd.executeKK_T_ADCHG_DTL_KK_SELECT_043` | - | - | Calls `executeKK_T_ADCHG_DTL_KK_SELECT_043` in `JBSbatKKAdChgFmtcelSodUpd` to query address change details |
| - | `JBSbatKKAdChgFmtcelSodUpd.executeKK_T_OP_SVC_KEI_KK_SELECT_077` | - | - | Calls `executeKK_T_OP_SVC_KEI_KK_SELECT_077` in `JBSbatKKAdChgFmtcelSodUpd` to query optional service contracts |
| - | `JBSbatKKAdChgFmtcelSodUpd.executeKK_T_PRG_KK_SELECT_025` | - | - | Calls `executeKK_T_PRG_KK_SELECT_025` in `JBSbatKKAdChgFmtcelSodUpd` to query/update program progress |
| - | `JBSbatKKAdChgFmtcelSodUpd.isSingleCheckKKIFM266_INF1` | - | - | Calls `isSingleCheckKKIFM266_INF1` in `JBSbatKKAdChgFmtcelSodUpd` for input validation |
| R | `JBSbatKKMansIfSksi.getMap` | - | - | Calls `getMap` in `JBSbatKKMansIfSksi` (indirect dependency from validation infrastructure) |
| R | `JBSbatKK_T_PRG.selectNext` | - | `KK_T_PRG` | Selects the next record from the Program/Progress table to retrieve the progress date-time stamp |
| R | `JBSbatKK_T_OP_SVC_KEI.selectNext` | - | `KK_T_OP_SVC_KEI` | Selects the next record from the Optional Service Contract table in a loop, iterating over all optional service lines |
| R | `JBSbatKK_T_ADCHG_DTL.selectNext` | - | `KK_T_ADCHG_DTL` | Selects the next record from the Address Change Details table for each optional service contract line |
| - | `JCCBatDateUtil.getSystemDateTime` | - | - | Calls `getSystemDateTime` in `JCCBatDateUtil` to get the system date-time for timestamp construction |
| R | `JBSbatServiceInterfaceMap.getString` | - | - | Reads string-typed fields from the service interface map (e.g., service contract number, generation date-time) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0709 | `KKSV0709OPOperation.run` -> `CCRequestBroker` -> `JKKAdChgFmtcelSodUpdCC.addFmtcelIdoInf` -> `JCCBatchEsbInterface.invokeService` -> `JBSbatKKAdChgFmtcelSodUpd.execute` | `executeKK_T_PRG_KK_SELECT_025 [R] KK_T_PRG`, `executeKK_T_OP_SVC_KEI_KK_SELECT_077 [R] KK_T_OP_SVC_KEI`, `executeKK_T_ADCHG_DTL_KK_SELECT_043 [R] KK_T_ADCHG_DTL` |

**Call Chain Details:**

- **KKSV0709** is the front-end residence change confirmation screen. The `KKSV0709OPOperation` BPM operation class defines a `CCRequestBroker` target pointing to `JKKAdChgFmtcelSodUpdCC.addFmtcelIdoInf` (the CC-layer orchestration class), which ultimately triggers the batch service `JBSbatKKAdChgFmtcelSodUpd.execute` via the ESB invocation mechanism.

- The `JBSbatKKAdChgCstScreenKidou` class (contract constant screen for residence change) contains commented-out references to `JBSbatKKAdChgFmtcelSodUpd`, suggesting it may have been a former invocation path that was deprecated but not removed.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(inMap == null)` [L176]

> Branch: Intermediate file processing mode. The input message has already been read and processed; `inMap` is null to indicate that the method should process records from the intermediate output file.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (inMap == null)` |

**Block 1.1** — [NESTED IF] `(outputInItem == null \|\| outputInItem.getOutMapList().isEmpty())` [L179]

> If there is no intermediate output, there is nothing to process. Return null to signal early termination.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (outputInItem == null \|\| outputInItem.getOutMapList().isEmpty())` |
| 2 | RETURN | `return null` |

**Block 1.2** — [PROCESSING] Initialize processing data list and loop [L184]

> Initialize the target data accumulator and iterate over each record in the intermediate output file.

| # | Type | Code |
|---|------|------|
| 1 | SET | `trgDataList = new ArrayList<HashMap<String, Object>>()` [-> Intermediate processing target list] |
| 2 | FOR | `for (int i = 0; i < outputInItem.getOutMapList().size(); i++)` [-> Iterate over all intermediate records] |

**Block 1.2.1** — [NESTED FOR BODY] Extract data per record [L187]

| # | Type | Code |
|---|------|------|
| 1 | SET | `trgMap = (JBSbatServiceInterfaceMap)outputInItem.getOutMapList().get(i)` [-> Target service interface map for current record] |
| 2 | SET | `trgSvcKeiNo = trgMap.getString(JBSbatKKIFM266.SVC_KEI_NO)` [-> Service contract number] |
| 3 | SET | `trgSvcKeiGeneAddDtm = trgMap.getString(JBSbatKKIFM266.SVC_KEI_GENE_ADD_DTM)` [-> Service contract creation registration date-time] |
| 4 | SET | `trgKojiakNo = trgMap.getString(JBSbatKKIFM266.KOJIAK_NO)` [-> Work project number (ticket/tracking ID)] |

**Block 1.2.2** — [PROCESSING] Build progress date-time and query program table [L201-L223]

> Constructs a progress date-time stamp from the operation date and current system time, queries the program progress table to set the final progress date-time for this service contract.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sysDate = JCCBatCommon.getSysDateTimeStamp()` [-> Get system date-time stamp] |
| 2 | SET | `prgdtm = super.opeDate + sysDate.substring(8)` [-> Concatenate operation date with time portion (position 8+) for progress date-time] |
| 3 | CALL | `executeKK_T_PRG_KK_SELECT_025(new String[]{trgSvcKeiNo, IDO_DIV_ADCHG_FIX="00020", PRG_STAT_ADCHG_FIN="6100", prgdtm})` [-> Query/Update program progress: Service Contract No., Displacement=Address Change/Fix, Status=Complete, Progress date-time] |
| 4 | SET | `prgInfo = db_KK_T_PRG.selectNext()` [-> Retrieve program progress record] |

**Block 1.2.2.1** — [IF] `(prgInfo == null)` [L217]

> If no program progress record exists, throw a business exception.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (prgInfo == null)` |
| 2 | EXEC | `throw new JBSbatBusinessException(JPCBatchMessageConstant.EKKB0210CE, new String[]{"Progress", "Address change confirmation progress"})` |

**Block 1.2.2.2** — [PROCESSING] Assign progress date-time [L220]

| # | Type | Code |
|---|------|------|
| 1 | SET | `trgPrgDtm = prgInfo.getString(JBSbatKK_T_PRG.PRG_DTM)` [-> Progress date-time from the program table] |

**Block 1.2.3** — [PROCESSING] Query optional service contracts and build SOD issuance list [L227-L264]

> Queries all optional service contract lines belonging to the parent service contract (where `OYA_KEI_SKBT_CD_SVC_KEI="01"`), verifies address change details exist for each, and builds the SOD (Service Order Data) issuance list that will be sent to the downstream SOD update service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodHakList = new ArrayList<HashMap<String, String>>()` [-> Format cell SOD issuance list] |
| 2 | CALL | `executeKK_T_OP_SVC_KEI_KK_SELECT_077(new String[]{OYA_KEI_SKBT_CD_SVC_KEI="01", trgSvcKeiNo, JKKStrConst.OP_SVC_CD_FMTCEL, opeDate})` [-> Query optional service contracts: Parent type=Service Contract, Service Contract No., Format Cell code, Operation date] |

**Block 1.2.3.1** — [FOR] `for (opSvcKeiInfo = db_KK_T_OP_SVC_KEI.selectNext(); opSvcKeiInfo != null; ...)` [L232]

> Iterates over all optional service contract records returned by the query.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_ADCHG_DTL_KK_SELECT_043(new String[]{opSvcKeiInfo.getString(JBSbatKK_T_OP_SVC_KEI.OP_SVC_KEI_NO)})` [-> Query address change details for this optional service contract line] |
| 2 | SET | `adchgFimtInfo = db_KK_T_ADCHG_DTL.selectNext()` [-> Retrieve address change detail record] |

**Block 1.2.3.1.1** — [IF] `(adchgFimtInfo == null)` [L239]

> If no address change detail record exists for this optional service contract line, skip it. This was a change introduced in ANK-2286 (v10.00.00) - prior to this change, the absence of an address change detail record would throw an error.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (null == adchgFimtInfo)` |
| 2 | EXEC | `continue` [-> Skip this optional service contract line] |

**Block 1.2.3.1.2** — [PROCESSING] Build SOD map for this optional service contract line [L244]

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodHakMap = new HashMap<String, String>()` |
| 2 | SET | `sodHakMap.put(KEY_SOD_HAK_SVC_KEI_NO, trgSvcKeiNo)` [-> SOD issuance: Service contract number] |
| 3 | SET | `sodHakMap.put(KEY_SOD_HAK_SVKEI_GADTM, trgSvcKeiGeneAddDtm)` [-> SOD issuance: Service contract generation date-time] |
| 4 | SET | `sodHakMap.put(KEY_SOD_HAK_OP_SVC_KEI_NO, opSvcKeiInfo.getString(JBSbatKK_T_OP_SVC_KEI.OP_SVC_KEI_NO))` [-> SOD issuance: Optional service contract number] |
| 5 | SET | `sodHakMap.put(KEY_SOD_HAK_OPSVKEI_GADTM, opSvcKeiInfo.getString(JBSbatKK_T_OP_SVC_KEI.GENE_ADD_DTM))` [-> SOD issuance: Optional service contract generation date-time] |
| 6 | EXEC | `sodHakList.add(sodHakMap)` [-> Add SOD map to issuance list] |

**Block 1.2.4** — [PROCESSING] Build target data record [L267-L289]

> Assembles all collected data into a structured target data `HashMap` that will be sent to the ESB SOD update service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `trgtData = new HashMap<String, Object>()` |
| 2 | EXEC | `trgtData.put(KEY_TRGT_DATA_SYSID, "")` [-> SYSID (empty)] |
| 3 | EXEC | `trgtData.put(KEY_TRGT_DATA_SVC_KEI_NO, trgSvcKeiNo)` [-> Service contract number] |
| 4 | EXEC | `trgtData.put(KEY_TRGT_DATA_OP_SVC_KEI_NO, "")` [-> Optional service contract number (empty, placeholder)] |
| 5 | EXEC | `trgtData.put(KEY_TRGT_DATA_IDO_DIV, IDO_DIV_ADCHG_FIX="00020")` [-> Displacement category: Address Change/Confirmation] |
| 6 | EXEC | `trgtData.put(KEY_TRGT_DATA_PRG_DTM, trgPrgDtm)` [-> Progress date-time] |
| 7 | EXEC | `trgtData.put(KEY_TRGT_DATA_KOJIAK_NO, trgKojiakNo)` [-> Work project number] |
| 8 | EXEC | `trgtData.put(KEY_TRGT_DATA_FMTCEL_IDO_DTL_CD, FMTCEL_IDO_DTL_CD_INIT="00")` [-> Format cell displacement detail code: Initial] |
| 9 | EXEC | `trgtData.put(KEY_TRGT_DATA_SOD_HAK_LIST, sodHakList)` [-> SOD issuance list] |

**Block 1.2.4.1** — [IF] `(sodHakList is not empty)` [L286]

> ANK-2286 change (v10.00.00): Only add the target data to the list if the SOD issuance list is non-empty. Previously, all records were added regardless.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (!sodHakList.isEmpty())` |
| 2 | EXEC | `trgDataList.add(trgtData)` [-> Add target data to processing list] |

**Block 1.3** — [IF] `(trgDataList is not empty)` [L292]

> Build ESB parameters and invoke the SOD update service with the aggregated target data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap<String, Object>()` [-> ESB parameter map] |
| 2 | SET | `inputMap = new HashMap<String, Object>()` [-> ESB input map] |
| 3 | SET | `outputMap = new HashMap<String, Object>()` [-> ESB output map] |
| 4 | EXEC | `paramMap.put(JCCBatchEsbInterface.TELEGRAM_INFO_USECASE_ID, USECASE_ID="KKSV0709")` [-> Set usecase ID for ESB routing] |
| 5 | EXEC | `paramMap.put(JCCBatchEsbInterface.TELEGRAM_INFO_OPERATION_ID, OPERATION_ID="KKSV0709OP")` [-> Set operation ID for ESB routing] |
| 6 | EXEC | `inputMap.put(FIXED_TEXT="KKSV070901CC", trgDataList)` [-> Set target data list as ESB input payload keyed by user-defined text] |
| 7 | CALL | `JCCBatchEsbInterface.invokeService(super.commonItem, paramMap, inputMap, outputMap)` [-> Invoke ESB service for format cell SOD update] |
| 8 | SET | `returnCode = outputMap.get(JCCBatchEsbInterface.RETURN_CODE).toString()` [-> Get return code from ESB response] |

**Block 1.3.1** — [IF] `(returnCode != RETURN_CODE_SUCCESS)` [L304]

> If the ESB service returned a non-success code, throw a business exception.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (!JCCBatchEsbInterface.RETURN_CODE_SUCCESS.equals(returnCode))` |
| 2 | EXEC | `throw new JBSbatBusinessException(JPCBatchMessageConstant.EKKB0270CE, new String[]{"Address change format cell SOD update"})` |

**Block 1.4** — [RETURN] Return intermediate output item [L309]

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return outputInItem` |

**Block 2** — [ELSE] `(inMap != null)` [L312]

> Branch: Direct processing mode. A single service contract record is passed in via `inMap`. Validate it and add it to the output chain.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (!isSingleCheckKKIFM266_INF1(inMap.getMap(), getItemvalueMap()))` |

**Block 2.1** — [IF] `(validation fails)` [L313]

> If the input record fails single-check validation, throw an error with the row number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `length = (outputInItem != null && outputInItem.isOutMapList()) ? outputInItem.getOutMapList().size() : 0` [-> Get current output list size, handle NumberFormatException] |
| 2 | EXEC | `throw new JBSbatBusinessException(JPCBatchMessageConstant.EKKB0090TE, new String[]{Integer.toString((length + 1)).concat("Row")})` [-> Throw error with row number (e.g., "2行目" = "Line 2")] |

**Block 2.2** — [PROCESSING] Add input map to output and return [L323]

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outputInItem.addOutMapList(inMap)` [-> Accumulate validated record into output chain] |
| 2 | RETURN | `return outputInItem` |

**Block 3** — [RETURN] Return output item [L327]

> Default return in the intermediate processing path when there are no records to process (empty list case).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return outputInItem` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number - unique identifier for a customer's telecom service contract line item |
| `svc_kei_gadtm` | Field | Service contract generation registration date-time - when the service contract was created/registered in the system |
| `op_svc_kei_no` | Field | Optional service contract number - identifier for a sub-service (e.g., FTTH, phone, add-on) under a parent service contract |
| `opsvkei_gadtm` | Field | Optional service contract generation registration date-time - when the optional service contract was registered |
| `kojiak_no` | Field | Work project number - internal ticket/tracking ID for the address change work order |
| `ido_div` | Field | Displacement category - classifies the type of contract change (e.g., "00020" = Address Change/Confirmation) |
| `prg_dtm` | Field | Progress date-time - timestamp tracking the batch processing progress for a contract change operation |
| `fmtcel_ido_dtl_cd` | Field | Format cell displacement detail code - code specifying the type of format cell change (e.g., "00" = initial) |
| `sod_hak_list` | Field | SOD issuance list - list of Service Order Data records to be issued/updated |
| `SOD` | Acronym | Service Order Data - data entity representing a service order in the fulfillment system; "Sod Hakko" (SOD issuance) means generating/updating service orders |
| `ADR/Address Change` | Business term | `Jusho Henko` (住所変更) - customer address change operation; "Fix" (Kakutei) means the change has been confirmed |
| `KKSV0709` | Screen ID | Residence change confirmation screen usecase - the front-end screen that triggers the address change format cell SOD update flow |
| `KKSV0709OP` | Operation ID | Operation identifier for the address change confirmation batch operation |
| `KKSV070901CC` | Constant | User-defined text string - key used in ESB input map to carry the target data list payload |
| `IDO_DIV_ADCHG_FIX` | Constant | Displacement category code "00020" - Address Change / Confirmation |
| `PRG_STAT_ADCHG_FIN` | Constant | Program status code "6100" - Address Change Complete |
| `OYA_KEI_SKBT_CD_SVC_KEI` | Constant | Parent contract identification code "01" - Service Contract (distinguishes parent contracts from sub-contracts with code "03") |
| `FMTCEL_IDO_DTL_CD_INIT` | Constant | Format cell displacement detail code "00" - Initial value |
| `FTTH` | Business term | Fiber To The Home - fiber-optic broadband internet service offered by K-Opticom |
| `OP_SVC_CD_FMTCEL` | Constant | Format cell optional service code - filters optional service contracts to only those relevant to format cell changes |
| `KK_T_PRG` | Entity/DB | Program/Progress table - tracks batch processing progress for address change confirmation operations |
| `KK_T_OP_SVC_KEI` | Entity/DB | Optional Service Contract table - stores all optional service contract lines (add-ons) under a parent service contract |
| `KK_T_ADCHG_DTL` | Entity/DB | Address Change Details table - stores detailed records of address changes for each service contract line |
| `JKKAdChgFmtcelSodUpdCC` | Component | `KK` (Customer K) `AdChg` (Address Change) `Fmtcel` (Format Cell) `SodUpd` (SOD Update) Common Component - the CC-layer orchestration class that bridges the BPM operation with the batch service |
| `JKKStrConst` | Component | K-Opticom Common String Constants - central constant definitions for string values used across the KK system |
| `JCCBatchEsbInterface` | Component | Common Component Batch ESB Interface - abstraction layer for invoking ESB (Enterprise Service Bus) services in the batch processing environment |
| `JBSbatServiceInterfaceMap` | Component | Service batch interface map - message envelope carrying business data between batch processing components |
| `JBSbatOutputItem` | Component | Service batch output item - output chain holder that accumulates records for intermediate file processing |
| `EKKB0210CE` | Error Code | Business exception - progress record not found for address change confirmation |
| `EKKB0270CE` | Error Code | Business exception - address change format cell SOD update failed |
| `EKKB0090TE` | Error Code | Business exception - input validation error with row number |

---

*Document generated for `JBSbatKKAdChgFmtcelSodUpd.execute()` - 167 LOC - `eo.business.service` package.*
