# Business Logic — JKKAdchgKakuteiKikiDslCC.hakkoSODKktkDsl() [54 LOC]

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

## 1. Role

### JKKAdchgKakuteiKikiDslCC.hakkoSODKktkDsl()

This method prepares a Service Order Data (SOD) payload and delegates the actual SOD issuance processing to `JKKAdchgCancelHakkoSODCC.hakkoSODKktkDsl()`. It operates within the K-Opticom telecommunications customer backbone system during the DSL contract finalization process -- specifically when a DSL contract is confirmed/registered ("kakutei" = 確定). The method builds a hierarchical SOD request map containing the system ID, SOD basic info, and device-option service contract details extracted from the DSL confirmation data lists. It uses a **delegation pattern**: rather than executing the SOD issuance itself, it constructs the necessary input structure (`sodTrgtData`) and hands it off to the specialized component `JKKAdchgCancelHakkoSODCC`. The method serves as a **common utility** invoked by the DSL execution screen operation class (`KKSV0325OPOperation`), which acts as the screen entry point for DSL contract confirmation processing. It handles a single service type -- DSL-related SOD issuance for address changes (the "Adchg" in the class name stands for "Address Change" / 住所変更). The `ido_div` field is hardcoded to `"00019"`, indicating this method always operates in the DSL address-change context.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["hakkoSODKktkDsl(handle, param, fixedText, dslKktkList, dslKkopList)"])

    START --> S1["Extract paramMap from param.getData(fixedText)"]

    S1 --> S2["Create sodTrgtData HashMap"]

    S2 --> S3["Create trgtDataList ArrayList<HashMap>"]

    S3 --> S4["sodTrgtData.put(trgt_data_list, trgtDataList)[-> TRGT_DATA_LIST=\"trgt_data_list\"]"]

    S4 --> S5["Create sodMap HashMap"]

    S5 --> S6["trgtDataList.add(sodMap)"]

    S6 --> S7["Create sodKihonInfo HashMap"]

    S7 --> S8["sodKihonInfo.put(sysid, paramMap.get(sysid))"]

    S8 --> S9["sodKihonInfo.put(ido_div, \"00019\")[-> INFO_IDO_DIV=\"00019\"]"]

    S9 --> S10["sodMap.put(sod_kihon_info, sodKihonInfo)[-> SOD_KIHON_INFO]"]

    S10 --> S11["sodMap.put(svc_kei_info, emptyMap)[-> SVC_KEI_INFO]"]

    S11 --> S12["sodMap.put(svc_kei_ucwk_info, emptyMap)[-> SVC_KEI_UCWK_INFO]"]

    S12 --> S13["sodMap.put(opsvkei_info, emptyMap)[-> OPSVEI_INFO]"]

    S13 --> S14["sodMap.put(kktsvkei_info, emptyMap)[-> KKTSVKEI_INFO]"]

    S14 --> S15["Create kkop_trgt_data_list ArrayList<HashMap>"]

    S15 --> FOR["For each kkopMap in dslKkopList"]

    FOR --> LOOP_CREATE["Create kkopsvkeiInfo HashMap"]

    LOOP_CREATE --> LP1["kkopsvkeiInfo.put(chbf_kkopsvkei_no, kkopMap.get(kkop_svc_kei_no))"]

    LP1 --> LP2["kkopsvkeiInfo.put(chbf_kkopsvkei_gene_add_dtm, kkopMap.get(gene_add_dtm))"]

    LP2 --> LP3["kkopsvkeiInfo.put(takino_dsl_flg, kkopMap.get(takinoDslFlg))"]

    LP3 --> LP4["kkopsvkeiInfo.put(svcKeiNo, kkopMap.get(svcKeiNo))"]

    LP4 --> LP_ADD["kkop_trgt_data_list.add(kkopsvkeiInfo)"]

    LP_ADD --> FOR_END["End loop over dslKkopList"]

    FOR_END --> S16["sodMap.put(kkop_trgt_data_list, kkop_trgt_data_list)[-> KKOP_TRGT_DATA_LIST=\"kkop_trgt_data_list\"]"]

    S16 --> S17["sodTrgtData.put(FUNC_CODE_KEY, FUNC_CD_1)[-> FUNC_CD_1=\"1\"]"]

    S17 --> S18["param.setData(\"JKKAdchgCancelHakkoSODCC\", sodTrgtData)"]

    S18 --> S19["Instantiate new JKKAdchgCancelHakkoSODCC"]

    S19 --> S20["Call adchgCancelSODCC.hakkoSODKktkDsl(handle, param, \"JKKAdchgCancelHakkoSODCC\")"]

    S20 --> END(["Return void"])

    START --> S1
    S1 --> S2
    S2 --> S3
    S3 --> S4
    S4 --> S5
    S5 --> S6
    S6 --> S7
    S7 --> S8
    S8 --> S9
    S9 --> S10
    S10 --> S11
    S11 --> S12
    S12 --> S13
    S13 --> S14
    S14 --> S15
    S15 --> FOR
    FOR --> LOOP_CREATE
    LOOP_CREATE --> LP1
    LP1 --> LP2
    LP2 --> LP3
    LP3 --> LP4
    LP4 --> LP_ADD
    LP_ADD --> FOR_END
    FOR_END --> S16
    S16 --> S17
    S17 --> S18
    S18 --> S19
    S19 --> S20
    S20 --> END
