# Business Logic — JKKIntrInfoChgCfmCC.mappingEKK1091D010InMsg() [60 LOC]

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

## 1. Role

### JKKIntrInfoChgCfmCC.mappingEKK1091D010InMsg()

This method is the message mapping entry point for the inter-agent information change confirmation service (EKK1091D010). It takes incoming request data and workspace data, then maps them into a CAANMsg template structure that will be transmitted to an external Service Interface (SIF) as part of the Fujitsu Futurity SIF framework. The method handles two distinct update scenarios based on the `updInfo` parameter: when `updInfo` equals `"1"` (UPD_INTR_CD), it represents an **inter-agent code update** and populates the `PRG_TKJK_1` field by calling `makePrgThik()`; when `updInfo` equals `"2"` (UPD_COUPON_CD), it represents a **coupon code update** and populates `PRG_TKJK_2` via `makePrgThik2()`. It serves as a data transformation bridge between the business layer (which provides `inMap` and `workMap`) and the service component layer (EKK1091D010SC) that consumes the fully populated CAANMsg template. The method sets operational metadata (operation timestamp, function code, progress state) alongside business fields (service agreement number, intermediary detail number, change division) to ensure the downstream SC has all context needed for processing.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["mappingEKK1091D010InMsg"])
    S1["fillCAANMSGNullMapping - Null mapping for all fields"]
    S2["Set TEMPLATEID = EKK1091D010"]
    S3["Set FUNC_CODE from inMap.func_code"]
    S4["Set MSKM_DTL_NO from workMap.hi_mskm_dtl_no"]
    S5["Set SVC_KEI_NO from inMap.hi_svc_kei_no"]
    S6["Set IDO_DIV from inMap.ido_div"]
    S7["Set IDO_DTM = getOpeDateTimeStamp(null)"]
    S8["Set PRG_STAT = 1002 (Complete)"]
    S9{"updInfo equals UPD_INTR_CD=\"1\""}
    S10["Set PRG_TKJK_1 = makePrgThik(inMap, workMap)"]
    S11["inMap.put intr_cd_msg from PRG_TKJK_1"]
    S12{"updInfo equals UPD_COUPON_CD=\"2\""}
    S13["Set PRG_TKJK_2 = makePrgThik2(inMap, workMap)"]
    END(["Return void"])

    START --> S1 --> S2 --> S3 --> S4 --> S5 --> S6 --> S7 --> S8 --> S9
    S9 -- "true" --> S10 --> S11 --> END
    S9 -- "false" --> S12
    S12 -- "true" --> S13 --> END
    S12 -- "false" --> END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `template` | `CAANMsg` | The output message template (EKK1091D010CBSMsg schema) that is populated with mapped field values and returned to the caller. It serves as the request payload sent to the EKK1091D010 service component. |
| 2 | `inMap` | `HashMap<String, Object>` | Incoming request data map carrying business values extracted from the screen input, including `func_code` (function code for request parameters), `hi_svc_kei_no` (intermediary service agreement number), and `ido_div` (change division). Also receives the computed `intr_cd_msg` value during inter-agent code update processing. |
| 3 | `workMap` | `HashMap<String, Object>` | Working data map carrying auxiliary information across processing steps. Contains `hi_mskm_dtl_no` (intermediary application detail number — the reference number obtained from the service contract agreement meeting) and additional data consumed by `makePrgThik()`/`makePrgThik2()` for special item computation. |
| 4 | `updInfo` | `String` | Update type discriminator that determines which special item field (`PRG_TKJK_1` or `PRG_TKJK_2`) gets populated and what downstream action occurs. Takes one of two values: `"1"` (`UPD_INTR_CD`, inter-agent code update) or `"2"` (`UPD_COUPON_CD`, coupon code update). Determines the branching path of the method. |

