# Business Logic — JFUDslOpSvcKeiCC.setInMapMskmDtlShosaKzkwrkReq() [26 LOC]

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

## 1. Role

### JFUDslOpSvcKeiCC.setInMapMskmDtlShosaKzkwrkReq()

This method prepares and populates a request mapping map (inMap) for the **Application Details Inspection and Subsequent Business Request** workflow (上りマッピング項目設定(申込明細照査・後続業務依頼)). It is invoked during the options service contract handling pipeline to assemble the data payload required for the EKK0021C060 CBS — the subsequent business request service that processes application detail inspection (申込明細照査) and triggers downstream task assignment (後続業務依頼).

The method acts as a **data assembler** within a template-based mapping architecture. It retrieves the application detail content from a pre-built template list (populated during the application acceptance registration phase), fetches the original detail number, update timestamp, and a movement classification code (idoDiv) derived from the options service contract status. The `getIdoDiv` branch determines whether the contract is "settled" (締結済 — status "030"), which results in an "Option Reservation Cancellation" (オプション予約取消, code "00055"), or a regular "Option Set" (オプション設定, code "00031").

The assembled map is then used by downstream mappers (e.g., EKK0021C060BSMapper) to populate the CBS request message fields. This method does not perform any database CRUD operations itself — it is purely a data transformation and map-population step within the options service DSL (Domain-Specific Language) processing chain.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapMskmDtlShosaKzkwrkReq"])
    START --> S1["Get inMap = param.getData(fixedText)"]
    S1 --> S2["templateNo = index + 1"]
    S2 --> S3["Get idoDiv via getIdoDiv(opSvcKeiDslMap)"]
    S3 --> S4["Get mskmNaiyoList = getTemplateList(inMap, TEMP_TEMPLATE_EKK0011D020_\<templateNo>, EKK0011D020CBSMsg1List)"]
    S4 --> S5["mskmNaiyoMap = mskmNaiyoList.get(0)"]
    S5 --> S6["Put MSKM_DTL_NO from mskmNaiyoMap into inMap"]
    S6 --> S7["Put KZKWRK_REQYMD = JFUBPCommon.getOpeDate(null) into inMap"]
    S7 --> S8["Put UPD_DTM_BF = mskmNaiyoMap.get(KK0011_UPD_DTM) into inMap"]
    S8 --> S9["Put IDO_DIV = idoDiv into inMap"]
    S9 --> END(["Return (void)"])

    subgraph Branches
        B1{"opSvcKeiDslMap cc_op_svc_kei_stat == '030' (Settled)?"}
        B2["idoDiv = '00055' (Option Reservation Cancellation)"]
        B3["idoDiv = '00031' (Option Set)"]
    end

    S3 --> B1
    B1 -- "Yes (締結済)" --> B2
    B1 -- "No" --> B3
    B2 --> S4
    B3 --> S4