```

**Constant Resolution in Flowchart:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|-----------------|
| `TRGT_DATA_LIST` | `"trgt_data_list"` | Key for the target data list within the SOD request map |
| `INFO_IDO_DIV` | `"ido_div"` | Field key for movement/type division code; hardcoded to `"00019"` for DSL address change context |
| `SOD_KIHON_INFO` | `"sod_kihon_info"` | Key for SOD basic information sub-map |
| `INFO_SYSID` | `"sysid"` | Key for the system ID in SOD basic info |
| `SVC_KEI_INFO` | `"svc_kei_info"` | Key for service contract detail info (empty placeholder) |
| `SVC_KEI_UCWK_INFO` | `"svc_kei_ucwk_info"` | Key for service detail work info (empty placeholder) |
| `OPSVKEI_INFO` | `"opsvkei_info"` | Key for option service contract info (empty placeholder) |
| `KKTSVKEI_INFO` | `"kktsvkei_info"` | Key for device provision service contract info (empty placeholder) |
| `KKOP_TRGT_DATA_LIST` | `"kkop_trgt_data_list"` | Key for the device-option target data list |
| `FUNC_CODE_KEY` | (key string) | Key for the function code in SOD request |
| `FUNC_CD_1` | `"1"` | Function code 1 -- indicates DSL address change registration operation |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session manager handle providing access to session-managed resources (transaction context, session variables) passed through to the delegated `hakkoSODKktkDsl` call. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter I/O object holding the model group and control maps for the screen operation. Used to read back-end data via `getData(fixedText)` and write the prepared SOD payload via `setData()`. |
| 3 | `fixedText` | `String` | A string key used to identify the data block within `param`. The same value is used to retrieve the source data map (`param.getData(fixedText)`) and later passed as the third argument to the delegated `JKKAdchgCancelHakkoSODCC.hakkoSODKktkDsl()` call. Acts as a correlation key between the caller and the target component. |
| 4 | `dslKktkList` | `ArrayList<HashMap<String, Object>>` | DSL confirmation (kakutei) list containing DSL contract line item records. Currently unused by this method (the method iterates over `dslKkopList` instead, suggesting this parameter exists for API compatibility or future use). |
| 5 | `dslKkopList` | `ArrayList<HashMap<String, Object>>` | DSL device-option (kkop) list containing device-option service contract records. Each map holds fields including `KKOP_SVC_KEI_NO` (device-option service contract number), `GENE_ADD_DTM` (generation/registration timestamp), `takinoDslFlg` (multi-function contract termination flag), and `svcKeiNo` (service contract number). Iterated over to build the `kkop_trgt_data_list` SOD payload. |

**External state / constants used:**

| Source | Constant | Value | Usage |
|--------|----------|-------|-------|
| `JKKHakkoSODConstCC.java` | `TRGT_DATA_LIST` | `"trgt_data_list"` | Key for putting the target data list into `sodTrgtData` |
| `JKKHakkoSODConstCC.java` | `SOD_KIHON_INFO` | `"sod_kihon_info"` | Key for SOD basic info in `sodMap` |
| `JKKHakkoSODConstCC.java` | `INFO_SYSID` | `"sysid"` | Key for system ID in `sodKihonInfo` |
| `JKKHakkoSODConstCC.java` | `INFO_IDO_DIV` | `"ido_div"` | Key for movement division in `sodKihonInfo` |
| `JKKHakkoSODConstCC.java` | `SVC_KEI_INFO` | `"svc_kei_info"` | Key for service contract info in `sodMap` |
| `JKKHakkoSODConstCC.java` | `SVC_KEI_UCWK_INFO` | `"svc_kei_ucwk_info"` | Key for service detail work info in `sodMap` |
| `JKKHakkoSODConstCC.java` | `OPSVKEI_INFO` | `"opsvkei_info"` | Key for option service info in `sodMap` |
| `JKKHakkoSODConstCC.java` | `KKTSVKEI_INFO` | `"kktsvkei_info"` | Key for device provision service info in `sodMap` |
| `JKKAdchgHakkoSODConstCC.java` | `INFO_CHBF_KKOPSVKEI_NO` | `"chbf_kkopsvkei_no"` | Key for pre-change device-option service contract number |
| `JKKAdchgHakkoSODConstCC.java` | `INFO_CHBF_KKOPSVKEI_GENE_ADD_DTM` | `"chbf_kkopsvkei_gene_add_dtm"` | Key for pre-change device-option service contract registration timestamp |
| `JKKAdchgHakkoSODConstCC.java` | `INFO_TAKINO_DSL_FLG` | `"takino_dsl_flg"` | Key for multi-function contract termination flag |
| `JKKAdchgHakkoSODConstCC.java` | `KKOP_TRGT_DATA_LIST` | `"kkop_trgt_data_list"` | Key for device-option target data list in `sodMap` |
| `JPCModelConstant.java` | `FUNC_CD_1` | `"1"` | Function code indicating DSL address change registration |
| `JCMConstants.java` | `FUNC_CODE_KEY` | (key string) | Key for function code in `sodTrgtData` |
| `EKK2811A010CBSMsg1List.java` | `KKOP_SVC_KEI_NO` | `"kkop_svc_kei_no"` | Field name for device-option service contract number |
| `EKK2811A010CBSMsg1List.java` | `GENE_ADD_DTM` | `"gene_add_dtm"` | Field name for generation registration timestamp |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `JKKAdchgCancelHakkoSODCC.hakkoSODKktkDsl` | JKKAdchgCancelHakkoSODCC | SOD issuance target table | Delegates SOD issuance processing to the cancellation/adcharge SOD component with the prepared payload |
| R | `param.getData(fixedText)` | - | Screen parameter data | Retrieves the source parameter data map using the `fixedText` key |
| U | `param.setData(key, sodTrgtData)` | - | Screen parameter data | Writes the constructed SOD target data map into `param` under key `"JKKAdchgCancelHakkoSODCC"` |

This method is primarily a data-assembler and delegator. It does not directly query or modify database tables itself. Instead, it builds an in-memory SOD payload structure and passes it to `JKKAdchgCancelHakkoSODCC.hakkoSODKktkDsl()` which performs the actual SOD issuance (create) against the underlying database. The only direct data interactions are reading from the input parameter map (`getData`) and writing the prepared payload (`setData`).

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0325 | `KKSV0325OPOperation` (via `target15` CCRequestBroker) -> `JKKAdchgKakuteiKikiDslCC.executeKikiDsl` -> `JKKAdchgKakuteiKikiDslCC.hakkoSODKktkDsl` -> `JKKAdchgCancelHakkoSODCC.hakkoSODKktkDsl` | `hakkoSODKktkDsl [C] SOD issuance tables`, `setData [U] param data`, `getData [R] param data` |

**Call chain details:**
- `KKSV0325OPOperation` is the screen operation class for the DSL contract finalization screen. It creates a `CCRequestBroker` instance (`target15`) pointing to `JKKAdchgKakuteiKikiDslCC.executeKikiDsl`, which in turn invokes `hakkoSODKktkDsl`.
- `hakkoSODKktkDsl` (this method) does not return a value (`void`), but modifies `param` via `setData` and delegates to `JKKAdchgCancelHakkoSODCC.hakkoSODKktkDsl` for the actual SOD issuance.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (L899) Retrieve input parameter data

This block extracts the source data map from the `param` object using the `fixedText` key. The returned map contains the DSL contract data passed from the screen.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = (HashMap)param.getData(fixedText)` // Retrieve source data map [-> param.getData(fixedText)] |

