# (DD13) Business Logic — JFUSetVariTsushinKikiMskmCC.setInMapMskmRegist() [35 LOC]

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

## 1. Role

### JFUSetVariTsushinKikiMskmCC.setInMapMskmRegist()

This method is a data preparation utility that constructs the input map structure for the **Application Content Approval Registration** (申込内容承認登録 — EKK0011D020) CBS (Business Component Service). Specifically, it populates the parent-level registration fields (system ID, service type code, timestamps, and consultation business status code) and builds the detail child-map required by the CBS message schema (EKK0011D020CBSMsg1List). The CBS message schema `EKK0011D020CBSMsg` contains a nested array `EKK0011D020CBSMsg1List` that holds per-detail-line data for application submission. The method follows a **builder pattern** — it initializes every possible detail field to null via `IN_COLUMN_LIST_1_DETAIL`, then populates only the two fields actually needed for the registration: the application form code (`MSKM_FORM_CD` = `"01"`, meaning standard registration) and the application detail number (`MSKMSHO_DTL_NO`). It serves as a **shared builder utility** called by the parent orchestrator method `setVariTsushinKikiMskm`, which coordinates the full multi-step flow of equipment contract line registration including service contract history search, application approval registration, and service IF execution.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapMskmRegist params"])
    STEP1["SET Func Code FUNC_CD_1=1 Check and Register"]
    STEP2["GET inMap param.getData"]
    STEP3["SET SYSID inMap.put SYSID sysId"]
    STEP4["SET MSKM_SBT_CD KK0971_MSKM_SBT_CD_00022"]
    STEP5["SET MSKM_UK_DTM getOpeDateTimeStamp"]
    STEP6["SET MSKM_YMD getOpeDate"]
    STEP7["SET CONSMBSN_MSKM_STAT_SKBT_CD CD00760_04"]
    STEP8["CREATE list new ArrayList"]
    STEP9["CREATE childMap new HashMap"]
    STEP10["FOR key IN_COLUMN_LIST_1_DETAIL"]
    STEP11["SET MSKM_FORM_CD CD00591_01"]
    STEP12["SET MSKMSHO_DTL_NO mskmshoDtlNo"]
    STEP13["list.add childMap"]
    STEP14["SET Detail List EKK0011D020CBSMSG1LIST"]
    END_NODE(["Return"])

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> STEP6 --> STEP7 --> STEP8 --> STEP9 --> STEP10 --> STEP11 --> STEP12 --> STEP13 --> STEP14 --> END_NODE
```

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `FUNC_CD_1` | `"1"` | Function code for Check and Register (JPCModelConstant.java:29) [-> FUNC_CD_1="1" (JPCModelConstant.java:29)] |
| `KK0971_MSKM_SBT_CD_00022` | `"00022"` | Application type code for this registration scenario (JFUStrConst.java:8424) [-> KK0971_MSKM_SBT_CD_00022="00022" (JFUStrConst.java:8424)] |
| `CD00760_04` | `"04"` | Consultation business application status identifier code (JFUStrConst.java:5298) [-> CD00760_04="04" (JFUStrConst.java:5298)] |
| `CD00591_01` | `"01"` | Application form code — standard/formal registration (JFUStrConst.java:4122) [-> CD00591_01="01" (JFUStrConst.java:4122)] |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request parameter container that carries data between processing steps. It provides `getData(fixedText)` to retrieve the working map and serves as the data exchange object for the CBS invocation. |
| 2 | `fixedText` | `String` | Service message identifier — used as the map key to retrieve the correct data context (`inMap`) from `param`. |
| 3 | `sysId` | `String` | System ID identifying the originating system for the registration request. Set as the `SYSID` field in the CBS message. |
| 4 | `mskmshoDtlNo` | `String` | Application detail number (申込書明細番号) — a unique identifier for the application line item being registered. Populated into the child-map's `MSKMSHO_DTL_NO` field. |

**External state / instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `IN_COLUMN_LIST_1_DETAIL` | `List<String>` | Static list of 36 input item keys for the Application Content Approval Registration detail section. Each key is initialized to null in the child-map (source: `JFUSetVariTsushinKikiMskmCC.java:221`) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBPCommon.getOpeDateTimeStamp` | JCCBPCommon | - | Calls `getOpeDateTimeStamp` to obtain the current operation date-time stamp for the `MSKM_UK_DTM` (Application Receipt Date-Time) field |
| R | `JCCBPCommon.getOpeDate` | JCCBPCommon | - | Calls `getOpeDate` to obtain the current operation date for the `MSKM_YMD` (Application Date) field |
| - | `JFUBaseCC.setFuncCode` | JFUBaseCC | - | Calls `setFuncCode` in `JFUBaseCC` to set the function code `"1"` (Check and Register) |
| R | `JFUTransferCC.getData` | JFUTransferCC | - | Calls `getData` in `JFUTransferCC` (from dependency graph) |
| R | `JFUTransferListToListCC.getData` | JFUTransferListToListCC | - | Calls `getData` in `JFUTransferListToListCC` (from dependency graph) |
| R | `JKKCreditAddCC.getOpeDate` | JKKCreditAddCC | - | Calls `getOpeDate` in `JKKCreditAddCC` (from dependency graph) |
| R | `JKKCreditAddCC.getOpeDateTimeStamp` | JKKCreditAddCC | - | Calls `getOpeDateTimeStamp` in `JKKCreditAddCC` (from dependency graph) |
| R | `JKKModelCommon.getOpeDate` | JKKModelCommon | - | Calls `getOpeDate` in `JKKModelCommon` (from dependency graph) |
| R | `KKW12701SFLogic.getData` | KKW12701SFLogic | - | Calls `getData` in `KKW12701SFLogic` (from dependency graph) |
| - | `JFUBPCommon.setFuncCode` | JFUBPCommon | - | Calls `setFuncCode` in `JFUBPCommon` (from dependency graph) |
| R | `JFUeoTelOpTransferCC.getData` | JFUeoTelOpTransferCC | - | Calls `getData` in `JFUeoTelOpTransferCC` (from dependency graph) |
| R | `JFUEoTvCngAddStbCC.getOpeDate` | JFUEoTvCngAddStbCC | - | Calls `getOpeDate` in `JFUEoTvCngAddStbCC` (from dependency graph) |
| R | `JFUEoTvCngAddStbCC.getOpeDateTimeStamp` | JFUEoTvCngAddStbCC | - | Calls `getOpeDateTimeStamp` in `JFUEoTvCngAddStbCC` (from dependency graph) |
| R | `JFUHikkosiNaviRelAddCC.getOpeDate` | JFUHikkosiNaviRelAddCC | - | Calls `getOpeDate` in `JFUHikkosiNaviRelAddCC` (from dependency graph) |
| R | `JKKBPActCommon.setFuncCode` | JKKBPActCommon | - | Calls `setFuncCode` in `JKKBPActCommon` (from dependency graph) |
| - | `JKKBaseCC.setFuncCode` | JKKBaseCC | - | Calls `setFuncCode` in `JKKBaseCC` (from dependency graph) |
| R | `JKKBatCommon.getOpeDateTimeStamp` | JKKBatCommon | - | Calls `getOpeDateTimeStamp` in `JKKBatCommon` (from dependency graph) |
| R | `JBSbatDKNyukaFinAdd.getData` | JBSbatDKNyukaFinAdd | - | Calls `getData` in `JBSbatDKNyukaFinAdd` (from dependency graph) |
| R | `JBSbatZMAddBmpInfo.getOpeDateTimeStamp` | JBSbatZMAddBmpInfo | - | Calls `getOpeDateTimeStamp` in `JBSbatZMAddBmpInfo` (from dependency graph) |
| R | `JFUBaseUtil.setFuncCode` | JFUBase | - | Calls `setFuncCode` in `JFUBaseUtil` (from dependency graph) |

