# Business Logic — JKKMltiseInfoAddCfmCC.mainProc() [231 LOC]

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

## 1. Role

### JKKMltiseInfoAddCfmCC.mainProc()

This method orchestrates the complete registration flow for adding multi-service information (multiple service contracts) to the system. It serves as the central business coordinator for a complex telecom service contract registration workflow that handles FTTH (Fiber To The Home), optional ISP (Internet Service Provider) registration, and related service agreement operations. The method implements a **sequential delegation pattern** — it calls a series of service IF (Interface) methods in a defined order, each responsible for a specific business sub-task in the service contract lifecycle.

The method supports multiple service contract statuses, routing processing based on the current state of each service contract detail record: **inquiry** (pending agreement), **agreement closed** (teiketsuzumi), **service active** (teikyo), and **contract cancellation** (tkchuka). Within the loop that iterates over service contract details, it dynamically selects which sub-processes to execute based on each contract's status.

Key design pattern: **routed dispatch via status-driven conditionals** — the method uses helper methods like `equalsShosazumi()`, `isTeiketsuzumi()`, `isTeikyo()`, and `isUketsukezumi()` to determine which SC codes to invoke for each service contract line item. Additionally, `FUNC_CD` (function code) is checked in certain branches to gate operations to a specific function context (FUNC_CD_1 = "1", typically indicating the primary registration function). The method ultimately issues a Service Order Data (SOD) after all contract processing is complete, and registers the progress record.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["mainProc params"])
    INIT["Initialize: resultHash, serviceHashes, sodDataList, status"]
    GET_DATA["param.getData ADDMLTISEINFO"]
    STEP1["Step 1: getEKK0081A010Map - Service Contract Agreement S-IF"]
    CHECK_1{statusCode not zero?}
    UPDATE1["setSvKeiExUpdDtm EKK0081A010"]
    FETCH_1["eKK0081A010SCHash from resultHash"]
    STEP2["Step 2: getEKK0011D020Map - Application Content Registration"]
    CHECK_2{statusCode not zero?}
    UPDATE2["inHash.put EX_MSKM_UPD_DTM"]
    STEP3["Step 3: getEKK0161B001Map - Service Contract Details List"]
    CHECK_3{statusCode not zero?}
    FETCH_LIST["ucwkList from resultHash EKK0161B001"]
    LOOP_START["For each ucwkList item"]
    SET_EMPTY["svc_kei_ucwk_no empty, ucwkStat empty"]
    FETCH_FIELDS["Get SVC_KEI_UCWK_NO, GENE_ADD_DTM, SVC_KEI_UCWK_STAT"]
    CHECK_STAT{SVC_KEI_STAT_TKC equals ucwkStat and length equals 2?}
    SET_SKY["skjYkgt equals 01"]
    PUT_HASH["inHash.put SVC_KEI_UCWK_NO, GENE_ADD_DTM_SVC_KEI_UCWK"]
    STEP4A["Step 4a: getEKK0171A010Map - Service Contract Info ISP"]
    CHECK_4A{statusCode not zero?}
    STEP4B["Step 4b: getEKK0361D010Map - Option Service ISP Registration"]
    CHECK_4B{statusCode not zero?}
    UPDATE4["setSvKeiExUpdDtm and setGeneAddDtm EKK0361D010"]
    STEP5["Step 5: getEKK0361C010Map - Option Service ISP Inquiry"]
    CHECK_5{equalsShosazumi ucwkStat?}
    UPDATE5["setSvKeiExUpdDtm and setGeneAddDtm EKK0361C010"]
    STEP6A["Step 6: getEKK0361C030Map - Option Service ISP Inquiry Closing"]
    CHECK_6{isTeiketsuzumi ucwkStat and FUNC_CD equals FUNC_CD_1?}
    UPDATE6["setSvKeiExUpdDtm and setGeneAddDtm EKK0361C030"]
    STEP7A["Step 7: getEKK0361C040Map - Option Service ISP Start"]
    CHECK_7{isTeikyo ucwkStat and FUNC_CD equals FUNC_CD_1?}
    UPDATE7["setSvKeiExUpdDtm and setGeneAddDtm EKK0361C040"]
    STEP8A["Step 8: editSODHakko - SOD Data Preparation"]
    SET_TRGT["sodTrgtData.put TRGT_DATA_LIST and FUNC_CODE_KEY"]
    CALL_SOD["hakkoSODCC.hakkoSOD"]
    STEP9A["Step 9: getEKK0021C060Map - Application Detail Inquiry"]
    CHECK_9{isUketsukezumi ucwkStat?}
    STEP9B["Step 9b: getEKK0021C060Map if FUNC_CD equals FUNC_CD_1"]
    STEP10["Step 10: addPrg - Progress Registration"]
    END(["Return statusCode"])
    START --> INIT
    INIT --> GET_DATA
    GET_DATA --> STEP1
    STEP1 --> CHECK_1
    CHECK_1 -- Yes --> END
    CHECK_1 -- No --> UPDATE1
    UPDATE1 --> FETCH_1
    FETCH_1 --> STEP2
    STEP2 --> CHECK_2
    CHECK_2 -- Yes --> END
    CHECK_2 -- No --> UPDATE2
    UPDATE2 --> STEP3
    STEP3 --> CHECK_3
    CHECK_3 -- Yes --> END
    CHECK_3 -- No --> FETCH_LIST
    FETCH_LIST --> LOOP_START
    LOOP_START --> SET_EMPTY
    SET_EMPTY --> FETCH_FIELDS
    FETCH_FIELDS --> CHECK_STAT
    CHECK_STAT -- Yes --> SET_SKY
    CHECK_STAT -- No --> PUT_HASH
    SET_SKY --> PUT_HASH
    PUT_HASH --> STEP4A
    STEP4A --> CHECK_4A
    CHECK_4A -- Yes --> END
    CHECK_4A -- No --> STEP4B
    STEP4B --> CHECK_4B
    CHECK_4B -- Yes --> END
    CHECK_4B -- No --> UPDATE4
    UPDATE4 --> STEP5
    STEP5 --> CHECK_5
    CHECK_5 -- Yes --> UPDATE5
    CHECK_5 -- No --> STEP6A
    UPDATE5 --> STEP6A
    STEP6A --> CHECK_6
    CHECK_6 -- Yes --> UPDATE6
    CHECK_6 -- No --> STEP7A
    UPDATE6 --> STEP7A
    STEP7A --> CHECK_7
    CHECK_7 -- Yes --> UPDATE7
    CHECK_7 -- No --> STEP8A
    UPDATE7 --> STEP8A
    STEP8A --> SET_TRGT
    SET_TRGT --> CALL_SOD
    CALL_SOD --> STEP9A
    STEP9A --> CHECK_9
    CHECK_9 -- No --> STEP9B
    CHECK_9 -- Yes --> STEP10
    STEP9B --> STEP10
    STEP10 --> END
