# Business Logic — JKKPopPwdShkkaRnkAddCC.mappingEKK0021C060InMsg() [49 LOC]

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

## 1. Role

### JKKPopPwdShkkaRnkAddCC.mappingEKK0021C060InMsg()

This method is a template data mapper that prepares inbound message parameters for the **EKK0021C060 SIF** — the "Application Detail Inspection and Follow-up Business Request SKM Class" service interface. In K-Opticom's eo customer core system, when a customer requests to initially set up their POP password (POP PW initial configuration), the system must first register an application detail record and trigger follow-up business workflows through this SIF. The method receives a `CAANMsg` template and populates it with the correct template ID, function code, application detail number (`mskm_dtl_no`), operation date (`kzkwrk_reqymd`), and pre-update timestamp (`upd_dtm_bf`). It implements a **data-routing pattern**: although the original design included conditional branching based on the `i` index parameter to select between two different source templates (EKK0011D020 or EKK0021D010), the current implementation unconditionally routes through the EKK0011D020 source path. This method is called exclusively from `callEKK0021C060SC()` and serves as a shared common-component utility used across multiple screens and batch processes that handle POP password initial linkage (POPPW initial configuration).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["mappingEKK0021C060InMsg"])
    
    START --> A["fillCAANMSGNullMapping - Set null mappings for all EKK0021C060CBSMsg fields"]
    
    A --> B["Set TEMPLATEID = EKK0021C060"]
    
    B --> C["Set FUNC_CODE = 1"]
    
    C --> D["Check: i == 0"]
    
    D -->|true| E["Get eKK0011D020Hash from resultHash[TEMPLATE_ID_EKK0011D020]"]
    
    E --> F["Get eKK0011D020CBSMSG1LIST array from eKK0011D020Hash"]
    
    F --> G["Set eKK0011D020CBSMSG = eKK0011D020CBSMSG1LIST[0]"]
    
    G --> H["retHash = eKK0011D020CBSMSG.getMsgData()"]
    
    D -->|false| I["Branch commented out - else path for TEMPLATE_ID_EKK0021D010"]
    
    I --> J["Set MSKM_DTL_NO from retHash[mskm_dtl_no]"]
    
    H --> J
    
    J --> K["Set KZKWRK_REQYMD = oPE_DATE"]
    
    K --> L["Set UPD_DTM_BF from eKK0011D020Hash[upd_dtm]"]
    
    L --> END(["Return"])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `template` | `CAANMsg` | The SIF inbound message template object (EKK0021C060CBSMsg schema). Business meaning: the request payload being constructed and populated with condition data before being sent to the EKK0021C060 service interface. This template carries the application detail inspection and follow-up business request parameters. |
| 2 | `inHash` | `HashMap<String, Object>` | The condition hash containing input criteria. Business meaning: search/request conditions passed from the calling screen or batch process (e.g., POP ID, service contract number). This method does not actively read from `inHash` in the current implementation — the parameter is retained for future extensibility or alternative routing branches. |
| 3 | `resultHash` | `HashMap<String, Object>` | The result hash containing data from previously executed service component calls. Business meaning: holds the output of the EKK0011D020 (Application Content Approval Registration) SIF execution. This method retrieves the application detail data (`mskm_dtl_no`) and pre-update timestamp (`upd_dtm`) from this hash, which represent the result of an earlier "approval registration" step that must complete before the follow-up business request can be submitted. |
| 4 | `i` | `int` | The registration loop counter/index. Business meaning: tracks which iteration of a POP password batch registration loop this call corresponds to. Originally used to select between two source template paths (EKK0011D020 when `i == 0`, EKK0021D010 otherwise), but the conditional branch is now commented out and the method always uses the EKK0011D020 source path. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `oPE_DATE` | `String` | The current operation date used for the follow-up business request date field (`kzkwrk_reqymd`). This is an instance-level timestamp set at the class level (IT1-2013-0000291 modification moved from static to instance field). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `fillCAANMSGNullMapping` | JKKPopPwdShkkaRnkAddCC | - | Internal method call — initializes null mapping for all fields in the EKK0021C060CBSMsg template schema. This ensures all message fields have default null values before populating the required ones. |
| R | `EKK0011D020CBSMsg.getMsgData` | EKK0011D020CBSMsg | - | Reads application detail data from the EKK0011D020 (Application Content Approval Registration) message result. Extracts the `mskm_dtl_no` (application detail number) and `upd_dtm` (pre-update timestamp) for inclusion in the EKK0021C060 request. |