### Directly called by setInMapMskmRegist:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `setFuncCode(param, fixedText, FUNC_CD_1)` | JFUBaseCC | - | Sets function code `"1"` on the request parameter — indicates Check and Register operation mode |
| R | `param.getData(fixedText)` | - | - | Retrieves the working `HashMap` from the parameter container |
| R | `JCCBPCommon.getOpeDateTimeStamp(null)` | JCCBPCommon | - | Fetches current system date-time for the application receipt timestamp |
| R | `JCCBPCommon.getOpeDate(null)` | JCCBPCommon | - | Fetches current system date for the application date field |

## 5. Dependency Trace

### Direct callers:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `setVariTsushinKikiMskm` | `JFUSetVariTsushinKikiMskmCC.setVariTsushinKikiMskm` (public entry) → `getMskmshoDtlNoSibn` (generates detail number) → `initData` (initializes map) → `setInMapMskmRegist(param, fixedText, inParamSysId, mskmshoDtlNo)` | `getOpeDate [R] JCCBPCommon`, `getOpeDateTimeStamp [R] JCCBPCommon`, `setFuncCode [-] JFUBaseCC` |

**Notes:**
- No screen/batch entry points (KKSV*, KKBT*) were found within 8 hops of this private method. It is invoked purely as an internal helper within the same CC class.
- The method itself performs no direct database CRUD — it is a pure data-builder that prepares the CBS message structure. The actual database operations are performed by the CBS `EKK0011D020` when called via `executeSC` by the caller method `setVariTsushinKikiMskm`.
- Terminal operations from this method: `setFuncCode` [-], `param.getData` [-], `getOpeDate` [R], `getOpeDateTimeStamp` [R]

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` (L1678)

> Sets the function code to "1" (Check & Register). This is the standard function code for data validation and registration operations. No conditional branches — always executed.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` // Set function code Check and Register [-> FUNC_CD_1="1" (JPCModelConstant.java:29)] |

