# Business Logic — JKKFmtcelMskmInfoTrkmCC.callHakkoSodCC() [52 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKFmtcelMskmInfoTrkmCC` |
| Layer | CC / Common Component (Package: `com.fujitsu.futurity.bp.custom.common`, source path `koptBp/ejbModule` — deployed as an EJB business component) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKFmtcelMskmInfoTrkmCC.callHakkoSodCC()

This method is the SOD (Service Order Data) issuance entry point for **Femto Cell cancellation operations** within the K-Opticom customer core system. It acts as a **service order builder and delegator**: it constructs a complete SOD payload from data held in the work map, then delegates the actual order issuance to `JKKHakkoSODCC.hakkoSOD()`. The SOD process type is hardcoded to `"00031"`, which represents the **Femto Cell Cancellation** service type in the system's order routing taxonomy. The method prepares five interconnected information segments — SOD basic info, service contract info, service contract details, option service contract info, and equipment provision service contract info — all assembled into a single `trgt_data_list` that the downstream SOD issuance engine processes as one atomic order. When the `isDsl` flag is `true` (indicating a Femto Cell disconnection scenario, i.e., フेमトセルオプション解約), the method also populates the pre-change option service contract number, preserving the state before the cancellation takes effect. This method is called exclusively from within `JKKFmtcelMskmInfoTrkmCC` itself (specifically `excuteAdd()` and `excuteDsl()`), making it a shared internal dispatch helper for Femto Cell-related service contract changes.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["callHakkoSodCC params"])
    START --> INIT["Initialize Maps: sodMap, sodDataList, sodTrgtData"]
    INIT --> SOD_BASIC["Set SOD Basic Info"]
    SOD_BASIC --> SVC_INFO["Set Service Contract Info"]
    SVC_INFO --> SVC_DETAIL["Set Service Contract Details"]
    SVC_DETAIL --> OPT_INFO["Set Option Service Contract Info"]
    OPT_INFO --> CHECK_DSL{isDsl<br/>Femto<br/>Cancellation?}
    CHECK_DSL -->|true| SET_CHBF["Set Pre-change OpSvcNo"]
    SET_CHBF --> SET_CHAF["Set Post-change OpSvcNo"]
    CHECK_DSL -->|false| SET_CHAF
    SET_CHAF --> SET_GENE["Set Post-change GeneAddDtM"]
    SET_GENE --> MAP_OPT["sodMap.put opsvkei_info"]
    MAP_OPT --> EQ_INFO["Set Equipment Provision Service"]
    EQ_INFO --> MAP_EQ["sodMap.put kktsvkei_info"]
    MAP_EQ --> ADD_TO_LIST["sodDataList.add sodMap"]
    ADD_TO_LIST --> WRAP_TRGT["Wrap sodMap into sodTrgtData"]
    WRAP_TRGT --> CALL_SOD["Call hakkoSODCC.hakkoSOD"]
    CALL_SOD --> END_NODE(["Return void"])