```

**Block-by-block description:**

1. **Initialization (L267-296):** Initialize local variables including `resultHash`, service-specific hash maps (`eKK0081A010SCHash`, `eKK0361D010SCHash`, `eKK0361A010SCHash`, `eKK0341B002SCHash`, `eKK0161B001SCHash`), `sodDataList`, and status code. Extract operating start date (`unyoYmd`) from `inHash` and use `getStrymd()` to retrieve the utilization start date. Determine `isSokuji` (instant reflection flag) by comparing `unyoYmd` with the utilization start date. Fetch business data from `param.getData(ADDMLTISEINFO)`.

2. **Step 1 — Service Contract Agreement S-IF (L303-311):** Call `getEKK0081A010Map` to execute the service contract agreement Service-IF. On error, return immediately. Update the last-modified date via `setSvKeiExUpdDtm`. Retrieve the result hash.

3. **Step 2 — Application Content Registration (L317-324):** Call `getEKK0011D020Map` for application content registration. On error, return immediately. Update the `EX_MSKM_UPD_DTM` in `inHash`.

4. **Step 3 — Service Contract Details List (L331-393):** Call `getEKK0161B001Map` to fetch the list of service contract details (latest and cancelled). For each item in the list:
   - Extract `svc_kei_ucwk_no` (service contract detail number), `gene_add_dtm_svc_kei_ucwk` (generation timestamp), and `ucwkStat` (work status).
   - If the status equals `SVC_KEI_STAT_TKC = "100"` and there are exactly 2 items, set `skjYkgt = "01"`.
   - Put `svc_kei_ucwk_no` and `gene_add_dtm_svc_kei_ucwk` back into `inHash`.
   - Within the loop, call `getEKK0171A010Map` (service contract info for ISP) and `getEKK0361D010Map` (option service ISP registration), updating timestamps after each.

5. **Step 5 — Option Service ISP Inquiry (L386-395):** If `equalsShosazumi(ucwkStat)` returns true (agreement pending), call `getEKK0361C010Map` for ISP inquiry and update timestamps.

6. **Step 6 — Option Service ISP Inquiry Closing (L403-414):** If `isTeiketsuzumi(ucwkStat)` is true AND `FUNC_CD` equals `"1"`, call `getEKK0361C030Map` for inquiry closing and update timestamps.

7. **Step 7 — Option Service ISP Start (L422-434):** If `isTeikyo(ucwkStat)` is true AND `FUNC_CD` equals `"1"`, call `getEKK0361C040Map` for service start, passing `skjYkgt` as an additional parameter, and update timestamps.

8. **Step 8 — SOD Issuance (L442-457):** If `unyoYmd` equals `strYmd` (start date equals operating date), call `editSODHakko` to prepare SOD data. After the loop, build `sodTrgtData` and call `hakkoSODCC.hakkoSOD()` to issue the Service Order Data.

9. **Step 9 — Application Detail Inquiry (L463-472):** If `isUketsukezumi(ucwkStat)` is false (not yet accepted) AND `FUNC_CD` equals `"1"`, call `getEKK0021C060Map` for application detail inquiry.

10. **Step 10 — Progress Registration (L479-480):** Call `addPrg` to register the progress record, passing the result hash, service agreement hash, and `isSokuji` flag.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session handle carrying session manager context (e.g., database connection, transaction scope). Used for all SC method invocations. |
| 2 | `param` | `IRequestParameterReadWrite` | Parameter object containing model groups and control maps. Used to read business data via `getData(ADDMLTISEINFO)` and write SOD target data via `setData("sodTrgtData", sodTrgtData)`. |
| 3 | `inHash` | `HashMap<String, Object>` | Input hash map carrying business data between SC calls. Contains: `UNYO_YMD` (operating year/month/day), `SVC_KEI_NO` (service contract number), `SVC_KEI_UCWK_NO` (service contract detail number), `FUNC_CODE` (function code for routing), `IDO_DIV` (division classification), `SYSID` (system ID), and various date/timestamp fields. |
| 4 | `fixedText` | `String` | User-defined arbitrary string (yushi任意文字列). Passed through to SC calls and `addPrg` — likely used for audit trail or display purposes. |

**Extracted constant values:**

| Constant | Resolved Value | Source |
|----------|---------------|--------|
| `FUNC_CD_1` | `"1"` | `JPCModelConstant.FUNC_CD_1` — Primary function code |
| `SVC_KEI_STAT_TKC` | `"100"` | `JKKMltiseInfoAddCfmCC.SVC_KEI_STAT_TKC` — Contract cancellation status |

**Fields/External state read:**

| Field/Constant | Type | Business Description |
|---------------|------|---------------------|
| `UNYO_YMD` | String | Operating year/month/day — the scheduled start date for the service from `inHash` |
| `SYSID` | String | System ID extracted from `inHash` for SOD basic info |
| `IDO_DIV` | String | Division classification extracted from `inHash` for SOD routing |
| `SVC_KEI_NO` | String | Service contract number from `inHash` |
| `SVC_KEI_UCWK_NO` | String | Service contract detail number — set during loop, used in SOD info |
| `GENE_ADD_DTM_SVC_KEI_UCWK` | String | Generation/addition timestamp for service contract detail |
| `ADDMLTISEINFO` | String | Data key for multi-service info retrieval from `param` |
| `TEMPLATE_ID_EKK0081A010` | `"EKK0081A010"` | Template ID for service contract agreement |
| `TEMPLATE_ID_EKK0011D020` | Template ID for application content registration |
| `TEMPLATE_ID_EKK0161B001` | Template ID for service contract details list |
| `TEMPLATE_ID_EKK0361D010` | Template ID for option service ISP registration |
| `TEMPLATE_ID_EKK0361C010` | Template ID for option service ISP inquiry |
| `TEMPLATE_ID_EKK0361C030` | Template ID for option service ISP inquiry closing |
| `TEMPLATE_ID_EKK0361C040` | Template ID for option service ISP start |
| `EX_MSKM_UPD_DTM` | String | Extended mask update date/time key |
| `SVC_KEI_STAT_TKC` | `"100"` | Service contract status code for "contract cancellation" (tkchuka) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKMltiseInfoAddCfmCC.getEKK0081A010Map` | EKK0081A010SC | KK_T_SVC_KEI (Service Contract) | Retrieves service contract agreement data via S-IF |
| R | `JKKMltiseInfoAddCfmCC.getEKK0011D020Map` | EKK0011D020SC | KK_T_ODR_HAKKO_JOKEN (Order Registration/Cancellation) | Retrieves application content registration data |
| R | `JKKMltiseInfoAddCfmCC.getEKK0161B001Map` | EKK0161B001SC | KK_T_SVC_KEI_UCWK (Service Contract Details) | Retrieves service contract details list (latest and cancelled) |
| R | `JKKMltiseInfoAddCfmCC.getEKK0171A010Map` | EKK0171A010SC | KK_T_SVC_KEI_INFO (Service Contract Info) | Retrieves service contract info for ISP |
| R | `JKKMltiseInfoAddCfmCC.getEKK0361D010Map` | EKK0361D010SC | KK_T_OPSVKEI_ISP (Option Service ISP) | Retrieves option service ISP registration data |
| R | `JKKMltiseInfoAddCfmCC.getEKK0361C010Map` | EKK0361C010SC | KK_T_OPSVKEI_ISP (Option Service ISP) | Retrieves option service ISP inquiry data |
| R | `JKKMltiseInfoAddCfmCC.getEKK0361C030Map` | EKK0361C030SC | KK_T_OPSVKEI_ISP (Option Service ISP) | Retrieves option service ISP inquiry closing data |
| R | `JKKMltiseInfoAddCfmCC.getEKK0361C040Map` | EKK0361C040SC | KK_T_OPSVKEI_ISP (Option Service ISP) | Retrieves option service ISP start data |
| R | `JKKMltiseInfoAddCfmCC.getEKK0021C060Map` | EKK0021C060SC | KK_T_ODR_HAKKO_JOKEN (Order Registration/Cancellation) | Retrieves application detail inquiry data |
| U | `JKKMltiseInfoAddCfmCC.editSODHakko` | JKKHakkoSODCC | SOD data structure | Prepares and edits SOD (Service Order Data) map with service contract info |
| C | `JKKMltiseInfoAddCfmCC.addPrg` | - | KK_T_PRG (Progress/Registration) | Registers progress record for the multi-service info addition |
| C | `JKKHakkoSODCC.hakkoSOD` | JKKHakkoSODCC | KK_T_SOD (Service Order Data) | Issues the SOD (Service Order Data) to downstream processing |

