# Business Logic — JKKSvkeiShosaCC.editMapShosaOkCmn() [257 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKSvkeiShosaCC` |
| Layer | Common Component / CC (Shared Business Logic Controller) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKSvkeiShosaCC.editMapShosaOkCmn()

This method orchestrates the **common mapping processing for service contract validation approval** (照査OK時のサービス共通のマッピング処理). When a customer submits a service contract request, the system performs multiple validation checks across different service layers, and this method collects and structures the results of all those checks into a single map.

The method handles **four distinct business domains**: (1) **Optional Service Contract checks** (オプションサービス契約照査) for add-on services like security packs, email, DSL mapper, etc.; (2) **Device Provision Service Contract checks** (機器提供サービス契約照査) for equipment such as ONU, multi-function routers, and home gateways; (3) **Application Details checks** (申請詳細照査・後続業務依頼) for post-application processing and downstream task delegation; and (4) **Installation Number Acquisition** (設置場所番号取得) which retrieves and validates equipment installation location numbers.

The method implements a **router/dispatch design pattern**, selecting different mapper methods based on the contract type (mobile/confirmable vs. standard) via the `weCanDoShosaAndCnc` flag. When `weCanDoShosaAndCnc` is true (i.e., `canCncSvcKei` — the contract can proceed to confirmation), it uses "confirm and complete" mapper methods (e.g., `EKK0391C030`, `EKK0341C050`); otherwise, it uses standard "check-only" mappers (e.g., `EKK0391C010`, `EKK0341C030`). This routing is applied consistently across all four processing domains.