```

**Constant Resolution:**
- `isDsl == true`: Indicates Femto Cell option cancellation (フemtoseルオプション解約). The system is processing a service disconnection where the pre-change option service contract number must be preserved.
- `FUNC_CD_1 = "1"`: A function code constant defined as a `private static final` field in `JKKFmtcelMskmInfoTrkmCC` (line 112), indicating a standard SOD issuance function.
- `JCMConstants.FUNC_CODE_KEY`: The map key for the function code, from `com.fujitsu.futurity.common.JCMConstants`.
- `INFO_IDO_DIV = "00031"`: The SOD process dispatch code for Femto Cell Cancellation — this value is hardcoded and determines how `hakkoSOD` routes the order internally.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object used to pass data downstream. Specifically, the method sets the assembled SOD payload into it via `param.setData("sodTrgtData", sodTrgtData)`, making the data available to the called `hakkoSOD` method. |
| 2 | `handle` | `SessionHandle` | The session handle for database/connection management. It is forwarded directly to `hakkoSODCC.hakkoSOD()` for use in database and service component calls. |
| 3 | `work` | `HashMap<String, Object>` | The working data map containing business data extracted from prior processing steps. It provides key values: `sysid` (system identifier), `svc_kei_no` (service contract number), `op_svc_kei_no` (option service contract number), and `gene_add_dtm` (generation/addition timestamp). These values are read and embedded into the SOD payload. |
| 4 | `isDsl` | `boolean` | Femto Cell cancellation flag (フェムトセルキャンセルかどうか). When `true`, the method populates the pre-change option service contract number (`chbf_opsvkei_no`) alongside the post-change values, preserving the pre-cancellation state for audit and reconciliation purposes. |

**Instance fields / external state read:**
- `FUNC_CD_1` (private static final String = `"1"`): Function code constant used to identify the SOD issuance operation type.

## 4. CRUD Operations / Called Services

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

| # | Operation Type | Called Method | SC / CBS | Entity / DB | Operation Description |
|---|----------------|---------------|----------|-------------|----------------------|
| 1 | **C (Create)** | `JKKHakkoSODCC.hakkoSOD` | JKKHakkoSODCC | SOD (Service Order Data) | Issues the complete SOD (Service Order Data) to the order processing engine. The SOD payload built by this method — containing basic info, service contract info, option service contract info, and equipment provision service info — is submitted as a single atomic order creation request. |

### Descendant operations (from `hakkoSODCC.hakkoSOD()`):

| # | Operation Type | Called Method | SC / CBS | Entity / DB | Operation Description |
|---|----------------|---------------|----------|-------------|----------------------|
| 2 | **U (Update)** | `JBSbatAKKshkmRsltInfoTukiawsday.setData` | JBSbatAKKshkmRsltInfoTukiawsday | - | Sets data for daily aggregation result info (synchronization/updates daily summary records). |
| 3 | **U (Update)** | `JBSbatAKKshkmRsltInfoTukiaws.setData` | JBSbatAKKshkmRsltInfoTukiaws | - | Sets data for weekly aggregation result info (synchronization/updates weekly summary records). |
| 4 | **U (Update)** | `JBSbatAKKshkmRsltInfoTukiawsRealSkh.setData` | JBSbatAKKshkmRsltInfoTukiawsRealSkh | - | Sets data for actual schedule aggregation result info (synchronization/updates schedule-based records). |
| 5 | **U (Update)** | `JBSbatKKGetCTITelno.setData` | JBSbatKKGetCTITelno | - | Sets data for Citi (customer) telephone number retrieval (synchronization/updates contact records). |
| 6 | **U (Update)** | `JBSbatKKGetCTITelno` (via `JBSbatKKGetCTITelno.setData`) | JBSbatKKGetCTITelno | - | Sets data for Citi (customer) telephone number retrieval (synchronization/updates contact records). |
| 7 | **U (Update)** | `JBSbatKKGetCTITelno.setData` | JBSbatKKGetCTITelno | - | Sets data for Citi (customer) telephone number retrieval (synchronization/updates contact records). |

> **Note:** This method itself does not directly perform database CRUD operations. It is purely a **SOD payload builder** that delegates all database persistence to `JKKHakkoSODCC.hakkoSOD()`. The descendant operations listed above are performed inside `hakkoSOD()`.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKFmtcelMskmInfoTrkmCC.excuteAdd()` | `excuteAdd()` -> `callHakkoSodCC()` | `hakkoSOD [C] SOD` |
| 2 | CBS: `JKKFmtcelMskmInfoTrkmCC.excuteDsl()` | `excuteDsl()` -> `callHakkoSodCC()` | `hakkoSOD [C] SOD` |

**Call chain context:**
- `excuteAdd()`: The add/registration entry point. This path handles the case where a new Femto Cell-related service contract is being registered, and the SOD needs to be issued as part of the add flow.
- `excuteDsl()`: The DSL (disconnection/cancellation) entry point. This path handles the Femto Cell option cancellation scenario (`isDsl = true`), where the pre-change option service contract number must also be recorded.

**Terminal operations from this method:**
- `hakkoSOD` [C] — Service Order Data issuance (Create)
- `setData` [U] — Various data setting operations within the SOD chain

## 6. Per-Branch Detail Blocks

**Block 1** — [SET/INIT] (L513-L515)

> Initialize all local Map variables needed for SOD payload construction.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodMap = new HashMap<String, Object>()` // SOD payload container |
| 2 | SET | `sodDataList = new ArrayList<HashMap<String, Object>>()` // List to hold SOD data entries |
| 3 | SET | `sodTrgtData = new HashMap<String, Object>()` // Target data wrapper for SOD issuance |

**Block 2** — [SET] SOD Basic Info — `// SOD基本情報` (L518-L521)