**Timestamp update methods (internal helpers):**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKMltiseInfoAddCfmCC.setSvKeiExUpdDtm` | - | inHash (update timestamp) | Updates the last-modified date in `inHash` |
| U | `JKKMltiseInfoAddCfmCC.setGeneAddDtm` | - | inHash (generation timestamp) | Sets the generation/addition timestamp in `inHash` |
| R | `JKKMltiseInfoAddCfmCC.getStrymd` | - | inHash (start date) | Retrieves the utilization start date/year/month/day |
| R | `JKKMltiseInfoAddCfmCC.getUpdDtm` | - | resultHash (update timestamp) | Retrieves the update timestamp from result hash |

## 5. Dependency Trace

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

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

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKMltiseInfoAddCfmCC.execute()` | `execute()` -> `mainProc(handle, param, inHash, fixedText)` | `addPrg [C] KK_T_PRG`, `hakkoSOD [C] KK_T_SOD`, `getEKK0081A010Map [R] KK_T_SVC_KEI`, `getEKK0011D020Map [R] KK_T_ODR_HAKKO_JOKEN`, `getEKK0161B001Map [R] KK_T_SVC_KEI_UCWK`, `getEKK0361D010Map [R] KK_T_OPSVKEI_ISP`, `getEKK0021C060Map [R] KK_T_ODR_HAKKO_JOKEN` |

