# Business Logic — JKKKikiIchiranKkKaifukuCC.execShinchokuToroku() [64 LOC]

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

## 1. Role

### JKKKikiIchiranKkKaifukuCC.execShinchokuToroku()

This method registers the current progress status (進捗登録) for a machine-provided service contract recovery operation within the K-Opticom customer foundation system (eo顧客基幹システム). It is the dedicated progress-entry point for the service contract recovery screen (機器提供サービス契約回復処理). The method follows a guard-clause-then-delegate pattern: it first checks whether progress registration is required by querying the current progress summary (`getPrgTkjk`) and validating against the caller's execution flag (`isExecShinchokuToroku`), and if so, builds a structured input record for the progress-registration service component (EKK1091D010SC) and dispatches it via the batch-capable `callSCArray` delegation pattern. It then persists the updated progress summary back through `setShinchokuTkjk`. Its role in the larger system is a shared common-component utility invoked by the main recovery-screen controller (`execKikiIchiranKikiKaifuku`) during the progressive workflow of recovering interrupted or pending machine-provided service contracts.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execShinchokuToroku(params)"])
    START --> GET_CC_MSG["Retrieve ccMsg HashMap from param<br/>(dataMapKey)"]
    GET_CC_MSG --> GET_PRG_TKJK["Call getPrgTkjk(handle, scCall, param,<br/>dataMapKey, temporaryData, prgStat)"]
    GET_PRG_TKJK --> CHECK_EXEC{"isExecShinchokuToroku<br/>(param, prgStat, prg_tkjk)<br/>returns true?"}
    CHECK_EXEC --> |false| EARLY_RETURN["Return early<br/>(no progress registration)"]
    CHECK_EXEC --> |true| GET_TEMPLATE["Get template EKK0081A010<br/>from temporaryData"]
    GET_TEMPLATE --> BUILD_IN_ARRAY["Build ekk1091d010IN Object[][]<br/>(21 field rows)"]
    BUILD_IN_ARRAY --> PREP_LIST["Prepare inList and inMap<br/>(異動理由 code + memo)"]
    PREP_LIST --> CALL_SC["Call callSCArray(handle, scCall, param,<br/>dataMapKey, ekk1091d010IN,<br/>'EKK1091D010CBSMsg1List', inList)"]
    CALL_SC --> SET_RESULT["Call setShinchokuTkjk(param, prgStat, prg_tkjk)"]
    SET_RESULT --> END_NODE(["Return void"])
    EARLY_RETURN --> END_NODE