**Instance fields referenced:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `EKK1091D010` | `String` | The SIF (Service Interface) identifier constant set into the template as the request ID. Value: `"EKK1091D010"` [-> EKK1091D010="EKK1091D010" (JKKIntrInfoChgCfmCC.java:116)] |
| `UPD_INTR_CD` | `String` | Update type constant for inter-agent code update. When `updInfo` matches, the method treats this as an inter-agent code change scenario [-> UPD_INTR_CD="1" (JKKIntrInfoChgCfmCC.java:177)] |
| `UPD_COUPON_CD` | `String` | Update type constant for coupon code update. When `updInfo` matches, the method treats this as a coupon code change scenario [-> UPD_COUPON_CD="2" (JKKIntrInfoChgCfmCC.java:179)] |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKIntrInfoChgCfmCC.fillCAANMSGNullMapping` | JKKIntrInfoChgCfmCC | - | Sets all fields in the EKK1091D010CBSMsg template to null as initialization step |
| R | `JCCBPCommon.getOpeDateTimeStamp` | JCCBPCommon | - | Retrieves the current operation date/time stamp for the `IDO_DTM` (change date/time) field |
| - | `JKKIntrInfoChgCfmCC.makePrgThik` | JKKIntrInfoChgCfmCC | - | Computes the program special item text (`PRG_TKJK_1`) for inter-agent code update from inMap and workMap |
| - | `JKKIntrInfoChgCfmCC.makePrgThik2` | JKKIntrInfoChgCfmCC | - | Computes the program special item text (`PRG_TKJK_2`) for coupon code update from inMap and workMap |
| R | `EKK1091D010CBSMsg.getContents` | EKK1091D010CBS | - | Gets the message contents/schema definition for null-mapping initialization |

**Note:** `mappingEKK1091D010InMsg` itself does not directly call any database-scoped service components. It is a pure mapping/transformation method. The downstream `callEKK1091D010SC` method (which calls `mappingEKK1091D010InMsg`) is responsible for invoking the actual service component. The SC-level operations (CRUD on database tables) are executed within `callEKK1091D010SC`, not within this method.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JKKIntrInfoChgCfmCC.callEKK1091D010SC` | `callEKK1091D010SC(param, handle, workMap, inMap, updInfo)` → `mappingEKK1091D010InMsg(template, inMap, workMap, updInfo)` | `fillCAANMSGNullMapping [-]`, `getOpeDateTimeStamp [R]`, `makePrgThik [-]`, `makePrgThik2 [-]`, `getContents [R]` |

**Caller context:** The `callEKK1091D010SC` method calls `mappingEKK1091D010InMsg` in two scenarios:
- When `isCallIntrView(inMap)` returns true (inter-agent view call), passing `UPD_INTR_CD` ("1") — the intermediary code update path.
- When `chgCouponInfo` logic executes (coupon code update), passing `UPD_COUPON_CD` ("2") — the coupon code registration path.

`callEKK1091D010SC` also calls other downstream service components (`EKK2891A010SC`, `EKK0311A010SC_upd`, `EKK0311C010SC`, `EKK0081A010SC`, `EKK1091C010SC`) after the mapping step.

## 6. Per-Branch Detail Blocks

**Block 1** — EXEC `(null)` (L1650)

> Initialize the template by filling all fields with null values using the null mapping helper. This ensures the CAANMsg template starts in a clean state before population.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `fillCAANMSGNullMapping(template, new EKK1091D010CBSMsg().getContents())` | Fill all template fields with null to initialize the message structure |

**Block 2** — EXEC `(null)` (L1653)

> Set the SIF (Service Interface) identifier into the template. This ID is used by the SIF framework to route and identify the request type.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.TEMPLATEID, EKK1091D010)` | Set SIF request ID. Value: `"EKK1091D010"` [-> EKK1091D010="EKK1091D010" (JKKIntrInfoChgCfmCC.java:116)] |

**Block 3** — EXEC `(null)` (L1656)

> Set the function code from incoming request data. This identifies what kind of operation is being requested (request parameters, etc.).

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.FUNC_CODE, (String) inMap.get("func_code"))` | Set function code from incoming request map — identifies the operation type (e.g., "request parameters") |

**Block 4** — EXEC `(null)` (L1659)

> Set the intermediary application detail number from the workspace map. This is the reference number obtained during the service contract agreement meeting for the intermediary.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.MSKM_DTL_NO, (String) workMap.get("hi_mskm_dtl_no"))` | Set intermediary application detail number — tracking reference from service contract agreement meeting |

**Block 5** — EXEC `(null)` (L1662)

> Set the service agreement number (intermediary's service contract number) from the incoming request map.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.SVC_KEI_NO, (String) inMap.get("hi_svc_kei_no"))` | Set intermediary service agreement number |

**Block 6** — EXEC `(null)` (L1665)

> Set the change division (type of change) from the incoming request map. This categorizes what type of change is being processed.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.IDO_DIV, (String) inMap.get("ido_div"))` | Set change division — the type of information change being processed |

**Block 7** — EXEC `(null)` (L1675)

> Set the change date/time stamp using the current operation timestamp. This records when the change was made. The v7.00.02 modification changed from using JFUBPCommon to JCCBPCommon for the timestamp source.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.IDO_DTM, JCCBPCommon.getOpeDateTimeStamp(null))` | Set change date/time — current operation timestamp |

**Block 8** — EXEC `(null)` (L1678)

