# Business Logic — JKKPauseReceptCC.executeHakkoSodCC() [64 LOC]

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

## 1. Role

### JKKPauseReceptCC.executeHakkoSodCC()

This method performs **SOD (Service Order Data) issuance** for a pause (suspension) reception transaction. It assembles a hierarchical data structure representing the SOD record — including basic info, service contract details, and service contract sub-details — from incoming CAANMsg message objects, then delegates the actual SOD creation to `JKKHakkoSODCC.hakkoSOD()`. The method implements a **builder + delegation** pattern: it first constructs all necessary SOD payload maps by extracting fields from the parent message (`msgEKK0081A010`) and the per-item child message array (`msgEKK0161B004List[]`), populates them into a target data list, sets functional and operational metadata (`func_code`, `trgt_data_list`), and then invokes the SOD issuance service component. Its **role in the larger system** is as an internal helper within `JKKPauseReceptCC` — a dedicated CC (Common Component) for handling pause reception (service suspension registration) operations. It is not a public entry point; it is called from `pauseReceptuCtrlTran()`, which coordinates the broader pause reception transaction flow. The `ido_div` field is hardcoded to `"00024"`, representing "ido_bun: suspension reception" (異動区分：休止受付), identifying this as a suspension-type service order.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeHakkoSodCC(handle, param, msgEKK0081A010, msgEKK0161B004List)"])

    START --> INIT["Initialize: sod_map, trgt_data_list, sod_kihon_info_Map, svc_kei_info_Map, svc_kei_ucwk_info_Map"]

    INIT --> WORKKEY["Set workFixedText = HakkoSODCC"]

    WORKKEY --> CREATEUSER["CALL: createUserData(param, HakkoSODCC) returns workHakkoSODDataKeyFlg"]

    CREATEUSER --> NEWCC["NEW: JKKHakkoSODCC hakkoSODCC"]

    NEWCC --> GETDATA["EXEC: param.getData(HakkoSODCC) returns outMap"]

    GETDATA --> FORCHECK{"Loop: i lessThan msgEKK0161B004List.length?"}

    FORCHECK -- Yes --> GETMSG["Get: msgEKK0161B004 = msgEKK0161B004List[i]"]

    GETMSG --> NEWKIHON["NEW: sod_kihon_info_Map"]

    NEWKIHON --> PUTIDO["SET: sod_kihon_info_Map.put(ido_div, 00024)"]

    PUTIDO --> PUTSYSID["SET: sod_kihon_info_Map.put(sysid, msgEKK0081A010.getString(SYSID))"]

    PUTSYSID --> NEWKEI["NEW: svc_kei_info_Map"]

    NEWKEI --> PUTSVC["SET: svc_kei_info_Map.put(svc_kei_no, msgEKK0081A010.getString(SVC_KEI_NO))"]

    PUTSVC --> NEWUCWK["NEW: svc_kei_ucwk_info_Map"]

    NEWUCWK --> PUTUCWK["SET: svc_kei_ucwk_info_Map.put(svc_kei_ucwk_no, msgEKK0161B004.getString(SVC_KEI_UCWK_NO))"]

    PUTUCWK --> PUTDTM["SET: svc_kei_ucwk_info_Map.put(chaf_svc_kei_ucwk_gene_add_dtm, msgEKK0161B004.getString(GENE_ADD_DTM))"]

    PUTDTM --> NEWSOD["NEW: sod_map"]

    NEWSOD --> COMPOSER["SET: sod_map.put(sod_kihon_info, sod_kihon_info_Map)"]

    COMPOSER --> COMPOSES["SET: sod_map.put(svc_kei_info, svc_kei_info_Map)"]

    COMPOSES --> COMPOSEU["SET: sod_map.put(svc_kei_ucwk_info, svc_kei_ucwk_info_Map)"]

    COMPOSES --> COMPOSEU["SET: sod_map.put(svc_kei_ucwk_info, svc_kei_ucwk_info_Map)"]

    COMPOSEU --> ADDLIST["EXEC: trgt_data_list.add(sod_map)"]

    ADDLIST --> FORINCR["Inc: i++"]

    FORINCR --> FORCHECK

    FORCHECK -- No --> SETFUNC["SET: outMap.put(func_code, JPCModelConstant.FUNC_CD_1)"]

    SETFUNC --> SETDATA["SET: outMap.put(trgt_data_list, trgt_data_list)"]

    SETDATA --> HAKKOCALL["CALL: hakkoSODCC.hakkoSOD(handle, param, HakkoSODCC)"]

    HAKKOCALL --> CHECKFLG{"workHakkoSODDataKeyFlg equals true?"}

    CHECKFLG -- Yes --> RECDATA["EXEC: param.removeData(HakkoSODCC)"]

    RECDATA --> END_NODE(["Return 0"])

    CHECKFLG -- No --> END_NODE