It serves as a **shared utility** called by `runSvkeiShosa()` during the service validation workflow, meaning many screens and batch jobs that perform service contract checks route through this method. The result map it returns feeds downstream logic that determines whether the contract can proceed to confirmation or needs error handling.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editMapShosaOkCmn(params)"])
    START --> S1["S1: Initialize rsltShosaMap, work arrays"]
    S1 --> S2["S2: Extract inquiry results from rsltShokai<br>workEKK0021A010Array, workEKK0391A010Array,<br>workEKK0341B022Array, workEKK0251B003Array"]
    S2 --> S3["S3: weCanDoShosaAndCnc = canCncSvcKei"]
    S3 --> S4["S4: Optional Service Contract Check<br>Process workEKK0391A010Array"]
    S4 --> S4A{"workEKK0391A010Array != null?"}
    S4A -->|no| S4E["Skip - wkMapArray = []"]
    S4A -->|yes| S4B["Iterate EKK0391A010 entries"]
    S4B --> S4C["getWorkData(EKK0391A010CBSMsg1List)"]
    S4C --> S4D{"Iterate childTemplate"}
    S4D --> S4E2["getOpSvcKeiIdoDiv()"]
    S4E2 --> S4F{"currentIdoDiv == IDO_DIV_OP_HIKITUGI<br>= \"00003\" (Operation Inheritance)?"}
    S4F -->|yes| S4G["op_idoDiv = currentIdoDiv"]
    S4F -->|no| S4H["op_idoDiv = idoDiv (caller value)"]
    S4G --> S4I{"weCanDoShosaAndCnc?"}
    S4H --> S4I
    S4I -->|true| S4J["shosaOkMapper.editInMsgEKK0391C030<br>(Confirm-and-complete check)"]
    S4I -->|false| S4K["shosaOkMapper.editInMsgEKK0391C010<br>(Standard check-only)"]
    S4J --> S4L["editInMsgCmn(param, result)"]
    S4K --> S4L
    S4L --> S4M["Add to wkMapArray"]
    S4M --> S4N{More entries?}
    S4N -->|yes| S4C
    S4N -->|no| S4O["Put wkMapArray to rsltShosaMap<br>key MAP_KEY_EKK0391C030 or EKK0391C010"]
    S4O --> S5["S5: Device Provision Service Check<br>Process workEKK0341B022Array"]
    S4E --> S5
    S5 --> S5A{"workEKK0341B022Array != null?"}
    S5A -->|no| S5E["Skip - wkMapArray = []"]
    S5A -->|yes| S5B["Iterate EKK0341B022 entries"]
    S5B --> S5C["getWorkData(EKK0341B022CBSMsg1List)"]
    S5C --> S5D{"Iterate childTemplate"}
    S5D --> S5F["kktkSvcShosaFlg = true"]
    S5F --> S5G{"KKTK_SVC_CD in [C012=ONU,<br>C024=MultiRouter, C025=HGW]?"}
    S5G -->|yes| S5H{"svcSbtCd not in [HNET=1, HTTEL=3]?"}
    S5H -->|yes| S5I["kktkSvcShosaFlg = false"]
    S5H -->|no| S5J["Keep kktkSvcShosaFlg = true"]
    S5I --> S5K{"KKTK_SVC_CD in [C024,C025]<br>&amp;&amp; KEI_STAT &lt; \"010\"?"}
    S5K -->|yes| S5I2["kktkSvcShosaFlg = false"]
    S5K -->|no| S5J
    S5G -->|no| S5L{"KKTK_SVC_CD == C013=V-ONU?"}
    S5L -->|yes| S5M{"svcSbtCd == HTV=2?"}
    S5M -->|no| S5I3["kktkSvcShosaFlg = false"]
    S5M -->|yes| S5J2["Keep kktkSvcShosaFlg = true"]
    S5L -->|no| S5J3["Keep kktkSvcShosaFlg = true"]
    S5I2 --> S5N{"kktkSvcShosaFlg?"}
    S5I3 --> S5N
    S5J --> S5N
    S5J2 --> S5N
    S5J3 --> S5N
    S5N -->|yes| S5O{"weCanDoShosaAndCnc?"}
    S5N -->|no| S5P["Skip"]
    S5O -->|true| S5Q["shosaOkMapper.editInMsgEKK0341C050<br>(Confirm-and-complete)"]
    S5O -->|false| S5R["shosaOkMapper.editInMsgEKK0341C030<br>(Standard check)"]
    S5Q --> S5S["editInMsgCmn"]
    S5R --> S5S
    S5S --> S5T["editMapShosaKkop() for equipment<br>optional service contract check"]
    S5T --> S5U["Add to wkMapArray"]
    S5U --> S5V{More entries?}
    S5V -->|yes| S5C
    S5V -->|no| S5W["Put wkMapArray to rsltShosaMap<br>key EKK0341C050 or EKK0341C030"]
    S5P --> S5W
    S5W --> S6["S6: Application Details Check<br>Process workEKK0021A010Array"]
    S5E --> S6
    S6 --> S6A{"workEKK0021A010Array != null?"}
    S6A -->|no| S6E["Skip - wkMapArray = []"]
    S6A -->|yes| S6B["Iterate EKK0021A010 entries"]
    S6B --> S6C["getWorkData(EKK0021A010CBSMsg1List)"]
    S6C --> S6D{"Iterate childTemplate"}
    S6D --> S6F["shosaOkMapper.editInMsgEKK0021C060<br>(with updDtm)"]
    S6F --> S6G["editInMsgCmn"]
    S6G --> S6H["Update updDtm from result"]
    S6H --> S6I["Add to wkMapArray"]
    S6I --> S6J{More entries?}
    S6J -->|yes| S6C
    S6J -->|no| S6K["Put wkMapArray to rsltShosaMap key EKK0021C060"]
    S6E --> S7["S7: Installation Number Acquisition<br>Process workEKK0251B003Array"]
    S6K --> S7
    S7 --> S7A{"workEKK0251B003Array != null?"}
    S7A -->|no| S7E["Skip - wkMapArray = []"]
    S7A -->|yes| S7B{"svcSbtCd == MOBA=4?"}
    S7B -->|yes| S7C["getWorkParentData(ECK0011A010)<br>read adManInputFlg"]
    S7B -->|no| S7D["adManInputFlg = null"]
    S7C --> S7F["Iterate EKK0251B003 entries"]
    S7D --> S7F
    S7F --> S7G["getWorkData(EKK0251B003CBSMsg1List)"]
    S7G --> S7H{"Iterate childTemplate"}
    S7H --> S7I["kisnNo = SVC_KEI_KAISEN_UCWK_NO"]
    S7I --> S7J{"kisnNo != null<br>&amp;&amp; kisnNo != rekisnNo?"}
    S7J -->|yes| S7K["shosaOkMapper.editInMsgEKKA0020002<br>(with adManInputFlg)"]
    S7J -->|no| S7L["Skip"]
    S7K --> S7M["editInMsgCmn"]
    S7M --> S7N["Add to wkMapArray"]
    S7N --> S7O{More entries?}
    S7O -->|yes| S7G
    S7O -->|no| S7P["Put wkMapArray to rsltShosaMap key EKKA0020002"]
    S7E --> S7P
    S7P --> S8["Return rsltShosaMap"]
    S8 --> END(["END"])
    S7L --> S7O
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle providing transaction context and persistence access for mapper method calls |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing the model groups, control maps, and business data passed from the calling screen or batch job. Modified by mapper methods to write back validation results and error messages |
| 3 | `userDataIndex` | `int` | Index into the `param` object identifying which business data work item (e.g., which customer, which service line) is being processed. Used in delegated calls to `editMapShosaKkop` |
| 4 | `rsltShokai` | `HashMap<String, Object>` | Result map containing inquiry and list lookup data. Serves as the input data source — this method extracts work arrays for optional services (EKK0391A010), device provision services (EKK0341B022), application details (EKK0021A010), and service contract line details (EKK0251B003) from this map |
| 5 | `idoDiv` | `String` | Processing division code indicating the type of business operation (e.g., new registration, change, cancellation). Used to determine routing behavior for optional service contract checks. Specific value `"00003"` (IDO_DIV_OP_HIKITUGI) signals "operation inheritance" which triggers special routing |
| 6 | `svcSbtCd` | `int` | Service subcategory code that identifies the service type: `1`=eo Hikari Net, `2`=eo Hikari TV, `3`=eo Hikari Telephone, `4`=eo Mobile, `5`=eo ADSL. Determines which device provision services are valid (e.g., C012/C024/C025 only for HNET/HTEL, C013 only for HTV) |
| 7 | `canCncSvcKei` | `boolean` | Confirmation OK flag indicating whether the contract can proceed to the confirmation-completion stage. This is the **actual decision variable** used for all routing: when true, "confirm-and-complete" mapper methods are used; when false, standard "check-only" methods are used. Originally also factored in `svcSbtCd == MOBA`, but that was simplified to use only this flag |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `rekisnNo` | `String` | Previous service contract line number — used as a baseline for comparison in the installation number acquisition block to detect when line numbers differ per service |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKSvkeiShosaCC.getWorkData` | - | - | Retrieves work data templates from `CAANMsg[]` arrays using CBS message list keys (EKK0391A010CBSMsg1List, EKK0341B022CBSMsg1List, etc.) — internal data extraction |
| R | `JKKSvkeiShosaCC.getOpSvcKeiIdoDiv` | - | - | Retrieves the optional service division code for a given service detail number to determine if the operation is inheritance |
| R | `JKKSvkeiShosaCC.getWorkParentData` | - | - | Retrieves parent-level work data for ECK0011A010 (customer information) to read the `adManInputFlg` for mobile service manual address input |
| U | `shosaOkMapper.editInMsgEKK0391C030` | EKK0391C030SC | EKK0391 (Optional Service Contract) | Confirm-and-complete check for optional service contracts — used when `weCanDoShosaAndCnc=true` (mobile/confirmable contracts) |
| U | `shosaOkMapper.editInMsgEKK0391C010` | EKK0391C010SC | EKK0391 (Optional Service Contract) | Standard check-only for optional service contracts — used when `weCanDoShosaAndCnc=false` (standard contracts) |
| U | `shosaOkMapper.editInMsgEKK0341C050` | EKK0341C050SC | EKK0341 (Device Provision Service Contract) | Confirm-and-complete check for device provision service contracts (ONU, multi-function routers, HGW) — used when `weCanDoShosaAndCnc=true` |
| U | `shosaOkMapper.editInMsgEKK0341C030` | EKK0341C030SC | EKK0341 (Device Provision Service Contract) | Standard check-only for device provision service contracts — used when `weCanDoShosaAndCnc=false` |
| U | `shosaOkMapper.editInMsgEKK0021C060` | EKK0021C060SC | EKK0021 (Application Details) | Check for application details and post-application tasks — processes with an `updDtm` (update datetime) for optimistic concurrency control |
| U | `shosaOkMapper.editInMsgEKKA0020002` | EKKA0020002SC | ETN0011 (Installation Location) | Installation number acquisition — retrieves equipment installation location numbers, with optional manual address input flag for mobile services |
| U | `JKKSvkeiShosaCC.editInMsgCmn` | - | - | Common error/message processing — transforms raw mapper results into standardized result maps added to working arrays |
| U | `JKKSvkeiShosaCC.editMapShosaKkop` | - | - | Delegates optional service contract check for equipment — called after each device provision service check to validate the optional service contracts associated with that equipment |

## 5. Dependency Trace

### Caller Chain

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKSvkeiShosaCC.runSvkeiShosa` | `runSvkeiShosa` -> `editMapShosaOkCmn` | `editInMsgCmn [U]`, `editInMsgEKKA0020002 [U] ETN0011`, `editInMsgEKK0021C060 [U] EKK0021`, `editInMsgEKK0391C010/C030 [U] EKK0391`, `editInMsgEKK0341C030/C050 [U] EKK0341`, `getWorkData [R]`, `getOpSvcKeiIdoDiv [R]`, `getWorkParentData [R]` |