## 6. Per-Branch Detail Blocks

### Block 1 — IF (initialization) (L267-296)

> Initialize all local variables, extract operating dates, determine instant reflection flag.

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultHash = new HashMap<String, Object>()` |
| 2 | SET | `eKK0081A010SCHash = null` // service contract agreement result hash |
| 3 | SET | `eKK0361D010SCHash = null` // option service registration hash |
| 4 | SET | `eKK0361A010SCHash = null` // option service agreement hash |
| 5 | SET | `eKK0341B002SCHash = null` // equipment provision service agreement hash |
| 6 | SET | `eKK0161B001SCHash = null` // service contract details list hash |
| 7 | SET | `sodDataList = new ArrayList<HashMap<String, Object>>()` // SOD data list |
| 8 | SET | `statusCode = 0` |
| 9 | SET | `unyoYmd = (String)inHash.get(UNYO_YMD)` // operating year/month/day |
| 10 | SET | `strYmd = getStrymd(inHash)` // utilization start year/month/day |
| 11 | SET | `useStaYmd = getStrymd(inHash)` // instant reflection date |
| 12 | SET | `isSokuji = unyoYmd.equals(useStaYmd)` // instant reflection flag |
| 13 | SET | `kkseizo_no = null` |
| 14 | SET | `str_kibo_ymd = null` |
| 15 | SET | `svc_kei_ucwk_no = ""` // service contract detail number |
| 16 | SET | `gene_add_dtm_svc_kei_ucwk = null` // generation timestamp |
| 17 | EXEC | `dataMap = (HashMap<String, Object>)param.getData(ADDMLTISEINFO)` // get business data |

### Block 2 — IF (Step 1: getEKK0081A010Map) (L303-311)

> Execute service contract agreement S-IF. Return early on error.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = getEKK0081A010Map(handle, param, inHash, fixedText, resultHash)` |
| 2 | IF | `statusCode != 0` — [error branch, return immediately] |
| 3 | SET | Return `statusCode` on error |
| 4 | CALL | `setSvKeiExUpdDtm(inHash, resultHash, TEMPLATE_ID_EKK0081A010)` // update last-modified date |
| 5 | SET | `eKK0081A010SCHash = (HashMap<String, Object>)resultHash.get(TEMPLATE_ID_EKK0081A010)` // get result |