**CRUD Classification:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| M | `fillCAANMSGNullMapping` | JKKPopPwdShkkaRnkAddCC | CAANMsg template (EKK0021C060CBSMsg) | Map — performs null-field initialization (pre-population) of the SIF inbound message template before business data assignment. |
| R | `EKK0011D020CBSMsg.getMsgData` | EKK0011D020CBSMsg | Application Detail Data (in-memory) | Read — extracts application approval registration results from the EKK0011D020 service response. This retrieves the `mskm_dtl_no` (application detail number) and `upd_dtm` (pre-update timestamp) that must be included in the EKK0021C060 follow-up request to maintain data consistency. |

**Notes:**
- The EKK0011D020 CBS (Application Content Approval Registration) is **not directly invoked** by this method. It is a dependency — the EKK0011D020 result must be available in `resultHash` before `mappingEKK0021C060InMsg` is called. The actual EKK0011D020 execution occurs in a prior step within the calling method `callEKK0021C060SC`.
- This method is a **data mapper only** — it does not perform any database operations or invoke remote services directly. It transforms pre-existing result data into the format required by the EKK0021C060 SIF.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 3 methods.
Terminal operations from this method: `fillCAANMSGNullMapping` [-], `getMsgData` [R], `get` [R], `get` [R], `get` [R]  # NOSONAR

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:JKKPopPwdShkkaRnkAddCC | `callEKK0021C060SC(param, handle, inHash, resultHash, i)` -> `mappingEKK0021C060InMsg(template, inHash, resultHash, i)` | `fillCAANMSGNullMapping [-]`, `getMsgData [R]` |

**Caller context:** The method is called from `callEKK0021C060SC()` within the same class `JKKPopPwdShkkaRnkAddCC`. The caller is part of the POP Password Initial Configuration (POPPW) linkage subsystem, which handles the initial setup of POP passwords by coordinating with application detail approval registration and follow-up business request services.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `fillCAANMSGNullMapping(template, new EKK0021C060CBSMsg().getContents())` (L1577)

> Initialize all template fields with null mappings. This is a prerequisite step that ensures the CAANMsg template is properly initialized with default null values for every field defined in the EKK0021C060CBSMsg schema before any business data is populated.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `fillCAANMSGNullMapping(template, new EKK0021C060CBSMsg().getContents())` // Set null mappings for all EKK0021C060CBSMsg template fields |

**Block 2** — [SET] `template.set(EKK0021C060CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0021C060)` (L1580)

> Set the template ID (SIF identifier) on the message template. The TEMPLATEID field tells the SIF framework which message schema to use for processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0021C060CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0021C060)` // TEMPLATE_ID_EKK0021C060 = "EKK0021C060" [-> TEMPLATE_ID_EKK0021C060="EKK0021C060" (JKKPopPwdShkkaRnkAddCC.java:142)] |

**Block 3** — [SET] `template.set(EKK0021C060CBSMsg.FUNC_CODE, "1")` (L1583)

> Set the function code. Value "1" indicates the standard operation mode (as opposed to inquiry, cancellation, etc.). This tells the EKK0021C060 service what type of operation is being requested.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0021C060CBSMsg.FUNC_CODE, "1")` // Set function code to "1" (standard operation) |

**Block 4** — [IF/TRUE] `(i == 0)` — EKK0011D020 source path (L1586)

> Although the `if` statement is commented out (effectively always entering the true branch), the logic retrieves parameter data from the EKK0011D020 (Application Content Approval Registration) result hash. This hash contains the application detail data — including the application detail number (`mskm_dtl_no`) and pre-update timestamp — that must be carried over into the EKK0021C060 request. The EKK0011D020 service must have been called and completed before this method executes, as its results are a prerequisite.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0011D020Hash = (HashMap<String, Object>)resultHash.get(TEMPLATE_ID_EKK0011D020)` // Retrieve EKK0011D020 result hash from resultHash [-> TEMPLATE_ID_EKK0011D020="EKK0011D020" (JKKPopPwdShkkaRnkAddCC.java:139)] |
| 2 | SET | `eKK0011D020CBSMSG1LIST = (CAANMsg[])eKK0011D020Hash.get(EKK0011D020CBSMsg.EKK0011D020CBSMSG1LIST)` // Extract CBSMSG1LIST array |
| 3 | SET | `eKK0011D020CBSMSG = eKK0011D020CBSMSG1LIST[0]` // Take first element (index 0) from the list |
| 4 | SET | `retHash = eKK0011D020CBSMSG.getMsgData()` // Get message data map from the first CBS message |

**Block 5** — [IF/FALSE] `i != 0` — EKK0021D010 source path (commented out, L1595)

> The alternative path for non-zero index values is commented out. This originally would have retrieved the EKK0021D010 template data from resultHash instead. This path is no longer active.

| # | Type | Code |
|---|------|------|
| 1 | SET | `// eKK0011D020Hash = (HashMap<String, Object>)resultHash.get(TEMPLATE_ID_EKK0021D010);` // [-> TEMPLATE_ID_EKK0021D010="EKK0021D010"] — Commented out, no longer active |