**Block 2** — [SET] (L903) Create SOD target data structure

This block initializes the top-level SOD target data map and its nested structure. It creates an empty `trgtDataList` that will hold the single SOD payload `sodMap`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodTrgtData = new HashMap()` // Create top-level SOD target map [-> new HashMap()] |
| 2 | SET | `trgtDataList = new ArrayList<HashMap>()` // Create target data list [-> new ArrayList()] |
| 3 | SET | `sodTrgtData.put(TRGT_DATA_LIST, trgtDataList)` // Put list into top-level map [-> TRGT_DATA_LIST="trgt_data_list" (JKKHakkoSODConstCC.java:63)] |

**Block 3** — [SET] (L909) Build SOD basic info and empty sub-maps

This block creates the SOD payload (`sodMap`), populates it with SOD basic information (system ID and movement division code `"00019"`), and places empty HashMaps as placeholders for service contract detail info, service detail work info, option service contract info, and device provision service contract info. The `ido_div` is hardcoded to `"00019"`, which corresponds to the DSL address-change context.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodMap = new HashMap()` // Create SOD payload map |
| 2 | SET | `trgtDataList.add(sodMap)` // Add sodMap to target list |
| 3 | SET | `sodKihonInfo = new HashMap()` // Create SOD basic info map |
| 4 | SET | `sodKihonInfo.put(INFO_SYSID, paramMap.get("sysid"))` // Set system ID from source map [-> INFO_SYSID="sysid" (JKKHakkoSODConstCC.java:65)] |
| 5 | SET | `sodKihonInfo.put(INFO_IDO_DIV, "00019")` // Set movement division [-> INFO_IDO_DIV="ido_div" (JKKHakkoSODConstCC.java:67)] |
| 6 | SET | `sodMap.put(SOD_KIHON_INFO, sodKihonInfo)` // Attach basic info [-> SOD_KIHON_INFO="sod_kihon_info" (JKKHakkoSODConstCC.java:61)] |
| 7 | SET | `sodMap.put(SVC_KEI_INFO, new HashMap())` // Empty service contract detail [-> SVC_KEI_INFO="svc_kei_info" (JKKHakkoSODConstCC.java:73)] |
| 8 | SET | `sodMap.put(SVC_KEI_UCWK_INFO, new HashMap())` // Empty service detail work [-> SVC_KEI_UCWK_INFO="svc_kei_ucwk_info" (JKKHakkoSODConstCC.java:74)] |
| 9 | SET | `sodMap.put(OPSVKEI_INFO, new HashMap())` // Empty option service info [-> OPSVEI_INFO="opsvkei_info" (JKKHakkoSODConstCC.java:76)] |
| 10 | SET | `sodMap.put(KKTSVKEI_INFO, new HashMap())` // Empty device provision service info [-> KKTSVKEI_INFO="kktsvkei_info" (JKKHakkoSODConstCC.java:78)] |