**Block 2** — [EXEC] Retrieve working map (L1681)

> Retrieves the inMap HashMap from param using the fixedText key.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HashMap inMap = (HashMap)param.getData(fixedText)` // Get working map from param |

**Block 3** — [SET] Top-level field population (L1684–L1689)

> Populates 5 top-level CBS message fields into the inMap. These fields correspond to the parent-level schema of `EKK0011D020CBSMsg`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0011D020CBSMsg.SYSID, sysId)` // SYSID [-> SYSID="sysid" (JKKEponSwchKjInfSksiConstCC.java:85)] |
| 2 | SET | `inMap.put(EKK0011D020CBSMsg.MSKM_SBT_CD, JFUStrConst.KK0971_MSKM_SBT_CD_00022)` // Application type code [-> KK0971_MSKM_SBT_CD_00022="00022" (JFUStrConst.java:8424)] |
| 3 | SET | `inMap.put(EKK0011D020CBSMsg.MSKM_UK_DTM, JCCBPCommon.getOpeDateTimeStamp(null))` // Application receipt date-time stamp [-> MSKM_UK_DTM="mskm_uk_dtm" (EKK0011D020CBSMsg.java:35)] |
| 4 | SET | `inMap.put(EKK0011D020CBSMsg.MSKM_YMD, JCCBPCommon.getOpeDate(null))` // Application date [-> MSKM_YMD="mskm_ymd" (EKK0011D020CBSMsg.java:36)] |
| 5 | SET | `inMap.put(EKK0011D020CBSMsg.CONSMBSN_MSKM_STAT_SKBT_CD, JFUStrConst.CD00760_04)` // Consultation business application status identifier code [-> CD00760_04="04" (JFUStrConst.java:5298)] |

**Block 4** — [CREATE] Initialize detail structures (L1691–L1692)