### Block 3 — IF (Step 2: getEKK0011D020Map) (L317-324)

> Register application content. Return early on error.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = getEKK0011D020Map(handle, param, inHash, fixedText, resultHash)` |
| 2 | IF | `statusCode != 0` — [error branch, return immediately] |
| 3 | SET | Return `statusCode` on error |
| 4 | SET | `inHash.put(EX_MSKM_UPD_DTM, getUpdDtm(resultHash, TEMPLATE_ID_EKK0011D020))` // update date |

### Block 4 — IF+FOR (Step 3: getEKK0161B001Map) (L331-457)

> Fetch service contract details list and iterate over each item.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = getEKK0161B001Map(handle, param, inHash, fixedText, resultHash)` |
| 2 | IF | `statusCode != 0` — [error branch, return] |
| 3 | SET | `ucwkList = (CAANMsg[])resultHash.get(TEMPLATE_ID_EKK0161B001)` |
| 4 | FOR | `for (int i = 0; i < ucwkList.length || i == 0; i++)` // iterate over contract details |

#### Block 4.1 — IF (null ucwkList item) (L349-354)

> If the current item's msgData is null, clear fields.

| # | Type | Code |
|---|------|------|
| 1 | IF | `eKK0161B001SCHash == null` |
| 2 | SET | `svc_kei_ucwk_no = ""` |
| 3 | SET | `gene_add_dtm_svc_kei_ucwk = ""` |
| 4 | SET | `ucwkStat = ""` |
| 5 | ELSE | Proceed to Block 4.2 |