> Build the SOD basic information segment, containing the system ID and the dispatch process code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodKihonInfo = new HashMap<String, Object>()` // SOD basic info map |
| 2 | EXEC | `sodKihonInfo.put(JKKHakkoSODConstCC.INFO_SYSID, (String)work.get("sysid"))` // Set system ID from work map [-> INFO_SYSID = "sysid"] |
| 3 | EXEC | `sodKihonInfo.put(JKKHakkoSODConstCC.INFO_IDO_DIV, "00031")` // Set dispatch process code to 00031 [-> INFO_IDO_DIV = "ido_div"]. This is hardcoded to "00031" (Femto Cell Cancellation process type) |
| 4 | EXEC | `sodMap.put(JKKHakkoSODConstCC.SOD_KIHON_INFO, sodKihonInfo)` // Attach SOD basic info to main payload map [-> SOD_KIHON_INFO = "sod_kihon_info"] |

**Block 3** — [SET] Service Contract Info — `// サービス契約情報` (L523-L527)

> Build the service contract info segment, carrying the service contract number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiInfo = new HashMap<String, Object>()` // Service contract info map |
| 2 | EXEC | `svcKeiInfo.put(JKKHakkoSODConstCC.INFO_SVC_KEI_NO, work.get("svc_kei_no"))` // Set service contract number from work map [-> INFO_SVC_KEI_NO = "svc_kei_no"] |
| 3 | EXEC | `sodMap.put(JKKHakkoSODConstCC.SVC_KEI_INFO, svcKeiInfo)` // Attach to main payload [-> SVC_KEI_INFO = "svc_kei_info"] |

**Block 4** — [SET] Service Contract Details — `// サービス契約内情情報` (L529-L531)

> Build an empty service contract details map. The details are not populated in this method — they remain as an empty map, likely because the SOD issuance process derives them from other sources.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiUcwkInfo = new HashMap<String, Object>()` // Empty service contract details map |
| 2 | EXEC | `sodMap.put(JKKHakkoSODConstCC.SVC_KEI_UCWK_INFO, svcKeiUcwkInfo)` // Attach to main payload [-> SVC_KEI_UCWK_INFO = "svc_kei_ucwk_info"] |

**Block 5** — [SET/INIT] Option Service Contract Info — `// オプションサービス契約情報` (L533-L535)

> Initialize the option service contract info map that will hold pre/post-change data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `opSvcKeiInfo = new HashMap<String, Object>()` // Option service contract info map |

**Block 6** — [IF] Femto Cell Option Cancellation Check — `// フェムトセルオプション解約の場合` (L537-L540)

> **Conditional branch:** When `isDsl == true`, the method records the pre-change option service contract number, preserving the state before cancellation. This is critical for audit trails and rollback scenarios.

| # | Type | Code |
|---|------|------|
| 1 | SET | `// 変更前オプションサービス契約番号` (Comment: Pre-change option service contract number) |
| 2 | EXEC | `opSvcKeiInfo.put(JKKHakkoSODConstCC.INFO_CHBF_OPSVKEI_NO, work.get("op_svc_kei_no"))` // Set pre-change option service contract number [-> INFO_CHBF_OPSVKEI_NO = "chbf_opsvkei_no"] |

**Block 7** — [SET] Post-change Option Service Contract Info — `// 変更後オプションサービス契約番号` (L542-L545)

> Regardless of the `isDsl` flag, this block always sets the post-change option service contract number and its generation timestamp.

| # | Type | Code |
|---|------|------|
| 1 | SET | `// 変更後オプションサービス契約番号` (Comment: Post-change option service contract number) |
| 2 | EXEC | `opSvcKeiInfo.put(JKKHakkoSODConstCC.INFO_CHAF_OPSVKEI_NO, work.get("op_svc_kei_no"))` // Set post-change option service contract number [-> INFO_CHAF_OPSVKEI_NO = "chaf_opsvkei_no"] |
| 3 | EXEC | `opSvcKeiInfo.put(JKKHakkoSODConstCC.INFO_CHAF_OPSVKEI_GENE_ADD_DTM, work.get("gene_add_dtm"))` // Set post-change generation/addition timestamp [-> INFO_CHAF_OPSVKEI_GENE_ADD_DTM = "chaf_opsvkei_gene_add_dtm"] |
| 4 | EXEC | `sodMap.put(JKKHakkoSODConstCC.OPSVKEI_INFO, opSvcKeiInfo)` // Attach to main payload [-> OPSVKEI_INFO = "opsvkei_info"] |

**Block 8** — [SET] Equipment Provision Service Contract Info — `// 機器提供サービス契約情報` (L547-L549)