```

**Key constant values resolved:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `TEMP_TEMPLATE_PRIFIX` | `"TEMP_TEMPLATE_"` | Template key prefix for SC execution results |
| `TEMP_TEMPLATE_PRIFIX_SEP` | `"_"` | Template key separator |
| `TEMPLATE_ID_MSKM_NAIYO_SHONIN_ADD` | `"EKK0011D020"` | Template ID for application content acceptance registration |
| `TEMP_TEMPLATE_KEY_MSKM_NAIYO_SHONIN_ADD` | `"TEMP_TEMPLATE_EKK0011D020_"` | Computed template key prefix (prefix + templateId + separator) |
| `TEMPLATE_ID_DETAIL_MSKM_NAIYO_SHONIN_ADD` | `EKK0011D020CBSMsg.EKK0011D020CBSMSG1LIST` | Detail template ID — references the CBS message list key |
| `CC_OP_SVC_KEI_STAT` | `"cc_op_svc_kei_stat"` | Options service contract status field key |
| `JFUStrConst.CD00576_00055` | `"00055"` | Movement classification code for Option Reservation Cancellation |
| `JFUStrConst.CD00576_00031` | `"00031"` | Movement classification code for Option Set |
| `KK0011_UPD_DTM` | `"kk0011_upd_dtm"` | Update timestamp field key (before update) |
| `MSKM_DTL_NO` | `"mskm_dtl_no"` | Application detail number field key |
| `KZKWRK_REQYMD` | `"kzkwrk_reqymd"` | Subsequent business request year/month/day field key |
| `UPD_DTM_BF` | `"upd_dtm_bf"` | Update timestamp before update field key |
| `IDO_DIV` | `"ido_div"` | Movement classification field key |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter holder carrying all data for the current screen/SC execution. It provides `getData(fixedText)` to retrieve the temporary template map previously populated by the application detail acceptance registration SC (EKK0011D020). This is the primary data conduit between processing phases. |
| 2 | `fixedText` | `String` | The service message key (template ID) used as the lookup key to retrieve data from the param object. It identifies which data partition within the request parameter map to access — typically the SC execution result template key for the application detail acceptance registration. |
| 3 | `opSvcKeiDslMap` | `HashMap` | The options service contract cancellation information map. Contains the contract status field (`cc_op_svc_kei_stat`) which determines the movement classification (idoDiv) — whether the contract is "settled" (status "030") or in another state. |
| 4 | `index` | `int` | The options service contract processing target index. Used to compute the template number (`index + 1`) for retrieving the correct entry from the application detail list in the temporary template map. |

**External state / instance fields accessed:**
- None directly — this method is fully determined by its parameters.

## 4. CRUD Operations / Called Services

All calls within this method are reads. No create, update, or delete operations are performed.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUDslOpSvcKeiCC.getIdoDiv` | (internal method) | — | Retrieves the movement classification code based on the options service contract status from `opSvcKeiDslMap` |
| R | `JFUBPCommon.getOpeDate` | — | — | Retrieves the current operation date (year/month/day format) for the subsequent business request timestamp |
| R | `IRequestParameterReadWrite.getData` | — | — | Retrieves the pre-populated temporary template map from the request parameter using the `fixedText` key |
| R | `JFUDslOpSvcKeiCC.getTemplateList` | — | — | Retrieves the application detail content list from the temporary template map, filtered by template key and detail template ID |

**Detailed operation descriptions:**

1. **`param.getData(fixedText)` [R]** — Reads the temporary template map from the request parameter. This map was previously populated when the application detail acceptance registration SC (EKK0011D020) executed and stored its results in the param object. The `fixedText` key identifies the specific template partition.

2. **`getIdoDiv(opSvcKeiDslMap)` [R]** — Internal method that reads the contract status (`cc_op_svc_kei_stat`) from the options service contract map. If the status equals `"030"` (settled/締結済), returns `"00055"` (Option Reservation Cancellation); otherwise returns `"00031"` (Option Set).

3. **`getTemplateList(inMap, TEMP_TEMPLATE_KEY + templateNo, TEMPLATE_ID_DETAIL_MSKM_NAIYO_SHONIN_ADD)` [R]** — Reads the list of application detail content maps from the inMap. The template key is computed as `"TEMP_TEMPLATE_EKK0011D020_" + templateNo`, and the detail template ID resolves to `EKK0011D020CBSMsg1List`. The first element (index 0) is extracted as the current detail record.

4. **`JFUBPCommon.getOpeDate(null)` [R]** — Reads the current operation date from the system's date management. Returns a formatted string (e.g., "20260728") representing today's date for the subsequent business request timestamp.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `getOpeDate` [R], `getTemplateList` [R], `getData` [R], `getIdoDiv` [R].

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: JFUDslOpSvcKeiCC | `JFUDslOpSvcKeiCC.dslOpSvcKei()` -> `setInMapMskmDtlShosaKzkwrkReq()` | `param.getData [R]`, `getTemplateList [R]`, `getIdoDiv [R]`, `getOpeDate [R]` |

**Call chain detail:**

1. **`JFUDslOpSvcKeiCC.dslOpSvcKei()`** — The main DSL options service processing entry point in this class. It orchestrates the full options service contract handling flow, calling `setInMapMskmDtlShosaKzkwrkReq()` to populate the mapping map for the inspection request data before forwarding to downstream CBS processing.