#### Block 4.2 — ELSE (valid ucwkList item) (L357-366)

> Extract service contract detail fields from the current item.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_kei_ucwk_no = (String)eKK0161B001SCHash.get(EKK0161B001CBSMsg1List.SVC_KEI_UCWK_NO)` |
| 2 | SET | `gene_add_dtm_svc_kei_ucwk = (String)eKK0161B001SCHash.get(EKK0161B001CBSMsg1List.GENE_ADD_DTM)` |
| 3 | SET | `ucwkStat = (String)eKK0161B001SCHash.get(EKK0161B001CBSMsg1List.SVC_KEI_UCWK_STAT)` |
| 4 | IF | `SVC_KEI_STAT_TKC.equals(ucwkStat) && ucwkList.length == 2` — [check cancellation status with 2 items] |
| 5 | SET | `skjYkgt = "01"` |

#### Block 4.3 — SET (put back into inHash) (L368-369)

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHash.put(SVC_KEI_UCWK_NO, svc_kei_ucwk_no)` |
| 2 | SET | `inHash.put(GENE_ADD_DTM_SVC_KEI_UCWK, gene_add_dtm_svc_kei_ucwk)` |

#### Block 4.4 — CALL (Step 4a: getEKK0171A010Map) (L376-382)

> Retrieve service contract info for ISP. Inside loop.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = getEKK0171A010Map(handle, param, inHash, fixedText, resultHash)` |
| 2 | IF | `statusCode != 0` — [error branch, return] |

#### Block 4.5 — CALL (Step 4b: getEKK0361D010Map) (L388-395)

> Register option service (ISP). Inside loop.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = getEKK0361D010Map(handle, param, inHash, fixedText, resultHash)` |
| 2 | IF | `statusCode != 0` — [error branch, return] |
| 3 | CALL | `setSvKeiExUpdDtm(inHash, resultHash, TEMPLATE_ID_EKK0361D010)` // update date |
| 4 | CALL | `setGeneAddDtm(inHash, resultHash, TEMPLATE_ID_EKK0361D010)` // set generation date |

#### Block 4.6 — IF (Step 5: equalsShosazumi — inquiry) (L400-409)

> If the service contract status equals "agreement pending" (shosazumi), execute ISP inquiry.

| # | Type | Code |
|---|------|------|
| 1 | IF | `equalsShosazumi(ucwkStat)` — [agreement pending? SVC_KEI_STAT_TKC="100"] |
| 2 | CALL | `statusCode = getEKK0361C010Map(handle, param, inHash, fixedText, resultHash)` |
| 3 | IF | `statusCode != 0` — [error branch, return] |
| 4 | CALL | `setSvKeiExUpdDtm(inHash, resultHash, TEMPLATE_ID_EKK0361C010)` |
| 5 | CALL | `setGeneAddDtm(inHash, resultHash, TEMPLATE_ID_EKK0361C010)` |

#### Block 4.7 — IF (Step 6: isTeiketsuzumi — agreement closed) (L417-429)

> If the service contract status equals "agreement closed" (teiketsuzumi) AND function code is `"1"`, execute ISP inquiry closing.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isTeiketsuzumi(ucwkStat)` — [agreement closed? SVC_KEI_STAT_TKC="100"] |
| 2 | IF | `JPCModelConstant.FUNC_CD_1.equals(inHash.get(FUNC_CODE))` — [FUNC_CD == "1"] |
| 3 | CALL | `statusCode = getEKK0361C030Map(handle, param, inHash, fixedText, resultHash)` |
| 4 | IF | `statusCode != 0` — [error branch, return] |
| 5 | CALL | `setSvKeiExUpdDtm(inHash, resultHash, TEMPLATE_ID_EKK0361C030)` |
| 6 | CALL | `setGeneAddDtm(inHash, resultHash, TEMPLATE_ID_EKK0361C030)` |

#### Block 4.8 — IF (Step 7: isTeikyo — service active) (L437-449)

> If the service contract status equals "service active" (teikyo) AND function code is `"1"`, execute ISP start.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isTeikyo(ucwkStat)` — [service active? SVC_KEI_STAT_TKC="100"] |
| 2 | IF | `JPCModelConstant.FUNC_CD_1.equals(inHash.get(FUNC_CODE))` — [FUNC_CD == "1"] |
| 3 | CALL | `statusCode = getEKK0361C040Map(handle, param, inHash, fixedText, resultHash, skjYkgt)` |
| 4 | IF | `statusCode != 0` — [error branch, return] |
| 5 | CALL | `setSvKeiExUpdDtm(inHash, resultHash, TEMPLATE_ID_EKK0361C040)` |
| 6 | CALL | `setGeneAddDtm(inHash, resultHash, TEMPLATE_ID_EKK0361C040)` |