No additional screen or batch entry points were found within 8 hops of this method. The sole direct caller is the `runSvkeiShosa()` method within the same class `JKKSvkeiShosaCC`, which serves as the main service validation orchestrator.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `initialize rsltShosaMap and work arrays` (L8073)

This block initializes all local variables and extracts inquiry results from the `rsltShokai` map into typed work arrays.

| # | Type | Code |
|---|------|------|
| 1 | SET | `rsltShosaMap = new HashMap()` |
| 2 | SET | `rslt = null` |
| 3 | SET | `workEKK0021A010Array = null` // 申請詳細同意照査 (Application Details Consent Check) |
| 4 | SET | `workEKK0391A010Array = null` // オプションサービス契約<サポート>同意照査 (Optional Service Contract <Support> Consent Check) |
| 5 | SET | `workEKK0341B022Array = null` // 機器提供サービス契約同意照査 (Device Provision Service Contract Consent Check) |
| 6 | SET | `workEKK0251B003Array = null` // サービス契約回線内訳同意照査 (Service Contract Line Breakdown Consent Check) |
| 7 | SET | `wkCaanMsgList = null` |
| 8 | SET | `wkMapArray = null` |
| 9 | SET | `kktkSvcShosaFlg` (boolean, uninitialized) |
| 10 | EXTRACT | `workEKK0021A010Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK0021A010)` // key = "EKK0021A010" |
| 11 | EXTRACT | `workEKK0391A010Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK0391A010)` // key = "EKK0391A010" |
| 12 | EXTRACT | `workEKK0341B022Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK0341B022)` // key = "EKK0341B022" |
| 13 | EXTRACT | `workEKK0251B003Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK0251B003)` // key = "EKK0251B003" |