```

**Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `TEMPLATE_ID_EKK0081A010` | `"EKK0081A010"` | Service Contract Agreement template ID — the master service contract data template |
| `TEMPLATE_ID_EKK1091D010` | `"EKK1091D010"` | Progress Registration (進捗登録) template ID — used as input to the EKK1091D010SC service component |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle providing the transactional context for CBS (Common Business Service) calls. Carries the connection to the K-Opticom back-end database. |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | Service Component invocation dispatcher. Used to route the `callSCArray` request to the EKK1091D010SC (Progress Registration) service component. |
| 3 | `param` | `IRequestParameterReadWrite` | Request parameter container holding screen input data, map keys (`dataMapKey` → `ccMsg`), and output results. Provides `getData()` to extract the message map and is passed through to called methods. |
| 4 | `dataMapKey` | `String` | Key within `param` that identifies the message map (`ccMsg`) containing service contract screen data such as `func_code`, `svc_kei_no`, `ido_div`, and `ido_rsn_cd`. |
| 5 | `temporaryData` | `HashMap<String, Object>` | Cross-method data cache storing serialized templates and intermediate results. Here, it provides the `EKK0081A010` template (service contract agreement) used to derive the management detail number (`mskm_dtl_no`). |
| 6 | `prgStat` | `String` | Program status (プログラムステータス) — identifies the current step/state within the recovery workflow. Used to gate execution via `isExecShinchokuToroku` and to store the progress summary via `setShinchokuTkjk`. |

**External State / Instance Fields Read:**

| Field | Type | Business Meaning |
|-------|------|------------------|
| `TEMPLATE_ID_EKK0081A010` | `static final String` = `"EKK0081A010"` | Constant identifying the service contract agreement template fetched from `temporaryData`. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getPrgTkjk` | (derived from `JKKKikiIchiranKkKaifukuCC`) | - | Reads the current progress summary string for the given `prgStat`. Returns the progress breakdown that feeds the guard check and final result. |
| - | `isExecShinchokuToroku` | (derived from `JKKKikiIchiranKkKaifukuCC`) | - | Guards execution — returns `true` only if progress registration is required for this workflow step. |
| R | `callSCArray` | (derived from `JKKKikiIchiranKkKaifukuCC`) | - | Internal helper that dispatches the `ekk1091d010IN` input array and `inList`異動理由 (movement reason) list to the EKK1091D010 service component. Routes the call to the CBS layer. |
| R | `getMskmDtlNo` | (derived from `JKKKikiIchiranKkKaifukuCC`) | - | Derives the management detail number (`mskm_dtl_no`) from the screen parameters and the EKK0081A010 service contract template. |
| R | `getIdoUpDtm` | (derived from `JKKKikiIchiranKkKaifukuCC`) | - | Reads the upgrade date/time (`ido_dtm`) of the service change (異動) from the parameter data. |
| R | `getNullToStr` | (derived from `JKKKikiIchiranKkKaifukuCC`) | - | Utility null-to-empty-string converter — prevents `null` values from propagating to the CBS input. |
| R | `callSCArray` | EKK1091D010SC | EKK1091 (Progress Registration table) | Calls the Progress Registration service component with the built input array (21 fields) and the異動理由 (movement reason) list. This is the core write/registration operation that records the progress status update. |
| - | `setShinchokuTkjk` | (derived from `JKKKikiIchiranKkKaifukuCC`) | - | Persists the progress summary (`prg_tkjk`) back to the parameter store for the given `prgStat`, making it available to the calling screen. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC:JKKKikiIchiranKkKaifukuCC | `execKikiIchiranKikiKaifuku()` → `execShinchokuToroku(handle, scCall, param, dataMapKey, temporaryData, prgStat)` | `callSCArray [R] EKK1091 (Progress Registration)`, `setShinchokuTkjk [-]`, `getPrgTkjk [R]`, `getMskmDtlNo [R]`, `getIdoUpDtm [R]`, `getNullToStr [R]` |

No screen/batch entry points (KKSV\* or batch) found within 8 hops. The direct caller is `execKikiIchiranKikiKaifuku`, which is the main recovery-screen controller within the same class (`JKKKikiIchiranKkKaifukuCC`). The terminal operations reach the EKK1091D010 progress-registration CBS, which writes to the progress registration database table.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(Retrieve ccMsg map from param)` (L~896)

Extract the message map (`ccMsg`) from the request parameter container using `dataMapKey`. This map carries all screen-level data for the current service contract recovery operation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMsg = (HashMap<String, Object>)param.getData(dataMapKey)` // Retrieves the message map from param |

**Block 2** — [CALL] `(Fetch current progress summary)` (L~899)

Query the current progress summary (進捗概要) for the given program status. This value is used both for the guard check and for the final persisted result.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `prg_tkjk = getPrgTkjk(handle, scCall, param, dataMapKey, temporaryData, prgStat)` // Fetches the current progress summary for this workflow step |

**Block 3** — [IF] `(Guard: isExecShinchokuToroku returns false)` (L~903)

Check whether progress registration should proceed. If `isExecShinchokuToroku` returns `false` (meaning this workflow step does not require progress registration, or the progress is already complete), the method exits early.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `isExecShinchokuToroku(param, prgStat, prg_tkjk)` // Determines if this step requires progress registration |

**Block 3.1** — [ELSE] `(Early return)` (L~905)

When the guard check fails, return immediately without any data mutation.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // No progress registration needed for this prgStat |

**Block 4** — [SET] `(Retrieve service contract template)` (L~909)