> Creates the ArrayList and HashMap containers for the detail child records.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList list = new ArrayList()` // Container for detail child maps |
| 2 | SET | `HashMap childMap = new HashMap()` // Single detail child record |

**Block 5** — [FOR] Initialize detail fields to null (L1694–L1697)

> Iterates over `IN_COLUMN_LIST_1_DETAIL` (36 fields) and sets each to null. This pre-populates the child-map with all known CBS message fields, ensuring every field is present even if not explicitly set.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `for (String key : IN_COLUMN_LIST_1_DETAIL)` // IN_COLUMN_LIST_1_DETAIL: Application content approval registration detail input items [-> IN_COLUMN_LIST_1_DETAIL (JFUSetVariTsushinKikiMskmCC.java:221)] |
| 1.1 | SET | `childMap.put(key, null)` // Initialize each field to null |

**Block 6** — [SET] Populate application form code (L1700)

> Sets the application form code to "01" (standard/formal registration application form).

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put(EKK0011D020CBSMsg1List.MSKM_FORM_CD, JFUStrConst.CD00591_01)` // Application form code [-> CD00591_01="01" (JFUStrConst.java:4122)] |

**Block 7** — [SET] Set detail number and add to list (L1702–L1704)

> Sets the application detail number into the child-map and adds the child-map to the detail list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put(EKK0011D020CBSMsg1List.MSKMSHO_DTL_NO, mskmshoDtlNo)` // Application detail number [-> MSKMSHO_DTL_NO="mskmsho_dtl_no" (JKKEponSwchKjInfSksiConstCC.java:114)] |
| 2 | EXEC | `list.add(childMap)` // Add detail record to list |
| 3 | SET | `inMap.put(EKK0011D020CBSMsg.EKK0011D020CBSMSG1LIST, list)` // Attach detail list to parent map [-> EKK0011D020CBSMSG1LIST="EKK0011D020CBSMsg1List" (EKK0011D020CBSMsg.java:627)] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SYSID` | Field | System ID — identifies the originating system making the registration request |
| `mskm_sbt_cd` | Field | Application type code (申込種別コード) — classifies the type of application submission; `"00022"` is the code used in this registration flow |
| `mskm_uk_dtm` | Field | Application receipt date-time (申込受付年月日時刻) — timestamp when the application was received/processed |
| `mskm_ymd` | Field | Application date (申込年月日) — the date on which the application was made |
| `consmbsn_mskm_stat_skbt_cd` | Field | Consultation business application status identifier code (コンサル事業用申込状態識別コード) — `"04"` indicates a specific application processing status in the consultation business workflow |
| `mskm_form_cd` | Field | Application form code (申込形態コード) — `"01"` indicates standard/formal registration (not provisional) |
| `mskmsho_dtl_no` | Field | Application detail number (申込書明細番号) — unique identifier for a specific application line item within a parent application |
| `EKK0011D020CBSMsg` | CBS Message | CBS message schema for Application Content Approval Registration (申込内容承認登録) — parent-level message structure |
| `EKK0011D020CBSMsg1List` | CBS Message | Detail list schema nested within EKK0011D020CBSMsg — holds per-line-item data for application registration |
| `IN_COLUMN_LIST_1_DETAIL` | Constant List | Input item list (入力項目リスト) for Application Content Approval Registration detail section — 36 field keys pre-initialized to null |
| `FUNC_CD_1` | Constant | Function code `"1"` — Check and Register operation mode |
| `CD00760_04` | Constant | Status identifier code `"04"` — Consultation business application status |
| `CD00591_01` | Constant | Form code `"01"` — Standard application form |
| `KK0971_MSKM_SBT_CD_00022` | Constant | Application type code `"00022"` — specific to this registration scenario |
| `JCCBPCommon` | Class | Common utility class for operation date/time functions |
| `setFuncCode` | Method | Sets the function code on the request parameter to indicate the operation type |
| `param.getData` | Method | Retrieves the working HashMap data container from the request parameter |
| `EKK0011D020CBSMSG1LIST` | Constant | Map key `"EKK0011D020CBSMsg1List"` — used to store the detail list in the parent map |
| MSKM | Abbreviation | 申込 (Shinbo) — Application / Order |
| CBS | Abbreviation | Business Component Service — the service layer component that executes business logic and interacts with the database |
| SC Code | Abbreviation | Service Component — the identifier pattern for CBS-level service components (e.g., `EKK0011D020`) |