**Block 4** — [FOR LOOP] (L908-L919) Build device-option service contract data list

This block iterates over the `dslKkopList` input parameter and for each entry extracts the device-option service contract details into a structured map. The device-option (kkop) records contain information about the device-related option services associated with the DSL contract. Each iteration creates a new `kkopsvkeiInfo` map populated with: the pre-change device-option service contract number, the generation registration timestamp, the multi-function DSL termination flag, and the service contract number. The constructed maps are accumulated into `kkop_trgt_data_list`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kkop_trgt_data_list = new ArrayList<HashMap>()` // Initialize device-option data list |
| 2 | FOR | `for(HashMap kkopMap : dslKkopList)` // Iterate over DSL device-option confirmation list |
| 3 | &nbsp;&nbsp;&nbsp;&nbsp;SET | `kkopsvkeiInfo = new HashMap()` // Create per-item device-option info map |
| 4 | &nbsp;&nbsp;&nbsp;&nbsp;SET | `kkopsvkeiInfo.put(INFO_CHBF_KKOPSVKEI_NO, kkopMap.get(EKK2811A010CBSMsg1List.KKOP_SVC_KEI_NO))` // Pre-change device-option service contract number [-> INFO_CHBF_KKOPSVKEI_NO="chbf_kkopsvkei_no" (JKKAdchgHakkoSODConstCC.java:38), KKOP_SVC_KEI_NO="kkop_svc_kei_no" (EKK2811A010CBSMsg1List.java:558)] |
| 5 | &nbsp;&nbsp;&nbsp;&nbsp;SET | `kkopsvkeiInfo.put(INFO_CHBF_KKOPSVKEI_GENE_ADD_DTM, kkopMap.get(EKK2811A010CBSMsg1List.GENE_ADD_DTM))` // Pre-change generation registration timestamp [-> INFO_CHBF_KKOPSVKEI_GENE_ADD_DTM="chbf_kkopsvkei_gene_add_dtm" (JKKAdchgHakkoSODConstCC.java:41), GENE_ADD_DTM="gene_add_dtm" (EKK2811A010CBSMsg1List.java:558)] |
| 6 | &nbsp;&nbsp;&nbsp;&nbsp;SET | `kkopsvkeiInfo.put(INFO_TAKINO_DSL_FLG, kkopMap.get("takinoDslFlg"))` // Multi-function contract termination flag [-> INFO_TAKINO_DSL_FLG="takino_dsl_flg" (JKKAdchgHakkoSODConstCC.java:44)] |
| 7 | &nbsp;&nbsp;&nbsp;&nbsp;SET | `kkopsvkeiInfo.put("svcKeiNo", kkopMap.get("svcKeiNo"))` // Service contract number |
| 8 | &nbsp;&nbsp;&nbsp;&nbsp;EXEC | `kkop_trgt_data_list.add(kkopsvkeiInfo)` // Accumulate into list |
| 9 | EXEC | `sodMap.put(KKOP_TRGT_DATA_LIST, kkop_trgt_data_list)` // Attach device-option list to SOD payload [-> KKOP_TRGT_DATA_LIST="kkop_trgt_data_list" (JKKAdchgHakkoSODConstCC.java:35)] |

**Block 5** — [SET] (L922-L923) Set function code and store in param

This block sets the function code to `"1"` (indicating DSL address change registration) and writes the complete SOD target data map into the `param` object under the key `"JKKAdchgCancelHakkoSODCC"`. This prepares the data that the delegated method will read.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodTrgtData.put(FUNC_CODE_KEY, FUNC_CD_1)` // Set function code [-> FUNC_CD_1="1" (JPCModelConstant.java:29)] |
| 2 | EXEC | `param.setData("JKKAdchgCancelHakkoSODCC", sodTrgtData)` // Write SOD payload to param |