**Block 2** — [SET] `determine weCanDoShosaAndCnc` (L8093-8097)

Determines whether the contract can proceed to confirmation-completion. Originally combined `svcSbtCd == MOBA || canCncSvcKei` but was simplified to use only `canCncSvcKei`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `weCanDoShosaAndCnc = (svcSbtCd == SVC_SBT_CD_MOBA || canCncSvcKei)` // original logic: MOBA or confirmable [-> SVC_SBT_CD_MOBA = 4 (eo Mobile)] |
| 2 | SET | `weCanDoShosaAndCnc = canCncSvcKei` // simplified: only confirmable flag matters |

**Block 3** — [IF + FOR] `Optional Service Contract Check: workEKK0391A010Array` (L8099-8140)

Processes optional service contract (support) consent check. Iterates over all optional service entries, extracts work data, determines the correct operation division code, and calls the appropriate mapper method based on the `weCanDoShosaAndCnc` flag.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK0391A010Array != null` [L8101] |
| 2.1 | FOR | `for (int i = 0; i < workEKK0391A010Array.size(); i++)` [L8103] |
| 2.1.1 | EXEC | `wkTenplates = getWorkData(EKK0391A010CBSMsg.EKK0391A010CBSMSG1LIST, (Map)workEKK0391A010Array.get(i))` [L8105] |
| 2.1.2 | FOR | `for (int j = 0; j < wkTenplates.length; j++)` [L8107] |
| 2.1.2.1 | SET | `childTemplate = wkTenplates[j]` |
| 2.1.2.2 | EXEC | `currentIdoDiv = getOpSvcKeiIdoDiv(handle, param, childTemplate.getString(EKK0361A010CBSMsg1List.OP_SVC_KEI_NO))` // Check if operation is inheritance [L8110] |
| 2.1.2.3 | SET | `op_idoDiv = idoDiv` // Default to caller's idoDiv |
| 2.1.2.4 | IF | `IDO_DIV_OP_HIKITUGI.equals(currentIdoDiv)` [L8112] [-> IDO_DIV_OP_HIKITUGI = "00003" (Operation Inheritance)] |
| 2.1.2.4.1 | SET | `op_idoDiv = currentIdoDiv` // Override with inheritance division |
| 2.1.2.5 | IF | `weCanDoShosaAndCnc` [L8116] [-> svcSbtCd == 4 (Mobile) or can proceed to confirm] |
| 2.1.2.5.1 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK0391C030(param, childTemplate, op_idoDiv)` // Confirm-and-complete check for optional services |
| 2.1.2.6 | ELSE-IF | `else` [L8123] |
| 2.1.2.6.1 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK0391C010(param, childTemplate, op_idoDiv)` // Standard check-only for optional services |
| 2.1.2.7 | EXEC | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` // Common error/message processing |
| 2.1.2.8 | SET | `wkMapArray.add(rslt)` |