> Set the progress status to 1002, which represents "Complete" status for the service contract.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.PRG_STAT, JKKSvcConst.PRG_STAT_1002)` | Set progress state. Value: `"1002"` (Complete) [-> JKKSvcConst.PRG_STAT_1002="1002" (JKKSvcConst.java:1147)] |

**Block 9** — IF `UPD_INTR_CD.equals(updInfo)` (L1682)

> Branch: Check if this is an inter-agent code update scenario. When `updInfo` equals `"1"`, compute the program special item (PRG_TKJK_1) and store it in both the template and the incoming map for later use.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `String intrCdMsg = makePrgThik(inMap, workMap)` | Compute the program special item text for inter-agent code update |
| 2 | SET | `template.set(EKK1091D010CBSMsg.PRG_TKJK_1, intrCdMsg)` | Set PRG_TKJK_1 — progress special item 1 with computed inter-agent code info |
| 3 | EXEC | `inMap.put("intr_cd_msg", intrCdMsg)` | Store the computed inter-agent code message in the incoming map for use by coupon code update processing |

**Block 10** — ELSE-IF `UPD_COUPON_CD.equals(updInfo)` (L1699)

> Branch: Check if this is a coupon code update scenario. When `updInfo` equals `"2"`, compute and set the program special item (PRG_TKJK_2) for coupon code information.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.PRG_TKJK_2, makePrgThik2(inMap, workMap))` | Set PRG_TKJK_2 — progress special item 2 with computed coupon code info |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `EKK1091D010` | Service Code | Inter-agent information change confirmation — a service component for processing changes to intermediary agent information in the service contract system |
| `UPD_INTR_CD` | Constant | Update type discriminator: `"1"` — inter-agent code update (medium: 紹介コード更新) |
| `UPD_COUPON_CD` | Constant | Update type discriminator: `"2"` — coupon code update (medium: クーポンコード更新) |
| `SIF` | Acronym | Service Interface — the Fujitsu Futurity framework for service component communication via CAANMsg templates |
| `CAANMsg` | Type | CAAN (Communication Agent Application Network) message — the message object used in the SIF framework for request/response payloads |
| `FUNC_CODE` | Field | Function code — identifies the type of request being made (e.g., "request parameters") |
| `MSKM_DTL_NO` | Field | Intermediary application detail number — the reference number for intermediary applications obtained from the service contract agreement meeting (紹介明細番号) |
| `SVC_KEI_NO` | Field | Service agreement number — the intermediary's service contract number (サービス契約番号) |
| `IDO_DIV` | Field | Change division — the category/type of information change being processed (異動区分) |
| `IDO_DTM` | Field | Change date/time stamp — the date and time when the change was recorded (異動年月日時分秒) |
| `PRG_STAT` | Field | Program progress status — current state of the processing workflow. `"1002"` indicates Complete (進捗状態) |
| `PRG_TKJK_1` | Field | Program special item 1 — used to store inter-agent code computation results for the intermediary code update scenario (進捗特記事項1) |
| `PRG_TKJK_2` | Field | Program special item 2 — used to store coupon code computation results for the coupon code update scenario (進捗特記事項2) |
| `inMap` | Field | Incoming request map — carries business values from the screen input layer into the service component layer |
| `workMap` | Field | Workspace map — temporary storage for data passed between processing steps within the same transaction |
| `updInfo` | Field | Update information — the update type flag that determines which processing branch to take |
| `hi_mskm_dtl_no` | Field | Intermediary application detail number key within workMap |
| `hi_svc_kei_no` | Field | Intermediary service agreement number key within inMap |
| `func_code` | Field | Function code key within inMap |
| `intr_cd_msg` | Field | Inter-agent code message key in inMap — stores the computed special item text for use by subsequent coupon code processing |
| `makePrgThik` | Method | Computes program special item text (PRG_TKJK_1) from inMap and workMap for inter-agent code update |
| `makePrgThik2` | Method | Computes program special item text (PRG_TKJK_2) from inMap and workMap for coupon code update |
| `fillCAANMSGNullMapping` | Method | Utility method that sets all fields in a CAANMsg template to null using a message schema definition |
| `getOpeDateTimeStamp` | Method | Utility method that retrieves the current operation date/time stamp |
| `JKKIntrInfoChgCfmCC` | Class | Inter-agent information change confirmation common component — handles business logic for intermediary agent information changes |
| `callEKK1091D010SC` | Method | Service component caller that invokes the EKK1091D010 SC with the mapped message template |
| `PRG_STAT_1002` | Constant | Progress status value `"1002"` meaning Complete (medium: 完了) |