**Block 6** — [EXEC] (L925-L926) Delegate to SOD issuance component

This block instantiates `JKKAdchgCancelHakkoSODCC` and calls its `hakkoSODKktkDsl()` method, passing the session handle, the parameter object (now containing the SOD payload), and the fixed text key `"JKKAdchgCancelHakkoSODCC"`. This is the actual SOD issuance call -- the component performs the downstream data operations (reading from param, interacting with CBS/SC layer) to issue the service order.

| # | Type | Code |
|---|------|------|
| 1 | SET | `adchgCancelSodCC = new JKKAdchgCancelHakkoSODCC()` // Instantiate target component |
| 2 | CALL | `adchgCancelSodCC.hakkoSODKktkDsl(handle, param, "JKKAdchgCancelHakkoSODCC")` // Delegate SOD issuance [throws Throwable] |
| 3 | RETURN | `return;` // Return void |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| SOD | Acronym | Service Order Data -- the central entity in K-Opticom's telecom order fulfillment system for recording service orders |
| SOD issuance | Business term | The process of creating and registering a Service Order Data record in the system, triggering downstream order processing |
| kakutei (確定) | Japanese term | Finalization / confirmation -- in this context, the act of confirming/fixing a DSL contract |
| dslKktkList | Field | DSL confirmation (kakutei) list -- input containing DSL contract line item records to be finalized |
| dslKkopList | Field | DSL device-option (kkop) list -- input containing device-option service contract records associated with the DSL contract |
| kkop | Acronym | Device-option service -- K-Opticom terminology for device-related option services bundled with telecommunications contracts |
| INFO_IDO_DIV | Field | Movement division code -- classifies the type of SOD movement; `"00019"` specifically indicates DSL address-change context |
| sysid | Field | System ID -- identifies the originating system for the SOD record |
| ODR_EXEC_DIV_AD_CHG | Field | Order execution division code for address change registration (value: `"1"`) |
| chbf_kkopsvkei_no | Field | Pre-change device-option service contract number -- the service contract number before modification |
| chbf_kkopsvkei_gene_add_dtm | Field | Pre-change device-option service contract generation registration timestamp -- when the device-option service was registered |
| takino_dsl_flg | Field | Multi-function contract termination flag -- indicates whether a multi-function (bundled) contract is being terminated |
| FUNC_CD_1 | Constant | Function code `"1"` -- indicates DSL address change registration operation |
| JKKAdchgCancelHakkoSODCC | Class | Address change / cancellation SOD issuance common component -- handles the actual SOD issuance for address change and cancellation scenarios |
| CCRequestBroker | Technical term | Framework component that manages cross-component request invocation with error handling |
| KKSV0325 | Screen | DSL contract finalization screen operation -- the screen entry point that triggers this method |
| `sod_kihon_info` | Field | SOD basic information sub-map containing system ID and movement division |
| `svc_kei_info` | Field | Service contract detail info -- empty placeholder for future service contract line item data |
| `svc_kei_ucwk_info` | Field | Service detail work info -- empty placeholder for service detail work data |
| `opsvkei_info` | Field | Option service contract info -- empty placeholder for option service data |
| `kktsvkei_info` | Field | Device provision service contract info -- empty placeholder for device provision data |
| `trgt_data_list` | Field | Target data list -- the top-level list holding SOD payload maps within the request structure |
| `kkop_trgt_data_list` | Field | Device-option target data list -- accumulates device-option service contract detail maps for the SOD |