**Block 4** — [IF] `Put optional service results to rsltShosaMap` (L8147-8153)

Stores the optional service check results map under the appropriate key.

| # | Type | Code |
|---|------|------|
| 1 | IF | `weCanDoShosaAndCnc` |
| 1.1 | SET | `rsltShosaMap.put(MAP_KEY_EKK0391C030, wkMapArray)` // key = "EKK0391C030" |
| 2 | ELSE-IF | `else` |
| 2.1 | SET | `rsltShosaMap.put(MAP_KEY_EKK0391C010, wkMapArray)` // key = "EKK0391C010" |

**Block 5** — [IF + FOR] `Device Provision Service Contract Check: workEKK0341B022Array` (L8155-8223)

Processes device provision service (ONU, multi-function router, HGW, V-ONU) consent checks. This is the most complex block with nested conditional logic that validates which equipment types are valid for which service types.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK0341B022Array != null` [L8158] |
| 2.1 | FOR | `for (int i = 0; i < workEKK0341B022Array.size(); i++)` [L8160] |
| 2.1.1 | EXEC | `wkTenplates = getWorkData(EKK0341B022CBSMsg.EKK0341B022CBSMSG1LIST, (Map)workEKK0341B022Array.get(i))` |
| 2.1.2 | FOR | `for (int j = 0; j < wkTenplates.length; j++)` [L8162] |
| 2.1.2.1 | SET | `kktkSvcShosaFlg = true` |
| 2.1.2.2 | SET | `childTemplate = wkTenplates[j]` |
| 2.1.2.3 | IF | `KKTK_SVC_CD in [C012=ONU, C024=MultiRouter, C025=HGW]` [L8166-8169] [KKTK_SVC_C012="C012", KKTK_SVC_C024="C024", KKTK_SVC_C025="C025"] |
| 2.1.2.3.1 | IF | `!(svcSbtCd == SVC_SBT_CD_HNET || svcSbtCd == SVC_SBT_CD_HTEL)` [L8171] [HNET=1, HTTEL=3] |
| 2.1.2.3.1.1 | SET | `kktkSvcShosaFlg = false` // ONU/Router/HGW only valid for eo Hikari Net or Telephone |
| 2.1.2.3.2 | IF | `(KKTK_SVC_CD in [C024,C025]) && "010".compareTo(KEI_STAT) < 0` [L8185-8187] // Multi-router or HGW already confirmed (status < 010 = already validated) |
| 2.1.2.3.2.1 | SET | `kktkSvcShosaFlg = false` // Skip if multi-router/HGW already confirmed |
| 2.1.2.4 | ELSE-IF | `KKTK_SVC_CD.equals(KKTK_SVC_C013)` [L8193] [C013 = V-ONU] |
| 2.1.2.4.1 | IF | `svcSbtCd != SVC_SBT_CD_HTV` [L8195] [HTV=2] |
| 2.1.2.4.1.1 | SET | `kktkSvcShosaFlg = false` // V-ONU only valid for eo Hikari TV |
| 2.1.2.5 | IF | `kktkSvcShosaFlg` [L8201] |
| 2.1.2.5.1 | IF | `weCanDoShosaAndCnc` [L8204] |
| 2.1.2.5.1.1 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK0341C050(param, childTemplate)` // Confirm-and-complete device check |
| 2.1.2.5.2 | ELSE-IF | `else` [L8210] |
| 2.1.2.5.2.1 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK0341C030(param, childTemplate)` // Standard device check |
| 2.1.2.5.3 | EXEC | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` |
| 2.1.2.5.4 | SET | `wkMapArray.add(rslt)` |
| 2.1.2.5.5 | CALL | `editMapShosaKkop(handle, param, userDataIndex, rsltShosaMap, weCanDoShosaAndCnc, childTemplate.getString(KKTK_SVC_KEI_NO), idoDiv)` // Check optional service contracts for this equipment [L8214-8222] |