```

**Processing Summary:**

The method follows a linear builder pattern with one loop and one conditional cleanup:

1. **Initialization**: Declares 5 local HashMap/ArrayList variables to hold SOD data structures.
2. **Work key setup**: Sets a fixed work context key `"HakkoSODCC"` and calls `createUserData()` to determine whether the data key is newly created (`workHakkoSODDataKeyFlg`).
3. **SOD issuer instantiation**: Creates a `JKKHakkoSODCC` instance for delegation.
4. **Data extraction**: Retrieves the working output map from `param` under the work key.
5. **Per-item SOD assembly** (loop over `msgEKK0161B004List`): For each child message, builds three nested maps (basic info, service contract info, service contract sub-details), populates them with field values extracted from the parent and child messages, nests them into a `sod_map`, and appends to `trgt_data_list`.
6. **Metadata assignment**: Sets `func_code` to `JPCModelConstant.FUNC_CD_1` (functional code 1) and stores `trgt_data_list` in the output map.
7. **SOD issuance**: Delegates to `hakkoSODCC.hakkoSOD()` with the handle, param, and work key.
8. **Cleanup**: If the work data key was newly created (flag is true), removes the temporary data from `param`.
9. **Return**: Returns `0` (success code).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session handle carrying session context (e.g., transaction context, session state) used by the delegated `hakkoSOD()` call to maintain session continuity during SOD issuance. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing model groups and control maps. It holds the working data under the work key `"HakkoSODCC"` via `getData()` and `putData()`. Used to read and write the SOD payload, and to clean up temporary data via `removeData()`. |
| 3 | `msgEKK0081A010` | `CAANMsg` | Parent CAAN message object (corresponding to screen/data ID `EKK0081A010`) containing shared context data for the pause reception transaction: SYSID (system ID) and SVC_KEI_NO (service contract number), plus GENE_ADD_DTM (generation/addition datetime). Extracted once per loop iteration. |
| 4 | `msgEKK0161B004List` | `CAANMsg[]` | Array of child CAAN messages (corresponding to data ID `EKK0161B004`), each representing one service contract sub-detail line item to be included in the SOD issuance. The loop iterates over this array, creating one SOD map per entry. |

**External / instance state read:**
- None. The method is self-contained; it does not read any instance fields. All external state is accessed via method parameters and the `createUserData()` helper (which accesses `param`), and the `JKKHakkoSODCC` instance constructor (stateless new instance).

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| CALL | `JKKPauseReceptCC.createUserData` | (internal) | - | Calls `createUserData(param, workFixedText)` — determines whether the work data key is newly created. Returns boolean flag for cleanup. |
| R | `IRequestParameterReadWrite.getData` | (internal) | - | Calls `param.getData("HakkoSODCC")` — retrieves the working HashMap from the parameter object for subsequent population. |
| CALL | `JKKHakkoSODCC.hakkoSOD` | (internal) | SOD (Service Order Data) | Calls `hakkoSOD(handle, param, "HakkoSODCC")` — the core SOD issuance call that performs the actual SOD creation/registration in the backend. Delegates all database-level operations to `JKKHakkoSODCC`. |
| R | `CAANMsg.getString` (EKK0081A010CBSMsg1List) | EKK0081A010SC | - | Reads SYSID, SVC_KEI_NO, GENE_ADD_DTM from the parent message. Extracted once per loop iteration from `msgEKK0081A010`. |
| R | `CAANMsg.getString` (EKK0161B004CBSMsg1List) | EKK0161B004SC | - | Reads SVC_KEI_UCWK_NO from child message. Extracted once per loop iteration from each `msgEKK0161B004` element. |
| EXEC | `IRequestParameterReadWrite.removeData` | (internal) | - | Calls `param.removeData("HakkoSODCC")` — cleanup operation, removes temporary work data if it was newly created. |

**CRUD Classification:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| CALL | `JKKPauseReceptCC.createUserData` | N/A | - | Determines if work data key is new (creates if absent). Returns flag controlling subsequent cleanup. |
| R | `param.getData` | N/A | - | Retrieves working map from parameter under work key "HakkoSODCC". |
| R | `msgEKK0081A010.getString(SYSID)` | EKK0081A010SC | - | Reads system ID from parent message for SOD basic info. |
| R | `msgEKK0081A010.getString(SVC_KEI_NO)` | EKK0081A010SC | - | Reads service contract number from parent message for service contract info. |
| R | `msgEKK0081A010.getString(GENE_ADD_DTM)` | EKK0081A010SC | - | Reads generation/addition datetime from parent message for sub-details timestamp. |
| R | `msgEKK0161B004.getString(SVC_KEI_UCWK_NO)` | EKK0161B004SC | - | Reads service contract sub-detail number from each child message. |
| CALL | `JKKHakkoSODCC.hakkoSOD` | N/A | SOD | Delegates SOD issuance — the primary business operation that creates/registers SOD records in the backend system. |
| EXEC | `param.removeData` | N/A | - | Cleanup: removes temporary work data if newly created by `createUserData`. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKPauseReceptCC.pauseReceptuCtrlTran` | `pauseReceptuCtrlTran()` -> `executeHakkoSodCC(handle, param, msgEKK0081A010, msgEKK0161B004List)` | `hakkoSOD [CALL] SOD`, `getString [R] SYSID`, `getString [R] SVC_KEI_NO`, `getString [R] GENE_ADD_DTM`, `getString [R] SVC_KEI_UCWK_NO`, `createUserData [CALL] -`, `removeData [EXEC] -` |