Fetch the `EKK0081A010` (Service Contract Agreement) template from the `temporaryData` cross-method cache. This template contains the service contract details needed to derive the management detail number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081a010cbsMsg = (CAANMsg)temporaryData.get(TEMPLATE_ID_EKK0081A010)` // TEMPLATE_ID_EKK0081A010 = "EKK0081A010" — retrieves the service contract agreement template |

**Block 5** — [SET] `(Build input array for EKK1091D010 progress registration SC)` (L~913~936)

Construct the input record (`ekk1091d010IN`) for the EKK1091D010 service component (Progress Registration / 進捗登録). This is a 21-row `Object[][]` mapping field constants to their values. Most fields are populated from the `ccMsg` map or derived helper calls, while many settlement/fee-related fields are hardcoded to empty strings (not applicable to progress registration).

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk1091d010IN[0]` = `{TEMPLATEID, TEMPLATE_ID_EKK1091D010}` // TEMPLATE_ID_EKK1091D010 = "EKK1091D010" |
| 2 | SET | `ekk1091d010IN[1]` = `{FUNC_CODE, ccMsg.get("func_code")}` |
| 3 | SET | `ekk1091d010IN[2]` = `{MSKM_DTL_NO, getMskmDtlNo(param, ekk0081a010cbsMsg)}` |
| 4 | SET | `ekk1091d010IN[3]` = `{SEIKY_KEI_NO, ""}` // Settlement type number — not used here |
| 5 | SET | `ekk1091d010IN[4]` = `{SEIKY_WAY_NO_KOZA, ""}` // Settlement method (bank account) number |
| 6 | SET | `ekk1091d010IN[5]` = `{SEIKY_WAY_NO_CRECARD, ""}` // Settlement method (credit card) number |
| 7 | SET | `ekk1091d010IN[6]` = `{SVC_KEI_NO, ccMsg.get("svc_kei_no")}` // Service detail number |
| 8 | SET | `ekk1091d010IN[7]` = `{SVC_KEI_UCWK_NO, ""}` // Service detail work number |
| 9 | SET | `ekk1091d010IN[8]` = `{SVC_KEI_KAISEN_UCWK_NO, ""}` // Service detail improvement work number |
| 10 | SET | `ekk1091d010IN[9]` = `{KKTK_SVC_KEI_NO, ""}` // KK service number |
| 11 | SET | `ekk1091d010IN[10]` = `{OP_SVC_KEI_NO, ""}` // Operator service number |
| 12 | SET | `ekk1091d010IN[11]` = `{SEIOPSVC_KEI_NO, ""}` // Service-operator number |
| 13 | SET | `ekk1091d010IN[12]` = `{SBOP_SVC_KEI_NO, ""}` // SBOP service number |
| 14 | SET | `ekk1091d010IN[13]` = `{WRIB_SVC_KEI_NO, ""}` // WRIB service number |
| 15 | SET | `ekk1091d010IN[14]` = `{IDO_DIV, ccMsg.get("ido_div")}` // Service change division (異動区分) |
| 16 | SET | `ekk1091d010IN[15]` = `{IDO_DTM, getIdoUpDtm(param)}` // Service change date/time |
| 17 | SET | `ekk1091d010IN[16]` = `{PRG_STAT, prgStat}` // Program status |
| 18 | SET | `ekk1091d010IN[17]` = `{PRG_MEMO, ""}` // Progress memo — not used |
| 19 | SET | `ekk1091d010IN[18]` = `{PRG_TKJK_1, prg_tkjk}` // Progress summary (text field 1) |
| 20 | SET | `ekk1091d010IN[19]` = `{PRG_TKJK_2, ""}` // Progress summary (text field 2) |

**Block 6** — [SET] `(Prepare異動理由 (movement reason) list)` (L~938~943)

Build the secondary input list carrying the movement reason code and memo. The reason code is extracted from `ccMsg` and null-safe-converted to empty string; the memo is left blank.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inList = new ArrayList<HashMap<String, Object>>()` |
| 2 | SET | `inMap = new HashMap<String, Object>()` |
| 3 | SET | `inMap.put(IDO_RSN_CD, getNullToStr((String)ccMsg.get("ido_rsn_cd")))` // 異動理由コード (movement reason code) |
| 4 | SET | `inMap.put(IDO_RSN_MEMO, "")` // 異動理由メモ (movement reason memo) |
| 5 | SET | `inList.add(inMap)` |

**Block 7** — [CALL] `(Dispatch to EKK1091D010 Progress Registration SC)` (L~944)

Call the batch-capable service component dispatcher to route the constructed input data to the EKK1091D010 (Progress Registration / 進捗登録) service component. This is the primary write operation of this method.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callSCArray(handle, scCall, param, dataMapKey, ekk1091d010IN, "EKK1091D010CBSMsg1List", inList)` |