**Block 6** — [IF] `Put device provision results to rsltShosaMap` (L8225-8231)

Stores device provision check results under the appropriate key.

| # | Type | Code |
|---|------|------|
| 1 | IF | `weCanDoShosaAndCnc` |
| 1.1 | SET | `rsltShosaMap.put(MAP_KEY_EKK0341C050, wkMapArray)` // key = "EKK0341C050" |
| 2 | ELSE-IF | `else` |
| 2.1 | SET | `rsltShosaMap.put(MAP_KEY_EKK0341C030, wkMapArray)` // key = "EKK0341C030" |

**Block 7** — [IF + FOR] `Application Details Check: workEKK0021A010Array` (L8234-8254)

Processes application details consent check for post-application tasks. Uses an `updDtm` (update datetime) for optimistic concurrency control.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | SET | `updDtm = null` |
| 3 | IF | `workEKK0021A010Array != null` [L8236] |
| 3.1 | FOR | `for (int i = 0; i < workEKK0021A010Array.size(); i++)` [L8238] |
| 3.1.1 | EXEC | `wkTenplates = getWorkData(EKK0021A010CBSMsg.EKK0021A010CBSMSG1LIST, (Map)workEKK0021A010Array.get(i))` |
| 3.1.2 | FOR | `for (int j = 0; j < wkTenplates.length; j++)` [L8240] |
| 3.1.2.1 | SET | `childTemplate = wkTenplates[j]` |
| 3.1.2.2 | IF | `updDtm == null` [L8242] |
| 3.1.2.2.1 | SET | `updDtm = childTemplate.getString(EKK0021A010CBSMsg1List.LAST_UPD_DTM)` // First entry provides the update timestamp |
| 3.1.2.3 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK0021C060(param, childTemplate, updDtm)` // Application details check with concurrency control |
| 3.1.2.4 | EXEC | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` |
| 3.1.2.5 | SET | `updDtm = (String)rslt.get(EKK0021C060CBSMsg.UPD_DTM)` // Update timestamp from result for next iteration |
| 3.1.2.6 | SET | `wkMapArray.add(rslt)` |

**Block 8** — [SET] `Put application details results to rsltShosaMap` (L8255)

Stores application details check results.

| # | Type | Code |
|---|------|------|
| 1 | SET | `rsltShosaMap.put(MAP_KEY_EKK0021C060, wkMapArray)` // key = "EKK0021C060" |