**Notes:**
- No screen (KKSV*) or batch (KKRV*) entry points were found within 8 hops. The direct caller is `pauseReceptuCtrlTran()`, which is a transaction control method within `JKKPauseReceptCC` itself. This method operates at the CBS (Common Business Service) layer, internal to the pause reception transaction flow.
- Terminal operations from this method reach: `hakkoSOD()` (SOD issuance, the primary data-write operation), multiple `getString()` calls (reads from message objects), `createUserData()` (internal data key management), and `removeData()` (cleanup).

## 6. Per-Branch Detail Blocks

**Block 1** — [INIT/DECL] `(lines 830-833)`
Local variable declarations and initializations for SOD data structures.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `HashMap<String, Object> sod_map = new HashMap<>()` // SOD map (SODマップ) |
| 2 | NEW | `ArrayList<Object> trgt_data_list = new ArrayList<>()` // target data list (対象データリスト) |
| 3 | NEW | `HashMap<String, Object> sod_kihon_info_Map = new HashMap<>()` // SOD basic info map (SOD基本情報マップ) |
| 4 | NEW | `HashMap<String, Object> svc_kei_info_Map = new HashMap<>()` // service contract info map (サービス契約情報マップ) |
| 5 | NEW | `HashMap<String, Object> svc_kei_ucwk_info_Map = new HashMap<>()` // service contract sub-details info map (サービス契約内詳情報マップ) |

**Block 2** — [SET] `(line 835-836)`
Sets up the work context key and determines whether the work data key is newly created.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String workFixedText = "HakkoSODCC"` // Work fixed text for SOD issuance (SOD用データ作成) |
| 2 | CALL | `boolean workHakkoSODDataKeyFlg = createUserData(param, workFixedText)` // Determines if data key is new (createUserData result) |

**Block 3** — [NEW] `(line 838)`
Instantiates the SOD issuance service component for delegation.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `JKKHakkoSODCC hakkoSODCC = new JKKHakkoSODCC()` // SOD issuance component instance |

**Block 4** — [EXEC] `(line 840-841)`
Retrieves the working output map from the parameter object.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HashMap outMap = (HashMap) param.getData(workFixedText)` // User data info retrieval (ユーザデータ情報) |