#### Block 4.9 — IF (Step 8: SOD issuance check) (L456-460)

> If the start date equals the operating date, prepare SOD data.

| # | Type | Code |
|---|------|------|
| 1 | IF | `unyoYmd.equals(strYmd)` — [start date equals operating date?] |
| 2 | CALL | `editSODHakko(handle, param, inHash, resultHash, sodDataList)` // prepare SOD data |

### Block 5 — POST-LOOP (SOD target data) (L463-474)

> Build SOD target data after the loop, create SOD issuance object, and call hakkoSOD.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodTrgtData = new HashMap<String, Object>()` |
| 2 | SET | `sodTrgtData.put(JKKHakkoSODConstCC.TRGT_DATA_LIST, sodDataList)` |
| 3 | SET | `sodTrgtData.put(JCMConstants.FUNC_CODE_KEY, inHash.get(JCMConstants.FUNC_CODE_KEY))` |
| 4 | SET | `hakkoSODCC = new JKKHakkoSODCC()` |
| 5 | EXEC | `param.setData("sodTrgtData", sodTrgtData)` |
| 6 | CALL | `hakkoSODCC.hakkoSOD(handle, param, "sodTrgtData")` // issue SOD |

### Block 6 — IF (Step 9: isUketsukezumi check) (L481-491)

> If the service contract is NOT yet accepted (uketsukezumi) AND function code is `"1"`, execute application detail inquiry.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isUketsukezumi(ucwkStat)` — [not yet accepted?] |
| 2 | IF | `JPCModelConstant.FUNC_CD_1.equals(inHash.get(FUNC_CODE))` — [FUNC_CD == "1"] |
| 3 | CALL | `statusCode = getEKK0021C060Map(handle, param, inHash, fixedText, resultHash)` |
| 4 | IF | `statusCode != 0` — [error branch, return] |

### Block 7 — CALL (Step 10: addPrg) (L497-499)

> Register the progress record.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `addPrg(handle, param, inHash, fixedText, resultHash, eKK0081A010SCHash, isSokuji)` |
| 2 | RETURN | `return statusCode` |

### Block 8 — editSODHakko (L505-554) [private helper method]

