# Business Logic — JKKKikiIchiranKkOpKyUpdCC.execShinchokuTorokuTnmt() [113 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKKikiIchiranKkOpKyUpdCC` |
| Layer | CC/Common Component (Enterprise Bean Component — shared business logic utility) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKKikiIchiranKkOpKyUpdCC.execShinchokuTorokuTnmt()

This method registers the **proceed status** (progress record) for the **equipment option (terminal compensation)** process within the K-Opticom telecom order fulfillment system. "Shinchoku" (進捗) means "progress" — it writes a status record indicating that the equipment option workflow has been reached and what state it is currently in. It is the dedicated advancement registration method for the "terminal compensation" (端末補償) equipment option branch, distinguishing it from the general `execShinchokuToroku` method which handles other equipment option types.

The method operates as a **delegation pattern** implementation: it gathers all required progress data (status code, special remarks, service contract numbers, migration/division info, timestamps), assembles them into the EKK1091D010 service component (SC) input structure, optionally populates migration reason detail rows, and dispatches everything to the `EKK1091D010` progress registration CBS (Common Business Service). It is a write-heavy operation that does not return data but rather persists a progress record to the system database.

The method handles **two business branches** for the special remarks text (`prg_tkjk`): when the terminal compensation option is being **applied/subscribed** (`hosho_mskm_select = "1"`) and when it is being **canceled** (`hosho_mskm_select != "1"`), with the cancellation branch further subdivided into chargeable (`hosho_chrg_um = "1"`) and non-chargeable (`hosho_chrg_um != "1"`) cases. Before any registration occurs, the method checks whether a progress record for this state has already been output via `isExecShinchokuToroku`, allowing early return to prevent duplicate records.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execShinchokuTorokuTnmt"])
    START --> GET_MSG["Get ccMsg from param.getData"]
    GET_MSG --> GET_HOSHO["Get hosho_mskm_select from scrnItemMap"]
    GET_HOSHO --> SET_STAT["Set prg_stat = PRG_STAT_H001 = H001"]
    SET_STAT --> SET_TKJK["Set prg_tkjk = empty string"]
    SET_TKJK --> BR1{"hosho_mskm_select = 1"}
    BR1 -->|true| SET_APPLY["prg_tkjk = 安心補償オプション 申込"]
    BR1 -->|false| BR2{"hosho_chrg_um = 1"}
    SET_APPLY --> CHECK_EXEC{"isExecShinchokuToroku check"}
    BR2 -->|true| SET_CHARGE["scrn_hosho_chrg_um = 課金"]
    BR2 -->|false| SET_FREE["scrn_hosho_chrg_um = 非課金"]
    SET_CHARGE --> SET_TKJK2["prg_tkjk = 安心補償オプション 解約 課金有無"]
    SET_FREE --> SET_TKJK2
    CHECK_EXEC -->|false| EARLY_RET["return"]
    CHECK_EXEC -->|true| GET_TEMP["Get ekk0081a010 from temporaryData"]
    GET_TEMP --> BUILD_IN["Build ekk1091d010IN array"]
    BUILD_IN --> CHK_RSN{"ido_rsn_cd not empty"}
    EARLY_RET --> END_NODE(["End"])
    SET_TKJK2 --> CHECK_EXEC
    CHK_RSN -->|true| SET_RSN["Put ido_rsn_cd and memo into inMap"]
    CHK_RSN -->|false| BR_OUT{"outList not null"}
    SET_RSN --> ADD_RSN["inList add inMap"]
    BR_OUT -->|true| LOOP_RSN["Loop over outList add each to inList"]
    BR_OUT -->|false| CALL_SC["callSCArray EKK1091D010CBSMsg1List inList"]
    ADD_RSN --> CALL_SC
    LOOP_RSN --> CALL_SC
    CALL_SC --> SET_TKJK_END["setShinchokuTkjk param prg_stat prg_tkjk"]
    SET_TKJK_END --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle for obtaining timestamps via `getIdoUpDtm`. Represents the current database connection context for the service transaction. |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | Service Component invoker used to dispatch the EKK1091D010 CBS call via `callSCArray`. Acts as the RPC transport to the backend service. |