**Block 8** — [CALL] `(Persist progress summary result)` (L~946)

Write the computed progress summary (`prg_tkjk`) back to the parameter store for the given `prgStat`, so the calling screen can display the updated progress status.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setShinchokuTkjk(param, prgStat, prg_tkjk)` // 進捗概要設定 (progress summary set) — persists the result |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `prg_tkjk` | Field | Progress summary (進捗概要) — a text string summarizing the current progress state of the service contract recovery workflow. |
| `prg_stat` | Field | Program status (プログラムステータス) — identifies the current step within the recovery workflow. |
| `mskm_dtl_no` | Field | Management detail number (管理詳細番号) — internal tracking ID for a service contract line item. |
| `svc_kei_no` | Field | Service detail number (サービス詳細番号) — identifies a specific service line item within a contract. |
| `svc_kei_ucwk_no` | Field | Service detail work number (サービス詳細作業番号) — internal tracking ID for service contract work items. |
| `ido_div` | Field | Service change division (異動区分) — classifies the type of service change (e.g., new installation, modification, cancellation). |
| `ido_dtm` | Field | Service change date/time (異動日時) — timestamp of when the service change occurred or is scheduled. |
| `ido_rsn_cd` | Field | Movement reason code (異動理由コード) — codes the reason for a service change (e.g., customer request, system error). |
| `ido_rsn_memo` | Field | Movement reason memo (異動理由メモ) — free-text explanation for the movement reason. |
| `func_code` | Field | Function code (機能コード) — identifies the specific screen operation (e.g., check, registration). |
| `seiky_kei_no` | Field | Settlement type number (精算種別番号) — classifies the settlement method type. |
| `seiky_way_no_koza` | Field | Settlement method bank account number (精算方法口座番号). |
| `seiky_way_no_crecard` | Field | Settlement method credit card number (精算方法クレジットカード番号). |
| `kktk_svc_kei_no` | Field | KK service number (KKサービス番号) — Fujitsu KK (K-Opticom) internal service identifier. |
| `op_svc_kei_no` | Field | Operator service number (オペレーターサービス番号). |
| `seiopsvc_kei_no` | Field | Service-operator number (サービスオペレーター番号). |
| `sbop_svc_kei_no` | Field | SBOP service number. |
| `wrib_svc_kei_no` | Field | WRIB service number. |
| `EKK1091D010` | Constant | Progress Registration (進捗登録) service component template ID. |
| `EKK0081A010` | Constant | Service Contract Agreement (サービス契約合意) template ID. |
| EKK1091D010SC | SC | Progress Registration Service Component — writes progress status updates to the progress registration table. |
| JKKKikiIchiranKkKaifukuCC | Class | Machine-Provided Service Contract Recovery Common Component — handles the shared logic for recovering interrupted or pending machine-provided service contracts. |
| K-Opticom | Business term | K-Opticom — Japanese telecommunications service provider (now part of KDDI). |
| eo顧客基幹システム | Business term | eo Customer Foundation System — the core customer management platform for K-Opticom/eo services. |
| 機器提供サービス契約回復処理 | Business term | Machine-Provided Service Contract Recovery Processing — business operation to recover service contracts that were interrupted during the provisioning process. |
| 進捗登録 | Business term | Progress Registration — the act of recording the current status/progress of a service contract workflow step. |
| 異動 | Business term | Service Change / Migration — any modification to an existing service (installation, change, cancellation). |
| 進捗概要 | Business term | Progress Summary — a human-readable string describing the current progress state of the workflow. |
| CAANMsg | Type | Template message container — holds structured CBS input/output data with field-name keys. |
| callSCArray | Method | Batch-capable service component array dispatcher — routes input arrays to CBS methods that accept array-list parameters. |
| getPrgTkjk | Method | Progress summary getter — retrieves the current progress breakdown string. |
| setShinchokuTkjk | Method | Progress summary setter (進捗概要設定) — persists the progress summary back to the parameter store. |
| isExecShinchokuToroku | Method | Execution guard — determines whether this workflow step requires progress registration. |
| getMskmDtlNo | Method | Management detail number extractor — derives the detail number from parameters and contract template. |
| getIdoUpDtm | Method | Service change upgrade date/time getter. |
| getNullToStr | Method | Null-to-empty-string utility — prevents null propagation into CBS inputs. |