**Block 9** — [IF + FOR] `Installation Number Acquisition: workEKK0251B003Array` (L8272-8310)

Processes installation location number acquisition. Only executed for Mobile services (svcSbtCd == 4) to read customer manual address input flags, and only runs when line numbers differ between services.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | SET | `adManInputFlg = null` |
| 3 | IF | `SVC_SBT_CD_MOBA == svcSbtCd` [L8285] [-> MOBA = 4 (eo Mobile)] |
| 3.1 | EXEC | `workECK0011A010 = getWorkParentData(ECK0011A010CBSMsg.ECK0011A010CBSMSG1LIST, rsltShokai, MAP_KEY_ECK0011A010)` // key = "ECK0011A010" — get customer info |
| 3.2 | SET | `adManInputFlg = workECK0011A010[0].getString(ECK0011A010CBSMsg1List.KEISHA_AD_MAN_INPUT_FLG)` // Manual address input flag from customer data |
| 4 | IF | `workEKK0251B003Array != null` [L8292] |
| 4.1 | FOR | `for (int i = 0; i < workEKK0251B003Array.size(); i++)` [L8293] |
| 4.1.1 | EXEC | `wkTenplates = getWorkData(EKK0251B003CBSMsg.EKK0251B003CBSMSG1LIST, (Map)workEKK0251B003Array.get(i))` |
| 4.1.2 | FOR | `for (int j = 0; j < wkTenplates.length; j++)` [L8295] |
| 4.1.2.1 | SET | `childTemplate = wkTenplates[j]` |
| 4.1.2.2 | SET | `kisnNo = childTemplate.getString(EKK0251B003CBSMsg1List.SVC_KEI_KAISEN_UCWK_NO)` // Service detail line work number |
| 4.1.2.3 | IF | `kisnNo != null && !kisnNo.equals(rekisnNo)` [L8300] // Only run when line numbers differ between services |
| 4.1.2.3.1 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKKA0020002(param, childTemplate, adManInputFlg)` // Installation number acquisition with manual input flag |
| 4.1.2.3.2 | EXEC | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` |
| 4.1.2.3.3 | SET | `wkMapArray.add(rslt)` |

**Block 10** — [SET] `Put installation number results to rsltShosaMap` (L8307)

Stores installation number acquisition results.

| # | Type | Code |
|---|------|------|
| 1 | SET | `rsltShosaMap.put(MAP_KEY_EKKA0020002, wkMapArray)` // key = "EKKA0020002" |