| 3 | `param` | `IRequestParameterReadWrite` | Main request/response parameter object. Used to retrieve the `ccMsg` data map (holding func_code, svc_kei_no, ido_div, ido_rsn_cd), check execution flag via `isExecShinchokuToroku`, and store final progress remarks via `setShinchokuTkjk`. |
| 4 | `dataMapKey` | `String` | Key used to access the main data map within `param`. Typically the screen/data map identifier (e.g., `"JKKKikiIchiranKkOpKyUpdCC"`). |
| 5 | `temporaryData` | `HashMap<String, Object>` | Temporary storage carrying template data across method calls. Used to retrieve `EKK0081A010` template message which contains `mskm_dtl_no` (application detail number) for the progress registration. |
| 6 | `scrnItemMap` | `HashMap<String, Object>` | Screen item map passed from the calling screen/batch. Contains `hosho_mskm_select` (equipment option selection state: "1"=apply, other=cancel) and `hosho_chrg_um` (charge determination: "1"=chargeable, else=non-chargeable). |
| 7 | `sodShoriKbn` | `String` | SOD processing classification. In the call chain, this is passed as `SOD_SHORI_KBN_DSL = "3"` (DSL service order processing type). Identifies the service order processing category for the advancement registration. |

**Instance fields / constants read by the method:**
- `PRG_STAT_H001` — Progress state constant: `"H001"` (Progress state code indicating equipment option terminal compensation status).
- `TEMPLATE_ID_EKK0081A010` — Template ID constant: `"EKK0081A010"` (EKK0081A010 template message ID for accessing service order data).
- `TEMPLATE_ID_EKK1091D010` — Template ID constant: `"EKK1091D010"` (EKK1091D010 progress registration service template ID).

## 4. CRUD Operations / Called Services

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

The method primarily performs a single **Create** operation — the EKK1091D010 progress registration Service Component. All other calls are Read operations (helper methods) to prepare data.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `isExecShinchokuToroku` | (internal helper) | - | Checks if a progress record for the given `prg_stat` has already been output; prevents duplicate progress registration. |
| C | `EKK1091D010` Progress Registration (via `callSCArray`) | EKK1091D010 | Progress status table (progress record persistence) | Registers the progress status for the equipment option (terminal compensation) workflow. Writes template ID, func code, service contract numbers, migration division, migration timestamp, progress state, and special remarks (prg_tkjk). Also writes migration reason details via the `EKK1091D010CBSMsg1List` child list (ido_rsn_cd, ido_rsn_memo). |
| R | `getMskmDtlNo` | (internal helper) | - | Retrieves the application detail number (`mskm_dtl_no`) from the EKK0081A010 template message. |
| R | `getIdoUpDtm` | (internal helper) | - | Obtains the migration update timestamp (date and time string) for the progress record. |
| R | `getNullToStr` | (internal helper) | - | Null-safe string conversion utility called multiple times to prevent NullPointerExceptions on map lookups. |
| R | `setShinchokuTkjk` | (internal helper) | - | Stores the final progress special remarks string back into the param object for downstream consumption. |

## 5. Dependency Trace

### Direct callers found:

The method is called exclusively from `execKikiOptKeiCreUpd` within the same class, invoked when the screen item map contains `hosho_mskm_select` ("1" or "2") AND `kiki_edit_kbn = "16"` (equipment editing classification). The call is guarded by the condition that terminal compensation option selection is active.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC:JKKKikiIchiranKkOpKyUpdCC.execKikiOptKeiCreUpd | `execKikiOptKeiCreUpd` -> `execShinchokuTorokuTnmt` | `callSCArray [C] EKK1091D010 Progress Registration` |

### Entry point screens that ultimately route through this chain:

Multiple screen BPM operations (KKSV0353, KKSV0031, KKSV0034, KKSV0058, KKSV0098, KKSV0202, KKSV0391, KKSV0395, KKSV0495, KKSV0536, KKSV0738, FUSV0065, FUSV0165, FUSV0238, FUSV0275, etc.) reference the EKK1091D010 progress registration mapper, indicating the EKK1091D010 CBS is a shared progress recording service used across many screens. The `execShinchokuTorokuTnmt` method is the specific entry path from the equipment option update component.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize local variables (L2896–L2904)

> Retrieves the main data map and prepares the progress status code and special remarks string. The special remarks string will be populated differently based on the terminal compensation option selection state.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMsg = (HashMap)param.getData(dataMapKey)` // Main data map containing func_code, svc_kei_no, ido_div, ido_rsn_cd |
| 2 | SET | `hosho_mskm_select = getNullToStr((String)scrnItemMap.get("hosho_mskm_select"))` // Equipment option (terminal compensation) selection state — "1" means apply, "2" means other selection |
| 3 | SET | `prg_stat = PRG_STAT_H001` // [-> CONSTANT PRG_STAT_H001="H001"] Equipment option setting completion state |
| 4 | SET | `prg_tkjk = ""` // Special remarks text string (initialized empty, populated below) |

**Block 2** — [IF/ELSE] Determine special remarks text based on option selection (L2906–L2928)

> Branches on whether the terminal compensation option is being applied (new subscription) or canceled. In the cancellation branch, further determines if the cancellation is chargeable or non-chargeable.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"1".equals(hosho_mskm_select)` [hosho_mskm_select="1"] (L2907) — Application case |
| 2 | SET | `prg_tkjk = "安心補償オプション 申込"` // [English: "Anshin Compensation Option Application"] |
| 3 | ELSE | (L2911) — Cancellation case |
| 4 | SET | `scrn_hosho_chrg_um` // Local variable for charge determination |

**Block 2.1** — [IF/ELSE] Cancellation: determine charge status (L2917–L2926)

> Inside the cancellation branch, checks whether the cancellation is chargeable (`"1"`) or non-chargeable. The result is appended to the remarks string.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"1".equals(getNullToStr((String)scrnItemMap.get("hosho_chrg_um")))` [hosho_chrg_um="1"] (L2918) |
| 2 | SET | `scrn_hosho_chrg_um = "課金"` // [English: "Billable/Charged"] |
| 3 | ELSE | (L2922) |
| 4 | SET | `scrn_hosho_chrg_um = "非課金"` // [English: "Non-Billable/Free"] |
| 5 | SET | `prg_tkjk = "安心補償オプション 解約 課金有無: " + scrn_hosho_chrg_um` // [English: "Anshin Compensation Option Cancellation Billable Status: {charge or non-charge}"] |

**Block 3** — [IF] Check if progress record already exists (L2931–L2935)

> Prevents duplicate progress registration by checking whether a progress record for the current `prg_stat` has already been output. Returns early if so.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isExecShinchokuToroku(param, prg_stat, "")` (L2932) |
| 2 | RETURN | `return;` // Early exit — progress record already exists, skip registration |

**Block 4** — [SET] Retrieve template message from temporary data (L2937)