**Block 6** — [SET] `template.set(EKK0021C060CBSMsg.MSKM_DTL_NO, retHash.get(EKK0011D020CBSMsg1List.MSKM_DTL_NO))` (L1602)

> Set the application detail number (`mskm_dtl_no`) on the template. This value is extracted from the EKK0011D020 application approval registration result and links the follow-up business request to the specific application detail that was previously registered and approved.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0021C060CBSMsg.MSKM_DTL_NO, retHash.get(EKK0011D020CBSMsg1List.MSKM_DTL_NO))` // Set application detail number from EKK0011D020 approval result |

**Block 7** — [SET] `template.set(EKK0021C060CBSMsg.KZKWRK_REQYMD, oPE_DATE)` (L1605)

> Set the follow-up business request date (`kzkwrk_reqymd`). The value is read from the instance field `oPE_DATE` which holds the current operation date. This records when the follow-up business request was initiated.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0021C060CBSMsg.KZKWRK_REQYMD, oPE_DATE)` // oPE_DATE is an instance field set at class level (IT1-2013-0000291) |

**Block 8** — [SET] `template.set(EKK0021C060CBSMsg.UPD_DTM_BF, eKK0011D020Hash.get(EKK0011D020CBSMsg.UPD_DTM))` (L1608)

> Set the pre-update timestamp (`upd_dtm_bf`). This value comes from the EKK0011D020 result hash's `upd_dtm` (update timestamp) field. The "BF" suffix indicates this is the timestamp **before** the current update operation, used for optimistic concurrency control and audit trail purposes.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0021C060CBSMsg.UPD_DTM_BF, eKK0011D020Hash.get(EKK0011D020CBSMsg.UPD_DTM))` // Pre-update timestamp from EKK0011D020 result |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mskm_dtl_no` | Field | Application Detail Number — a unique identifier for a specific application detail record within the application registration workflow |
| `mskmsho_no` | Field | Application Document Number — the identifier for the application document/submission record |
| `kzkwrk_reqymd` | Field | Follow-up Business Request Date — the date on which a follow-up business operation (such as inspection or registration) is requested after the initial application approval |
| `upd_dtm_bf` | Field | Pre-Update Datetime — the timestamp of the last update before the current operation; used for optimistic locking and audit trail verification |
| `upd_dtm` | Field | Update Datetime — the timestamp of the most recent update to a record |
| `func_code` | Field | Function Code — indicates the type of operation being performed (e.g., "1" for standard operation, other values for inquiry/cancellation) |
| `TEMPLATEID` | Field | Template ID — the SIF (Service Interface) identifier that specifies which message schema should be used for processing |
| TEMPLATE_ID_EKK0021C060 | Constant | Template ID for EKK0021C060 — "EKK0021C060", the Application Detail Inspection and Follow-up Business Request SIF |
| TEMPLATE_ID_EKK0011D020 | Constant | Template ID for EKK0011D020 — "EKK0011D020", the Application Content Approval Registration SIF |
| POPPW | Business term | POP Password — refers to the initial configuration of POP (Post Office Protocol) passwords, which are credentials for email access in K-Opticom's fiber optic service |
| POPPW Initial Configuration (POPPW初期化) | Business process | The workflow for initializing a customer's POP password, involving application detail registration, approval, and follow-up business processing |
| EKK0021C060 | SC Code | Application Detail Inspection and Follow-up Business Request SKM Class — a service component that triggers the inspection and follow-up workflow for registered application details |
| EKK0011D020 | SC Code | Application Content Approval Registration SKM Class — a service component that registers and approves application content as the prerequisite step before follow-up requests |
| EKK0011D020CBSMSG1LIST | Field | EKK0011D020 CBS Message 1 List — the list/array field containing EKK0011D020 result message entries |
| SIF | Acronym | Service Inter-Face — the communication protocol/interface layer for invoking backend service components in the Fujitsu BP platform |
| CAANMsg | Technical type | A message object used in the Fujitsu BP platform for carrying structured data between service components |
| CAANSchemaInfo | Technical type | Base class for message schemas defining the structure (field names and types) of CAANMsg objects |
| SKM | Acronym | Service Knowledge Management — in this context, refers to the SKM Class (service component class) that handles specific service operations |
| oPE_DATE | Field | Operation Date — an instance-level field holding the current system operation date for use in timestamp fields |
| resultHash | Field | Result Hash — a HashMap that stores the output data from previously executed service component calls, used as input for subsequent processing steps |
| EKK | Prefix | K-Opticom system prefix — part of the SIF code naming convention (EKK = customer core system service component) |