> Build SOD (Service Order Data) map with service contract, option service, and equipment provision service info.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodMap = new HashMap<String, Object>()` |
| 2 | SET | `sodKihonInfo = new HashMap<String, Object>()` // SOD basic info |
| 3 | SET | `sodKihonInfo.put(JKKHakkoSODConstCC.INFO_SYSID, inHash.get(SYSID))` |
| 4 | SET | `sodKihonInfo.put(JKKHakkoSODConstCC.INFO_IDO_DIV, inHash.get(IDO_DIV))` |
| 5 | SET | `sodMap.put(JKKHakkoSODConstCC.SOD_KIHON_INFO, sodKihonInfo)` |
| 6 | SET | `svcKeiInfo = new HashMap<String, Object>()` // service contract info |
| 7 | SET | `svcKeiInfo.put(JKKHakkoSODConstCC.INFO_SVC_KEI_NO, inHash.get(SVC_KEI_NO))` |
| 8 | SET | `sodMap.put(JKKHakkoSODConstCC.SVC_KEI_INFO, svcKeiInfo)` |
| 9 | SET | `svcKeiUcwkInfo = new HashMap<String, Object>()` // service contract detail info |
| 10 | SET | `svcKeiUcwkInfo.put(JKKHakkoSODConstCC.INFO_SVC_KEI_UCWK_NO, inHash.get(SVC_KEI_UCWK_NO))` |
| 11 | SET | `svcKeiUcwkInfo.put(JKKHakkoSODConstCC.INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM, inHash.get(GENE_ADD_DTM_SVC_KEI_UCWK))` |
| 12 | SET | `sodMap.put(JKKHakkoSODConstCC.SVC_KEI_UCWK_INFO, svcKeiUcwkInfo)` |
| 13 | SET | `opSvcKeiInfo = new HashMap<String, Object>()` // option service info |
| 14 | SET | `eKK0361D010Hash = (HashMap<String, Object>)workMap.get(TEMPLATE_ID_EKK0361D010)` |
| 15 | SET | `opSvcKeiInfo.put(JKKHakkoSODConstCC.INFO_CHAF_OPSVKEI_NO, eKK0361D010Hash.get(EKK0361D010CBSMsg.OP_SVC_KEI_NO))` |
| 16 | SET | `opSvcKeiInfo.put(JKKHakkoSODConstCC.INFO_CHAF_OPSVKEI_GENE_ADD_DTM, inHash.get("kk0351_gene_add_dtm"))` |
| 17 | SET | `sodMap.put(JKKHakkoSODConstCC.OPSVKEI_INFO, opSvcKeiInfo)` |
| 18 | SET | `kktsvkeiInfo = new HashMap<String, Object>()` // equipment provision service info |
| 19 | SET | `sodMap.put(JKKHakkoSODConstCC.KKTSVKEI_INFO, kktsvkeiInfo)` |
| 20 | EXEC | `sodDataList.add(sodMap)` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_ucwk_no` | Field | Service contract detail number — internal tracking ID for service contract line items |
| `svc_kei_ucwk_stat` | Field | Service contract detail status — current state of the service contract detail |
| `ucwkStat` | Field | Work status (shortened name for svc_kei_ucwk_stat) — tracks whether the contract is pending, closed, or active |
| `svc_kei_no` | Field | Service contract number — unique identifier for a service contract |
| `gene_add_dtm` | Field | Generation/addition date-time — timestamp when a record was created |
| `unyoYmd` | Field | Operating year/month/day — the scheduled operating start date for the service |
| `strYmd` | Field | Start year/month/day — the utilization start date from getStrymd() |
| `useStaYmd` | Field | Use start year/month/day — the effective date for instant reflection check |
| `skjYkgt` | Field | Screening result code — set to "01" when cancellation status matches with 2 items |
| `isSokuji` | Field | Instant reflection flag — true when operating date equals start date |
| `FUNC_CD` | Field | Function code — determines which business function is being executed; "1" = primary registration |
| `SVC_KEI_STAT_TKC` | Constant | Service contract status "100" — contract cancellation (tkchuka) |
| SOD | Acronym | Service Order Data — telecom service order fulfillment entity issued to downstream systems |
| ISP | Business term | Internet Service Provider — optional internet connectivity service |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| SIF | Acronym | Service Interface — Fujitsu internal service-to-service call mechanism |
| SC | Acronym | Service Component — a service layer component handling specific business operations |
| CBS | Acronym | Call Business Service — database/business layer component |
| CC | Acronym | Common Component — reusable business logic component class |
| EKKxxxxx | Pattern | Entity/SC code pattern for service contract and order operations |
| `ADDMLTISEINFO` | Constant | Data key for multi-service info retrieval from param object |
| `tkchuka` | Japanese term | Contract cancellation — the state where a service contract has been cancelled |
| `shosazumi` | Japanese term | Agreement pending — the state where service agreement has not yet been confirmed |
| `teiketsuzumi` | Japanese term | Agreement closed — the state where service agreement has been finalized |
| `teikyo` | Japanese term | Service active/providing — the state where the service is currently being provided |
| `uketsukezumi` | Japanese term | Accepted — the state where the application has been accepted by the system |
| `hakko` | Japanese term | Issuance/Dispatch — creating and sending out the SOD to downstream |
| `JOKEN` | Japanese term | Cancellation — used in class names for order cancellation operations |
| `info` | Japanese term | Information — used in class names for data/info retrieval operations |
| `Kiki` | Japanese term | Equipment/Machine — used in class names for hardware/equipment-related operations |