**Block 5** — [FOR] `(lines 843-870)`
Loop over the child message array to assemble SOD data for each line item. The condition is `i < msgEKK0161B004List.length`.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int i = 0; i < msgEKK0161B004List.length; i++)` // Iterates over each service contract sub-detail message |
| 2 | GET | `CAANMsg msgEKK0161B004 = msgEKK0161B004List[i]` // Current child message in iteration |

**Block 5.1** — [nested: SOD basic info map setup] `(lines 844-847)`
Creates and populates the SOD basic info map with the hardcoded movement division code for suspension reception.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `sod_kihon_info_Map = new HashMap<String, Object>()` // Reset map for each iteration (SOD基本情報マップ設定) |
| 2 | SET | `sod_kihon_info_Map.put("ido_div", "00024")` // Movement division: suspension reception (異動区分：休止受付) [->ido_div="00024"] |
| 3 | SET | `sod_kihon_info_Map.put("sysid", msgEKK0081A010.getString(EKK0081A010CBSMsg1List.SYSID))` // System ID from parent message [-> SYSID from EKK0081A010CBSMsg1List (EKK0081A010CBSMsg1List.java:183,819)] |

**Block 5.2** — [nested: Service contract info map setup] `(lines 848-850)`
Creates and populates the service contract info map.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `svc_kei_info_Map = new HashMap<String, Object>()` // Reset map for each iteration (サービス契約情報マップ設定) |
| 2 | SET | `svc_kei_info_Map.put("svc_kei_no", msgEKK0081A010.getString(EKK0081A010CBSMsg1List.SVC_KEI_NO))` // Service contract number from parent message [-> SVC_KEI_NO from EKK0081A010CBSMsg1List] |

**Block 5.3** — [nested: Service contract sub-details info map setup] `(lines 851-855)`
Creates and populates the service contract sub-details info map with sub-detail number and change-generation timestamp.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `svc_kei_ucwk_info_Map = new HashMap<String, Object>()` // Reset map for each iteration (サービス契約内詳情報マップ設定) |
| 2 | SET | `svc_kei_ucwk_info_Map.put("svc_kei_ucwk_no", msgEKK0161B004.getString(EKK0161B004CBSMsg1List.SVC_KEI_UCWK_NO))` // Service contract sub-detail number [-> SVC_KEI_UCWK_NO from EKK0161B004CBSMsg1List] |
| 3 | SET | `svc_kei_ucwk_info_Map.put("chaf_svc_kei_ucwk_gene_add_dtm", msgEKK0161B004.getString(EKK0081A010CBSMsg1List.GENE_ADD_DTM))` // Post-change service contract sub-detail generation-addition datetime (変更後サービス契約内詳世代登録年月日时分秒) [-> GENE_ADD_DTM from EKK0081A010CBSMsg1List] |

**Block 5.4** — [nested: SOD map assembly and list addition] `(lines 856-861)`
Assembles the nested SOD map and adds it to the target data list.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `sod_map = new HashMap<String, Object>()` // Reset map for each iteration (SODマップ設定) |
| 2 | SET | `sod_map.put("sod_kihon_info", sod_kihon_info_Map)` // Nest basic info map |
| 3 | SET | `sod_map.put("svc_kei_info", svc_kei_info_Map)` // Nest service contract info map |
| 4 | SET | `sod_map.put("svc_kei_ucwk_info", svc_kei_ucwk_info_Map)` // Nest service contract sub-details info map |
| 5 | EXEC | `trgt_data_list.add(sod_map)` // Append assembled SOD map to target data list |

**Block 6** — [SET] `(lines 863-864)`
Sets functional code and target data list in the output map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outMap.put("func_code", JPCModelConstant.FUNC_CD_1)` // Functional code set to 1 [-> JPCModelConstant.FUNC_CD_1] |
| 2 | SET | `outMap.put("trgt_data_list", trgt_data_list)` // Stores the assembled target data list |