**Terminal operations reached from this method:**
- `param.getData(fixedText)` [R] — Reads template data from request parameter
- `getTemplateList(...)` [R] — Reads application detail content list
- `getIdoDiv(...)` [R] — Reads contract status, returns movement classification
- `getOpeDate(null)` [R] — Reads current operation date

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(initialization)` (L610)

> Retrieve the temporary template map from the request parameter and compute the template number.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HashMap inMap = (HashMap)param.getData(fixedText);` // Retrieve user data (ユーザデータ取得) [-> fixedText = service message key] |
| 2 | SET | `int templateNo = index + 1;` // Compute template number from index [-> templateNo = index + 1] |

**Block 2** — [CALL] `(get idoDiv)` (L613)

> Determine the movement classification code by examining the options service contract status.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `String idoDiv = getIdoDiv(opSvcKeiDslMap);` // Get movement classification (異動区分を取得) — calls internal method |

**Block 2.1** — [GETIDO_DIV - internal] `(movement classification logic)` (L713)

> The `getIdoDiv` internal method checks the options service contract status and returns the appropriate movement classification code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String idoDiv = null;` // Initialize result variable |
| 2 | IF | `if (JFUStrConst.CD00037_030.equals(opSvcKeiDslMap.get(CC_OP_SVC_KEI_STAT)))` // Check if contract status is "030" (締結済 - Settled) [-> CC_OP_SVC_KEI_STAT = "cc_op_svc_kei_stat"] |

**Block 2.1.1** — [ELSE-IF / THEN branch] `(contract is settled — 締結済)` (L717)

> The options service contract status is "030" (settled/completed), indicating the contract has been finalized. Set movement classification to "00055" for option reservation cancellation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `idoDiv = JFUStrConst.CD00576_00055;` // Set movement classification "00055" (オプション予約取消 - Option Reservation Cancellation) [-> "00055"] |

**Block 2.1.2** — [ELSE branch] `(contract is not settled — 締結済以外)` (L720)

> The options service contract status is not "030" (not settled). Set movement classification to "00031" for regular option set.

| # | Type | Code |
|---|------|------|
| 1 | SET | `idoDiv = JFUStrConst.CD00576_00031;` // Set movement classification "00031" (オプション設定 - Option Set) [-> "00031"] |

**Block 3** — [CALL] `(get application detail content)` (L616)

> Retrieve the list of application detail content from the pre-populated template data. This data was stored by the EKK0011D020 CBS during the application acceptance registration phase.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `List<HashMap> mskmNaiyoList = getTemplateList((HashMap)param.getData(fixedText), TEMP_TEMPLATE_KEY_MSKM_NAIYO_SHONIN_ADD + templateNo, TEMPLATE_ID_DETAIL_MSKM_NAIYO_SHONIN_ADD);` // Get application registration detail content (申込登録明細情報を取得) [-> TEMP_TEMPLATE_KEY = "TEMP_TEMPLATE_EKK0011D020_" + templateNo, TEMPLATE_ID = EKK0011D020CBSMsg1List] |
| 2 | SET | `HashMap mskmNaiyoMap = mskmNaiyoList.get(0);` // Extract the first element as the current detail record |

**Block 4** — [EXEC / PUT chain] `(populate inMap fields)` (L620–L630)

> Set four key fields into the request mapping map (inMap) for the EKK0021C060 CBS request: detail number, subsequent business request date, pre-update timestamp, and movement classification.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `inMap.put(EKK0021C060CBSMsg.MSKM_DTL_NO, mskmNaiyoMap.get(EKK0011D020CBSMsg1List.MSKM_DTL_NO));` // Set application detail number (申込明細番号) — copies the original detail number from the template data [-> key = "mskm_dtl_no"] |
| 2 | EXEC | `inMap.put(EKK0021C060CBSMsg.KZKWRK_REQYMD, JFUBPCommon.getOpeDate(null));` // Set subsequent business request year/month/day (後続業務依頼年月日) — current operation date [-> key = "kzkwrk_reqymd"] |
| 3 | EXEC | `inMap.put(EKK0021C060CBSMsg.UPD_DTM_BF, mskmNaiyoMap.get(KK0011_UPD_DTM));` // Set update timestamp before update (更新年月日時分秒(更新前)) — original timestamp from template data [-> key = "upd_dtm_bf"] |
| 4 | EXEC | `inMap.put(EKK0021C060CBSMsg.IDO_DIV, idoDiv);` // Set movement classification (異動区分) — resolved from contract status ("00031" or "00055") [-> key = "ido_div"] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `setInMapMskmDtlShosaKzkwrkReq` | Method | Set in Map for Application Details Inspection and Subsequent Business Request — populates the request mapping map for the EKK0021C060 CBS |
| `mskm` | Abbreviation | 申込明細 (Shinmu Meisai) — Application Details / Order Line Items |
| `shosa` | Japanese | 照査 (Shosa) — Inspection / Verification — the process of reviewing application details |
| `kzkwrk` | Abbreviation | 後続業務 (Kousoku Gigyou) — Subsequent Business / Downstream Processing |
| `reqymd` | Abbreviation | Request Year/Month/Day — the date when the subsequent business request is made |
| `idoDiv` | Japanese field | 異動区分 (Idou Kubun) — Movement Classification — indicates the type of change: "00031" = Option Set (オプション設定), "00055" = Option Reservation Cancellation (オプション予約取消) |
| `cc_op_svc_kei_stat` | Field | Options Service Contract Status — the current status of an options service contract. Value "030" means settled/completed (締結済) |
| `upd_dtm_bf` | Field | Update Date/Time Before — the timestamp before an update operation, used for optimistic locking or audit trail |
| `mskm_dtl_no` | Field | Application Detail Number — the unique identifier for an application detail record |
| `kk0011_upd_dtm` | Field | KK0011 Update Date/Time — the update timestamp stored in the KK0011 template/detail data |
| `opSvcKeiDslMap` | Field | Options Service Contract DSL Map — a HashMap containing options service contract information including status, used for DSL processing |
| `fixedText` | Parameter | Service Message — the template/message key used to look up data in the request parameter map |
| `EKK0011D020` | Template ID | Application Content Acceptance Registration SC Template — the SC that handles application detail acceptance registration |
| `EKK0021C060` | SC Code | Subsequent Business Request SC — the CBS that processes the subsequent business request for application detail inspection |
| `EKK0011D020CBSMsg1List` | Template Detail ID | Detail list key for EKK0011D020 — used to identify the application detail content list in template data |
| `getOpeDate` | Method | Get Operation Date — retrieves the current business date (YYYYMMDD format) from the system |
| `TEMP_TEMPLATE_PRIFIX` | Constant | `"TEMP_TEMPLATE_"` — prefix for temporary template keys used in SC execution result storage |
| `TEMP_TEMPLATE_KEY_MSKM_NAIYO_SHONIN_ADD` | Constant | `"TEMP_TEMPLATE_EKK0011D020_"` — computed key prefix for application detail content template |
| CD00576_00031 | Constant | `"00031"` — movement classification code for Option Set (オプション設定) |
| CD00576_00055 | Constant | `"00055"` — movement classification code for Option Reservation Cancellation (オプション予約取消) |
| DSL | Business term | Domain-Specific Language — in this context, refers to the processing pipeline for options service contract operations (addition, cancellation, etc.) |
| CBS | Acronym | Core Business System — Fujitsu's middleware platform for enterprise business applications |
| SC | Acronym | Service Component — a unit of business logic within the CBS architecture |
| IRequestParameterReadWrite | Interface | Request parameter read/write interface — provides access to data carried across processing phases |
| 締結済 | Japanese | Settle / Completed — the state of a contract that has been finalized |
| オプション設定 | Japanese | Option Set — adding or configuring an optional service |
| オプション予約取消 | Japanese | Option Reservation Cancellation — canceling a reserved option service |
| JFUStrConst | Class | Fujitsu String Constants — a shared constants class containing standardized code values |
| JFUBPCommon | Class | Fujitsu BP Common — shared utility class with common business processing methods (e.g., getOpeDate) |
| JFUDslOpSvcKeiCC | Class | Fujitsu DSL Options Service Contract Common Component — the common component class for DSL-based options service contract processing |