> Fetches the EKK0081A010 template message from the temporary data map. This message contains the `mskm_dtl_no` (application detail number) needed for the progress registration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081a010 = (CAANMsg)temporaryData.get(TEMPLATE_ID_EKK0081A010)` // [-> CONSTANT TEMPLATE_ID_EKK0081A010="EKK0081A010"] |

**Block 5** — [BUILD] Assemble EKK1091D010 input array (L2940–L2961)

> Builds the complete input structure for the EKK1091D010 progress registration Service Component. Maps business data from the ccMsg map, template data, and helper method results into the CBS message schema. Most payment-related fields are set to empty strings.

| # | Type | Code | Business Meaning |
|---|------|------|-----------------|
| 1 | SET | `ekk1091d010IN[0]` | `TEMPLATEID = TEMPLATE_ID_EKK1091D010` // [-> "EKK1091D010"] Template ID |
| 2 | SET | `ekk1091d010IN[1]` | `FUNC_CODE = ccMsg.get("func_code")` // Function code from screen |
| 3 | SET | `ekk1091d010IN[2]` | `MSKM_DTL_NO = getMskmDtlNo(param, ekk0081a010)` // Application detail number |
| 4 | SET | `ekk1091d010IN[3..13]` | `SEIKY_KEI_NO, SEIKY_WAY_NO_KOZA, SEIKY_WAY_NO_CRECARD, SVC_KEI_UCWK_NO, SVC_KEI_KAISEN_UCWK_NO, KKTK_SVC_KEI_NO, OP_SVC_KEI_NO, SEIOPSVC_KEI_NO, SBOP_SVC_KEI_NO, WRIB_SVC_KEI_NO` // All set to `""` (empty) — not used in this branch |
| 5 | SET | `ekk1091d010IN[14]` | `SVC_KEI_NO = ccMsg.get("svc_kei_no")` // Service contract number |
| 6 | SET | `ekk1091d010IN[15]` | `IDO_DIV = ccMsg.get("ido_div")` // Migration/division code |
| 7 | SET | `ekk1091d010IN[16]` | `IDO_DTM = getIdoUpDtm(handle, scCall, param, dataMapKey, temporaryData)` // Migration date/time |
| 8 | SET | `ekk1091d010IN[17]` | `PRG_STAT = prg_stat` // "H001" — equipment option setting completion |
| 9 | SET | `ekk1091d010IN[18]` | `PRG_MEMO = ""` // Progress memo (empty) |
| 10 | SET | `ekk1091d010IN[19]` | `PRG_TKJK_1 = prg_tkjk` // Special remarks 1 (application or cancellation with charge status) |
| 11 | SET | `ekk1091d010IN[20]` | `PRG_TKJK_2 = ""` // Special remarks 2 (empty) |

**Block 6** — [BUILD] Prepare migration reason detail list (L2965–L2987)

> Constructs the child list of migration reason details (`EKK1091D010CBSMsg1List`). Two branches: if `ido_rsn_cd` exists directly in `ccMsg`, use it; otherwise, iterate over an existing `outList` from `ccMsg` to populate all migration reasons.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inList = new ArrayList<HashMap<String, Object>>()` // Initialize result list |
| 2 | SET | `inMap = new HashMap<String, Object>()` // Initialize map |

**Block 6.1** — [IF/ELSE] Populate migration reason from direct value or from outList (L2967–L2987)