**Block 7** — [CALL] `(line 866)`
Delegates SOD issuance to the dedicated SOD component.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `hakkoSODCC.hakkoSOD(handle, param, workFixedText)` // Core SOD issuance call (SOD発注処理) |

**Block 8** — [IF] `(lines 868-870)`
Conditional cleanup: removes temporary work data only if it was newly created by `createUserData()`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (workHakkoSODDataKeyFlg)` // If the work data key was newly created |
| 2 | EXEC | `param.removeData(workFixedText)` // Removes temporary work data from param [-> "HakkoSODCC"] |

**Block 9** — [RETURN] `(line 873)`
Method completion — returns success code.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return 0` // Success return code (リターンコード) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sod_map` | Field | SOD data map — a HashMap containing the nested SOD record structure (basic info, service contract info, service contract sub-details) for a single SOD entry |
| `trgt_data_list` | Field | Target data list — an ArrayList holding all assembled SOD maps, one per service contract sub-detail line item |
| `sod_kihon_info_Map` | Field | SOD basic info map — contains the foundational SOD fields: movement division (`ido_div`) and system ID (`sysid`) |
| `svc_kei_info_Map` | Field | Service contract info map — contains the service contract number (`svc_kei_no`) associated with the pause reception transaction |
| `svc_kei_ucwk_info_Map` | Field | Service contract sub-details info map — contains the sub-detail number (`svc_kei_ucwk_no`) and the change-generation datetime (`chaf_svc_kei_ucwk_gene_add_dtm`) |
| `ido_div` | Field | Movement division code — classifies the type of service change. Value `"00024"` specifically represents "suspension reception" (休止受付), meaning the service order is for registering a service suspension |
| `sysid` | Field | System ID — identifier of the system processing this service order |
| `svc_kei_no` | Field | Service contract number — the unique identifier for the service contract line item |
| `svc_kei_ucwk_no` | Field | Service contract sub-detail number — the unique identifier for a specific sub-detail within a service contract line item |
| `chaf_svc_kei_ucwk_gene_add_dtm` | Field | Post-change service contract sub-detail generation-addition datetime — the timestamp when the changed sub-detail was registered |
| `func_code` | Field | Functional code — operation type indicator. Value `JPCModelConstant.FUNC_CD_1` typically represents "new registration" or "creation" mode |
| `workFixedText` | Field | Work context key — a fixed string `"HakkoSODCC"` used as the map key to store/retrieve working data in the parameter object |
| `workHakkoSODDataKeyFlg` | Field | Work data key creation flag — boolean returned by `createUserData()` indicating whether the work data key was newly created in this invocation |
| SOD | Acronym | Service Order Data — the telecom service order entity that encapsulates service contract information for order fulfillment |
| CAANMsg | Type | CAAN Message — a message object carrying field data between screens, CBS (Common Business Service), and database layers |
| SessionHandle | Type | Session handle — carries session/transaction context (e.g., database connection, transaction state) across method calls |
| IRequestParameterReadWrite | Type | Request parameter interface — provides get/put/remove access to request-scoped data maps, used for inter-method data passing |
| JKKHakkoSODCC | Class | SOD Issuance CC — the dedicated common component that handles actual SOD creation/registration logic |
| `createUserData` | Method | Internal helper that ensures a working data map exists under a given key in `param`; returns true if the map was newly created |
| `hakkoSOD` | Method | Core SOD issuance method in `JKKHakkoSODCC` — performs the actual SOD record creation and persistence |
| FUNC_CD_1 | Constant | Functional code value 1 — indicates the operation mode (typically new registration / issuance) |
| EKK0081A010 | Message ID | Parent message/data identifier for the pause reception main screen — carries shared context (SYSID, SVC_KEI_NO, GENE_ADD_DTM) |
| EKK0161B004 | Message ID | Child message/data identifier for the pause reception detail items — one per service contract sub-detail line |