**Block 11** — [RETURN] `return rsltShosaMap` (L8312)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return rsltShosaMap` // Structured result map containing all four check result arrays |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `editMapShosaOkCmn` | Method | Common mapping processing for service contract validation approval — collects and structures all validation check results |
| `canCncSvcKei` | Parameter | Confirmation OK flag — determines whether the contract can proceed to confirmation-completion stage instead of check-only |
| `idoDiv` | Parameter | Processing division code — indicates the type of business operation (new registration, change, transfer, etc.) |
| `svcSbtCd` | Parameter | Service subcategory code — identifies the service type (eo Hikari Net=1, eo Hikari TV=2, eo Hikari Telephone=3, eo Mobile=4, eo ADSL=5) |
| `rsltShokai` | Parameter | Inquiry result map — contains pre-fetched data from database lookups that this method draws work arrays from |
| `weCanDoShosaAndCnc` | Variable | "Can perform validation and confirmation" — determines whether confirm-and-complete mappers or standard check-only mappers are used |
| `IDO_DIV_OP_HIKITUGI` | Constant | "00003" — Operation Inheritance division code — when an optional service contract is being inherited, this code replaces the caller's division code |
| `MAP_KEY_EKK0391A010` | Constant | "EKK0391A010" — Map key for optional service contract (support) consent check results |
| `MAP_KEY_EKK0341B022` | Constant | "EKK0341B022" — Map key for device provision service contract consent check results |
| `MAP_KEY_EKK0021A010` | Constant | "EKK0021A010" — Map key for application details consent check results |
| `MAP_KEY_EKK0251B003` | Constant | "EKK0251B003" — Map key for service contract line breakdown consent check results |
| `MAP_KEY_EKK0391C010` | Constant | "EKK0391C010" — Map key storing standard optional service contract check results |
| `MAP_KEY_EKK0391C030` | Constant | "EKK0391C030" — Map key storing confirm-and-complete optional service contract check results |
| `MAP_KEY_EKK0341C030` | Constant | "EKK0341C030" — Map key storing standard device provision service contract check results |
| `MAP_KEY_EKK0341C050` | Constant | "EKK0341C050" — Map key storing confirm-and-complete device provision service contract check results |
| `MAP_KEY_EKK0021C060` | Constant | "EKK0021C060" — Map key storing application details check results |
| `MAP_KEY_EKKA0020002` | Constant | "EKKA0020002" — Map key storing installation number acquisition results |
| `kktkSvcShosaFlg` | Variable | Device provision service check flag — gates whether a device provision entry passes validation based on equipment type and service type compatibility |
| `adManInputFlg` | Variable | Manual address input flag — from customer data, indicates whether the customer manually entered the contract address (used only for Mobile services) |
| `kisnNo` | Instance Field | Service contract line number (current) — the service detail line work number of the current iteration |
| `rekisnNo` | Instance Field | Service contract line number (previous/reference) — used as baseline to detect when line numbers differ across services |
| `updDtm` | Variable | Update datetime — used for optimistic concurrency control in application details checks |
| EKK0391 | CBS | Optional Service Contract — handles add-on services like security packs, email, DSL mapper, eONETV operation channels |
| EKK0341 | CBS | Device Provision Service Contract — handles equipment provision (ONU, V-ONU, multi-function router, HGW) |
| EKK0021 | CBS | Application Details — handles application consent check and post-application task delegation |
| EKK0251 | CBS | Service Contract Line Breakdown — handles service contract line details (installation location) |
| ECK0011 | CBS | Customer Information — provides customer-level data including manual address input flag |
| EKK0361 | CBS | Optional Service Detail — provides optional service detail numbers for division code lookups |
| KKTK_SVC_C012 | Constant | "C012" — ONU (Optical Network Unit) device type |
| KKTK_SVC_C013 | Constant | "C013" — V-ONU (Virtual Optical Network Unit) device type |
| KKTK_SVC_C024 | Constant | "C024" — Multi-function Router device type |
| KKTK_SVC_C025 | Constant | "C025" — HGW (Home Gateway) device type |
| SVC_SBT_CD_HNET | Constant | 1 — eo Hikari Net (fiber-optic internet) |
| SVC_SBT_CD_HTV | Constant | 2 — eo Hikari TV (fiber-optic television) |
| SVC_SBT_CD_HTEL | Constant | 3 — eo Hikari Telephone (fiber-optic telephone) |
| SVC_SBT_CD_MOBA | Constant | 4 — eo Mobile (mobile broadband service) |
| SVC_SBT_CD_ADSL | Constant | 5 — eo ADSL (Asymmetric Digital Subscriber Line) |
| EKK0391C010SC | SC Code | Service Component for standard optional service contract check |
| EKK0391C030SC | SC Code | Service Component for confirm-and-complete optional service contract check |
| EKK0341C030SC | SC Code | Service Component for standard device provision service contract check |
| EKK0341C050SC | SC Code | Service Component for confirm-and-complete device provision service contract check |
| EKK0021C060SC | SC Code | Service Component for application details check and post-application tasks |
| EKKA0020002SC | SC Code | Service Component for installation number acquisition |
| ETN0011 | CBS | Installation Location — provides equipment installation location number data |
| Confirm-and-complete | Business term | Processing mode where the validation check and contract confirmation are performed in a single step (used for mobile/confirmable contracts) |
| Check-only | Business term | Processing mode where only validation is performed without confirming the contract (used for standard contracts) |
| Operation Inheritance | Business term | A contract transfer scenario where an optional service contract is being inherited from a previous contract |
| Optimistic Concurrency Control | Technical term | A concurrency strategy using a version/timestamp (`updDtm`) to detect conflicts between read and write operations |