> Initialize an empty equipment provision service contract info map. Like service contract details, this is populated elsewhere by the SOD issuance process.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktsvkeiInfo = new HashMap<String, Object>()` // Equipment provision service contract info map |
| 2 | EXEC | `sodMap.put(JKKHakkoSODConstCC.KKTSVKEI_INFO, kktsvkeiInfo)` // Attach to main payload [-> KKTSVKEI_INFO = "kktsvkei_info"] |

**Block 9** — [EXEC] Wrap and Assemble — (L551-L554)

> Assemble all data into the target data list, set the function code, and prepare for SOD issuance.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `sodDataList.add(sodMap)` // Add the assembled SOD payload to the target data list |
| 2 | EXEC | `sodTrgtData.put(JKKHakkoSODConstCC.TRGT_DATA_LIST, sodDataList)` // Wrap sodDataList into sodTrgtData [-> TRGT_DATA_LIST = "trgt_data_list"] |
| 3 | EXEC | `sodTrgtData.put(JCMConstants.FUNC_CODE_KEY, FUNC_CD_1)` // Set function code to "1" [-> FUNC_CD_1 = "1", FUNC_CODE_KEY from JCMConstants] |

**Block 10** — [CALL] SOD Issuance — `// サービスオーダ発行CCを呼び出す` (L555-L558)

> Instantiate the SOD issuance component and delegate the actual order creation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `hakkoSODCC = new JKKHakkoSODCC()` // Create new SOD issuance component instance [// サービスオーダ発行CC] |
| 2 | EXEC | `param.setData("sodTrgtData", sodTrgtData)` // Set assembled SOD payload into param for downstream consumption |
| 3 | CALL | `hakkoSODCC.hakkoSOD(handle, param, "sodTrgtData")` // Call SOD issuance — this is the terminal operation that creates the Service Order Data |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| SOD | Acronym | Service Order Data — the central telecom order fulfillment entity that triggers downstream provisioning, billing, and service activation workflows. |
| hakkoSOD | Method/Field | "Hakko" (発行) = Issuance. The `hakkoSOD` method in `JKKHakkoSODCC` issues a Service Order Data record to the order processing engine. |
| `ido_div` | Field | Dispatch division code — determines the SOD process type. Value `"00031"` maps to Femto Cell Cancellation. |
| `svc_kei_no` | Field | Service contract number — the unique identifier for a customer's service contract line item. |
| `op_svc_kei_no` | Field | Option service contract number — the unique identifier for an option service contract (e.g., Femto Cell option). |
| `chbf_opsvkei_no` | Field | "Chbf" (変更前) = Before-change. Pre-change option service contract number — the contract number as it existed before the cancellation. Preserved for audit purposes. |
| `chaf_opsvkei_no` | Field | "Chaf" (変更後) = After-change. Post-change option service contract number — the contract number after the cancellation. |
| `chbf_opsvkei_gene_add_dtm` | Field | "Gene_add_dtm" (生成登録日時) = Generation registration datetime. The timestamp when the post-change contract was registered. |
| `sysid` | Field | System identifier — identifies the system or subsystem that generated the SOD. |
| `isDsl` | Parameter | "Dsl" = Disconnection. Boolean flag indicating whether this is a Femto Cell disconnection/cancellation scenario (フェムトセルオプション解約). When `true`, pre-change data is recorded. |
| `gene_add_dtm` | Field | Generation addition datetime — the timestamp when a service contract line item was created or modified. |
| `FUNC_CD_1` | Constant | Function code constant with value `"1"`. Used to identify standard SOD issuance operations within the system. |
| `opsvkei_info` | Field | Option service contract info — the SOD payload segment containing pre/post-change option service contract details. |
| `kktsvkei_info` | Field | Equipment provision service contract info — the SOD payload segment for equipment-related service contracts. |
| `svc_kei_ucwk_info` | Field | Service contract detail info — the SOD payload segment for service contract line-item details. |
| `sod_kihon_info` | Field | SOD basic info — the SOD payload segment containing system-level metadata (system ID, dispatch code). |
| TRGT_DATA_LIST | Constant | "Target data list" — the map key (`"trgt_data_list"`) used to store the list of SOD target data entries. |
| K-Opticom | Business term | Japanese telecommunications operator providing broadband, VoIP, and mobile services. |
| Femto Cell | Business term | A small cellular base station (femtocell) used to improve indoor mobile coverage. Cancelling this option triggers the SOD issuance flow documented here. |
| `excuteAdd` | Method | Service contract addition/registration entry point (note: named "excute" with a typo in the source code). |
| `excuteDsl` | Method | DSL (disconnection) entry point for Femto Cell cancellation (note: named "excute" with a typo in the source code). |
| CC | Acronym | Common Component — a reusable business component class in the K-Opticom architecture. |
| `trgt_data_list` | Field | Target data list — the key in the work map holding the list of SOD data to be issued. |