> If `ido_rsn_cd` exists directly in the ccMsg map (simple case), put it into the input list. Otherwise, iterate over the `EKK1091D010CBSMsg1List` list stored in ccMsg for multi-reason cases.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!"\"".equals(getNullToStr((String)ccMsg.get("ido_rsn_cd")))` [ido_rsn_cd present] (L2968) |
| 2 | SET | `inMap.put(EKK1091D010CBSMsg1List.IDO_RSN_CD, getNullToStr((String)ccMsg.get("ido_rsn_cd")))` // Migration reason code |
| 3 | SET | `inMap.put(EKK1091D010CBSMsg1List.IDO_RSN_MEMO, "")` // Migration reason memo (empty) |
| 4 | EXEC | `inList.add(inMap)` |
| 5 | ELSE | (L2974) |
| 6 | SET | `outList = (ArrayList)ccMsg.get("EKK1091D010CBSMsg1List")` // Existing migration reason list |
| 7 | IF | `outList != null` (L2976) |
| 8 | SET | `inList = new ArrayList<HashMap<String, Object>>()` // Reset list |
| 9 | FOR | `j = 0; j < outList.size(); j++` (L2979) |
| 10 | SET | `childMap = (HashMap)outList.get(j)` // Get child entry |
| 11 | SET | `inMap = new HashMap<String, Object>()` // Reset map |
| 12 | SET | `inMap.put(IDO_RSN_CD, childMap.get("ido_rsn_cd"))` // Migration reason code from child |
| 13 | SET | `inMap.put(IDO_RSN_MEMO, "")` // Migration reason memo (empty) |
| 14 | EXEC | `inList.add(inMap)` |

**Block 7** — [CALL] Execute EKK1091D010 Service Component (L2990)

> Dispatches the assembled progress registration data to the EKK1091D010 CBS via the `callSCArray` helper. This is the primary Create operation of this method.

| # | Type | Code | Business Meaning |
|---|------|------|-----------------|
| 1 | CALL | `callSCArray(handle, scCall, param, dataMapKey, ekk1091d010IN, "EKK1091D010CBSMsg1List", inList)` // [C] EKK1091D010 Progress Registration — persists progress status and migration reason details |

**Block 8** — [CALL] Store final progress remarks (L2992)

> Persists the final progress special remarks back into the param object so downstream processing (screens, other components) can read what was recorded.

| # | Type | Code | Business Meaning |
|---|------|------|-----------------|
| 1 | CALL | `setShinchokuTkjk(param, prg_stat, prg_tkjk)` // Store the progress remarks (e.g., "安心補償オプション 申込" or "安心補償オプション 解約 課金有無: 課金") for downstream consumption |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `shinchoku` (進捗) | Japanese | Progress — refers to the current state or advancement status of a business process/workflow |
| `toroku` (登録) | Japanese | Registration — data entry/persistence operation |
| `prg_stat` (プログレスステータス) | Field | Progress status code — indicates the current stage of the workflow. `H001` = "equipment option setting completion" (機器オプション設定完了) |
| `prg_tkjk` (プログレス特記事項) | Field | Progress special remarks — free-text field recording details about the progress state, such as "Anshin Compensation Option Application" or "Anshin Compensation Option Cancellation — Billable Status: Billable" |
| `hosho_mskm_select` | Field | Compensation (Anshin) equipment option selection — "1" means the customer applied for the terminal compensation option; other values indicate cancellation or no selection |
| `hosho_chrg_um` | Field | Compensation charge determination — "1" means the cancellation is chargeable (課金); otherwise non-chargeable (非課金) |
| `mskm_dtl_no` | Field | Application detail number — internal tracking ID for a specific application/contract line item within the service order |
| `ido_div` | Field | Migration/division code — classifies the type of service migration or division in telecom service provisioning |
| `ido_dtm` | Field | Migration date/time — timestamp of the migration update |
| `ido_rsn_cd` | Field | Migration reason code — code explaining why a service was migrated or changed |
| `ido_rsn_memo` | Field | Migration reason memo — free-text description of the migration reason |
| `svc_kei_no` | Field | Service contract number — unique identifier for a service contract in the K-Opticom system |
| `EKK1091D010` | SC Code | Progress Registration Service Component (進捗登録SC) — the CBS that persists progress status records to the database |
| `EKK0081A010` | Template ID | Service order data template — carries application-level data including `mskm_dtl_no` |
| `SOD` | Acronym | Service Order Data — the core telecom order fulfillment entity holding service contract information |
| `SOD_SHORI_KBN_DSL` | Constant | SOD processing classification "3" (DSL) — indicates DSL-type service order processing |
| `PRG_STAT_H001` | Constant | Progress state "H001" — equipment option setting completion status code |
| `EKK1091D010CBSMsg` | Class | CBS message schema for EKK1091D010 — defines all input/output fields for the progress registration service |
| `EKK1091D010CBSMsg1List` | Class | CBS message child list schema — defines migration reason detail fields (`ido_rsn_cd`, `ido_rsn_memo`) |
| K-Opticom | Brand | K-Opticom — Japanese broadband/telecom service provider; the system being documented serves its customer management operations |
| Anshin Hoshou Opushon (安心補償オプション) | Japanese | Anshin (peace of mind) Compensation Option — a terminal insurance/compensation add-on service for customers |
| `kiki_edit_kbn` | Field | Equipment editing classification — "16" identifies the equipment option (terminal compensation) editing branch |
| `callSCArray` | Method | Generic Service Component array dispatch helper — sends an Object[][] main message and a child ArrayList list to a CBS via the service invoker |
| `isExecShinchokuToroku` | Method | Progress execution check — returns true only if no progress record for the given state has already been output, preventing duplicates |
| `setShinchokuTkjk` | Method | Store progress remarks — writes the final progress special remarks string into the param for downstream use |
