# Business Logic — JKKOpsvkeiTelIktAddCC.mappingEKK1091D010InMsg() [94 LOC]

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

## 1. Role

### JKKOpsvkeiTelIktAddCC.mappingEKK1091D010InMsg()

This method maps input data into a SIF (Service Integration Framework) message template for the **EKK1091D010** (Progress Registration) service component, preparing the request payload for recording service contract progress updates in the **Operation Service Contract <Telephone> Bulk Registration** module. It acts as a **data transformer / message builder** that extracts business-relevant fields from the incoming `inHash` parameter, populates a `CAANMsg` template with those values, and then writes the completed template back for downstream processing by the EKK1091D010 service component. The method handles three distinct service contract origins for the optional "Operation Supplementary Service Contract Number" — the primary contract (`EKK0371D010`), the information change contract (`EKK0371C050`), or the sub-operation supplementary contract (`EKK0431D010`) — extracting the relevant contract number depending on which is available. It also builds a nested list of error reasons (`IDO_RSN_CD_LIST`) from the input and manages the transfer timestamp (`IDO_DTM`) with a system-default fallback. The Javadoc states: "Set conditions related to EKK1091D010 for the template" (templateに対してEKK1091D010の条件に関する部分を設定する).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["mappingEKK1091D010InMsg(params)"])
    STEP1["Fill template with null mapping"]
    STEP2["Set TEMPLATE_ID to EKK1091D010"]
    STEP3["Set FUNC_CODE from inHash"]
    STEP4["Set SVC_KEI_NO from inHash"]
    STEP5["Set IDO_DIV from inHash"]
    STEP6["Set PRG_STAT from prgStat param"]
    STEP7["Set PRG_TKJK_1 from prgTkjk1 param"]
    STEP8["Set SEIKY_KEI_NO from inHash"]
    STEP9["Set MSKM_DTL_NO from inHash"]
    STEP10["Get IDO_RSN_CD_LIST from inHash"]
    STEP11["Create CAANMsg array for error reasons"]
    STEP12["Iterate IDO_RSN_CD_LIST elements"]
    STEP13["Get element at index i"]
    STEP14["Create new EKK1091D010CBSMsg1List message"]
    STEP15["Null-mapping for this element"]
    STEP16["Set IDO_RSN_CD from element"]
    STEP17["Set IDO_RSN_MEMO from element"]
    STEP18["Store in array"]
    STEP19["Set EKK1091D010CBSMSG1LIST on template"]
    STEP20["Get IDO_DTM from inHash"]
    STEP21{"IDO_DTM not null and length > 0?"}
    STEP22["Set IDO_DTM from inHash"]
    STEP23["Set IDO_DTM to system datetime"]
    STEP24["Get EKK0371D010 from resultHash"]
    STEP25{"EKK0371D010 exists?"}
    STEP26["Set OP_SVC_KEI_NO from EKK0371D010"]
    STEP27["Get EKK0371C050 from resultHash"]
    STEP28{"EKK0371C050 exists?"}
    STEP29["Set OP_SVC_KEI_NO from EKK0371C050"]
    STEP30["Get EKK0431D010 from resultHash"]
    STEP31{"EKK0431D010 exists?"}
    STEP32["Set OP_SVC_KEI_NO from EKK0431D010"]
    STEP33["Set SBOP_SVC_KEI_NO from EKK0431D010"]
    END(["Return void"])

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> STEP6 --> STEP7 --> STEP8 --> STEP9 --> STEP10 --> STEP11 --> STEP12 --> STEP13 --> STEP14 --> STEP15 --> STEP16 --> STEP17 --> STEP18 --> STEP19 --> STEP20 --> STEP21
    STEP21 -->|true| STEP22
    STEP21 -->|false| STEP23
    STEP22 --> END
    STEP23 --> STEP24 --> STEP25
    STEP25 -->|true| STEP26 --> END
    STEP25 -->|false| STEP27 --> STEP28
    STEP28 -->|true| STEP29 --> END
    STEP28 -->|false| STEP30 --> STEP31
    STEP31 -->|true| STEP32 --> STEP33 --> END
    STEP31 -->|false| END
```

**Processing description:**

1. **Null-mapping initialization** — The template is first filled with null defaults from the `EKK1091D010CBSMsg` contents definition, ensuring every field in the SIF message structure has a placeholder value.

2. **Template header setup** — The template ID is set to `"EKK1091D010"`, identifying this as a Progress Registration message.

3. **Primary field population** — The function code (`"func_code"`), service contract number, transfer division (`"ido_div"`), progress status (`prgStat`), progress special item 1 (`prgTkjk1`), request contract number, and application detail number are all mapped from `inHash` or method parameters.

4. **Error reason list processing** — For each element in the `ido_rsn_cdList` array list (a list of transfer/reason code entries), a new `EKK1091D010CBSMsg1List` message is created, null-mapped, and populated with the reason code and memo. All elements are collected into a `CAANMsg[]` array and set on the template as `EKK1091D010CBSMSG1LIST`.

5. **Transfer timestamp** — If `ido_dtm` is provided in `inHash` and is non-empty, it is used directly. Otherwise, the system datetime stamp is obtained from `JCCModelCommon.getSysDateTimeStamp()` as a fallback.

6. **Optional supplementary service contract number** — The method checks `resultHash` in priority order: first `EKK0371D010` (primary Operation Service Contract <Telephone> Registration), then `EKK0371C050` (Operation Service Contract <Telephone> Information Change). If neither exists, it checks `EKK0431D010` (Sub-Operation Supplementary Service Contract <Telephone> Registration). For the sub-operation case, both the primary operation supplementary service contract number and the sub-operation supplementary service contract number are set.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `template` | `CAANMsg` | The SIF message template being built. Acts as the output container that receives all mapped fields for the EKK1091D010 Progress Registration request. |
| 2 | `inHash` | `HashMap<String, Object>` | Input hash carrying the business condition data extracted from the screen or upstream processing. Contains fields like function code, service contract number, transfer division, progress status, request contract number, detail number, error reason list, and optional transfer datetime. |
| 3 | `resultHash` | `HashMap<String, Object>` | Result hash from prior processing steps. Contains previously resolved contract information keyed by template ID (`EKK0371D010`, `EKK0371C050`, `EKK0431D010`), from which the optional supplementary service contract number is extracted. |
| 4 | `prgStat` | `String` | Progress status — the current processing status code for the service contract (e.g., registration in progress, completed, error). Passed directly from the caller (`callEKK1091D010SC`). |
| 5 | `prgTkjk1` | `String` | Progress special item 1 — additional contextual information about the current progress stage. The exact meaning depends on the calling context; used for supplementary progress tracking. |

**Instance fields / external state read:**
- `TEMPLATE_ID_EKK1091D010` (`"EKK1091D010"`) — Template ID constant used to identify the SIF message type.
- `FUNC_CODE` (`"func_code"`) — Key constant for the function code field in `inHash`.
- `SVC_KEI_NO`, `IDO_DIV`, `SEIKY_KEI_NO`, `IDO_RSN_CD_LIST`, `IDO_DTM`, `EX_MSKM_DTL_NO` — Field key constants for mapping from `inHash`.
- `OP_SVC_KEI_NO`, `SBOP_SVC_KEI_NO` — Field key constants for setting supplementary contract numbers.
- `JCCModelCommon.getSysDateTimeStamp()` — Static utility method used as a system timestamp fallback.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKOpsvkeiTelIktAddCC.fillCAANMSGNullMapping` | EKK1091D010 | - | Calls `fillCAANMSGNullMapping` to initialize the template with null-default values from the CBS message definition |
| R | `JCCModelCommon.getSysDateTimeStamp` | JCCModelCommon | - | Gets the current system date and time as a formatted string for the transfer datetime |
| - | `JKKOpsvkeiTelIktAddCC.getContents` | JKKOpsvkeiTelIktAddCC | - | Invoked via `new EKK1091D010CBSMsg().getContents()` to retrieve the null-mapping field definitions |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.
Terminal operations from this method: `fillCAANMSGNullMapping` [-], `getSysDateTimeStamp` [R], `getContents` [-], `fillCAANMSGNullMapping` [-], `getContents` [-].

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC: `JKKOpsvkeiTelIktAddCC.callEKK1091D010SC` | `callEKK1091D010SC` -> `mappingEKK1091D010InMsg(template, inHash, resultHash, prgStat, prgTkjk1)` | `fillCAANMSGNullMapping [-]`, `getSysDateTimeStamp [R]`, `getContents [-]` |

**Caller details:**

`callEKK1091D010SC()` (same class `JKKOpsvkeiTelIktAddCC`) — This is the service component invocation method that orchestrates the EKK1091D010 Progress Registration flow. It constructs the input hash (`inHash`), populates it with business parameters, invokes this method to map data into the SIF template, and then calls the SC to process the request.

## 6. Per-Branch Detail Blocks

**Block 1** — SET (null-mapping initialization) (L3121)

> Initialize the template with null-default values from the EKK1091D010CBSMsg contents definition.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `fillCAANMSGNullMapping(template, new EKK1091D010CBSMsg().getContents())` // Initialize template with null defaults // -> TEMPLATE_ID_EKK1091D010="EKK1091D010" |

**Block 2** — SET (template ID) (L3124)

> Set the SIF template identifier to "EKK1091D010".

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK1091D010)` // [-> "EKK1091D010"] // テンプレートID(SIFのID) — Template ID (SIF ID) |

**Block 3** — SET (primary field mapping) (L3127–L3135)

> Map core business fields from `inHash` and parameters into the template.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.FUNC_CODE, inHash.get(FUNC_CODE))` // [-> "func_code"] // 機能コード — Function Code |
| 2 | SET | `template.set(EKK1091D010CBSMsg.SVC_KEI_NO, inHash.get(SVC_KEI_NO))` // [-> "svc_kei_no"] // サービス契約番号 — Service Contract Number |
| 3 | SET | `template.set(EKK1091D010CBSMsg.IDO_DIV, inHash.get(IDO_DIV))` // [-> "ido_div"] // 異動区分 — Transfer Division |
| 4 | SET | `template.set(EKK1091D010CBSMsg.PRG_STAT, prgStat)` // 進捗ステータス — Progress Status |
| 5 | SET | `template.set(EKK1091D010CBSMsg.PRG_TKJK_1, prgTkjk1)` // 進捗特事項1 — Progress Special Item 1 |
| 6 | SET | `template.set(EKK1091D010CBSMsg.SEIKY_KEI_NO, inHash.get(SEIKY_KEI_NO))` // [-> "seiky_kei_no"] // 請求契約番号 — Request Contract Number |
| 7 | SET | `template.set(EKK1091D010CBSMsg.MSKM_DTL_NO, inHash.get(EX_MSKM_DTL_NO))` // [-> "mksm_dtl_noNOW"] // 申請明細番号 — Application Detail Number |

**Block 4** — FOR LOOP (error reason list processing) (L3138–L3157)

> Build a list of error/reason entries from the `ido_rsn_cdList` in the input hash. Each entry contains a reason code and a memo.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ido_rsn_cd_list = (ArrayList<HashMap<String, Object>>)inHash.get(IDO_RSN_CD_LIST)` // [-> "ido_rsn_cdList"] // 異動理由コードリスト — Error Reason Code List |
| 2 | SET | `ekk1091D010CBSMsg1List = new CAANMsg[ido_rsn_cd_list.size()]` // Create array matching list size |
| 3 | FOR | `for(int i = 0 ; i < ido_rsn_cd_list.size() ; i++)` // Iterate over error reason list |
| 3.1 | SET | `ido_rsn_cd_element = ido_rsn_cd_list.get(i)` // [-> "1要素取得" — Get element at index i] |
| 3.2 | SET | `ekk1091D010CBSMsg1 = new CAANMsg(EKK1091D010CBSMsg1List.class.getName())` // Create new nested message |
| 3.3 | CALL | `fillCAANMSGNullMapping(ekk1091D010CBSMsg1, new EKK1091D010CBSMsg1List().getContents())` // Null-map nested message |
| 3.4 | SET | `ekk1091D010CBSMsg1.set(EKK1091D010CBSMsg1List.IDO_RSN_CD, ido_rsn_cd_element.get(IDO_RSN_CD))` // [-> "ido_rsn_cd"] // 異動理由コード — Error Reason Code |
| 3.5 | SET | `ekk1091D010CBSMsg1.set(EKK1091D010CBSMsg1List.IDO_RSN_MEMO, ido_rsn_cd_element.get(IDO_RSN_MEMO))` // [-> "ido_rsn_memo"] // 異動理由メモ — Error Reason Memo |
| 3.6 | SET | `ekk1091D010CBSMsg1List[i] = ekk1091D010CBSMsg1` // Store in array |
| 4 | SET | `template.set(EKK1091D010CBSMsg.EKK1091D010CBSMSG1LIST, ekk1091D010CBSMsg1List)` // Set list on template |

**Block 5** — IF/ELSE (transfer datetime) (L3159–L3168)

> Set the transfer datetime (`IDO_DTM`). Use the value from `inHash` if provided and non-empty; otherwise use the system timestamp.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ido_dtm = (String) inHash.get(IDO_DTM)` // [-> "ido_dtm"] // 異動年月日時秒 — Transfer Year-Month-Day Time-Second |
| 2 | IF | `null != ido_dtm && 0 < ido_dtm.length()` // Is transfer datetime provided and non-empty? |

**Block 5.1** — IF branch (L3161–L3163)

> Use the explicitly provided transfer datetime.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.IDO_DTM, ido_dtm)` // 指定異動の異動日時 — Explicit transfer datetime |

**Block 5.2** — ELSE branch (L3165–L3167)

> Use the system timestamp as default.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK1091D010CBSMsg.IDO_DTM, JCCModelCommon.getSysDateTimeStamp())` // システム日時 — System datetime |

**Block 6** — IF/ELSE-IF/ELSE (optional supplementary service contract number) (L3171–L3188)

> Extract the operation supplementary service contract number from prior results. Check in priority order: primary registration contract, then information change contract, then sub-operation supplementary contract. The sub-operation contract case additionally sets the sub-operation supplementary service contract number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0371d010Msg = (HashMap<?, ?>)resultHash.get(TEMPLATE_ID_EKK0371D010)` // [-> "EKK0371D010"] // オプショナルサービス契約<電話>登録 — Operation Service Contract <Telephone> Registration |
| 2 | SET | `ekk0371c050Msg = (HashMap<?, ?>)resultHash.get(TEMPLATE_ID_EKK0371C050)` // [-> "EKK0371C050"] // オプショナルサービス契約<電話>情報変更 — Operation Service Contract <Telephone> Information Change |
| 3 | IF | `ekk0371d010Msg != null` // Primary registration contract available? |

**Block 6.1** — IF branch (L3173–L3175)

> Extract supplementary service contract number from the primary registration result.

| # | Type | Code |
|---|------|------|
| 1 | SET | `op_svc_kei_no = ekk0371d010Msg.get(EKK0371D010CBSMsg.OP_SVC_KEI_NO)` // [-> "op_svc_kei_no"] |
| 2 | SET | `template.set(EKK1091D010CBSMsg.OP_SVC_KEI_NO, op_svc_kei_no)` // オプショナルサービス契約番号 — Operation Supplementary Service Contract Number |

**Block 6.2** — ELSE-IF (L3176–L3180)

> Extract from the information change result (used when the contract was registered via the information change flow — オプショナルサービス契約登録の場合).

| # | Type | Code |
|---|------|------|
| 1 | SET | `op_svc_kei_no = ekk0371c050Msg.get(EKK0371C050CBSMsg.OP_SVC_KEI_NO)` // [-> "op_svc_kei_no"] |
| 2 | SET | `template.set(EKK1091D010CBSMsg.OP_SVC_KEI_NO, op_svc_kei_no)` // オプショナルサービス契約登録の場合 — When registering operation supplementary service contract |

**Block 6.3** — ELSE (L3181–L3188)

> Extract from the sub-operation supplementary contract result. Also sets the sub-operation supplementary service contract number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0431d010Msg = (HashMap<?, ?>)resultHash.get(TEMPLATE_ID_EKK0431D010)` // [-> "EKK0431D010"] // サブオプショナルサービス契約<電話>登録 — Sub-Operation Supplementary Service Contract <Telephone> Registration |
| 2 | IF | `ekk0431d010Msg != null` // Sub-operation contract available? |

**Block 6.3.1** — IF branch (sub-operation) (L3183–L3187)

> Set both primary and sub-operation supplementary service contract numbers.

| # | Type | Code |
|---|------|------|
| 1 | SET | `op_svc_kei_no = ekk0431d010Msg.get(EKK0431D010CBSMsg.OP_SVC_KEI_NO)` // [-> "op_svc_kei_no"] |
| 2 | SET | `template.set(EKK1091D010CBSMsg.OP_SVC_KEI_NO, op_svc_kei_no)` // オプショナルサービス契約番号 — Operation Supplementary Service Contract Number |
| 3 | SET | `sbop_svc_kei_no = ekk0431d010Msg.get(EKK0431D010CBSMsg.SBOP_SVC_KEI_NO)` // [-> "sbop_svc_kei_no"] |
| 4 | SET | `template.set(EKK1091D010CBSMsg.SBOP_SVC_KEI_NO, sbop_svc_kei_no)` // サブオプショナルサービス契約番号 — Sub-Operation Supplementary Service Contract Number |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service Contract Number — unique identifier for a service contract line item |
| `svc_kei_ucwk_no` | Field | Service Detail Work Number — internal tracking ID for service contract sub-items |
| `ido_div` | Field | Transfer Division — classifies the type of transfer/change being performed (e.g., new, modify, cancel) |
| `ido_rsn_cd` | Field | Error Reason Code — code identifying why a transfer was rejected or suspended |
| `ido_rsn_memo` | Field | Error Reason Memo — free-text description of the error/reason |
| `ido_dtm` | Field | Transfer Year-Month-Day Time-Second — timestamp of when the transfer was executed |
| `prg_stat` | Field | Progress Status — current status of the service contract processing |
| `prg_tkjk_1` | Field | Progress Special Item 1 — supplementary progress tracking information |
| `seiky_kei_no` | Field | Request Contract Number — billing request contract identifier |
| `mksm_dtl_no` | Field | Application Detail Number — specific application line item identifier |
| `func_code` | Field | Function Code — identifies the calling function/module for audit routing |
| `op_svc_kei_no` | Field | Operation Supplementary Service Contract Number — contract number for supplementary service add-ons |
| `sbop_svc_kei_no` | Field | Sub-Operation Supplementary Service Contract Number — contract number for sub-level supplementary service add-ons |
| `ido_rsn_cdList` | Field | Error Reason Code List — ordered list of transfer reason entries, each with a code and memo |
| EKK1091D010 | SC Code | Progress Registration — service component for registering service contract progress updates |
| EKK0371D010 | SC Code | Operation Service Contract <Telephone> Registration — service component for registering telephone operation service contracts |
| EKK0371C050 | SC Code | Operation Service Contract <Telephone> Information Change — service component for updating telephone operation service contract information |
| EKK0431D010 | SC Code | Sub-Operation Supplementary Service Contract <Telephone> Registration — service component for registering sub-operation supplementary telephone service contracts |
| CAANMsg | Type | SIF (Service Integration Framework) message wrapper — standard messaging container used across the Fujitsu BPM framework |
| SIF | Acronym | Service Integration Framework — middleware framework for service-to-service message exchange |
| CBS | Acronym | Component-Based Service — service component in the architecture (Contract, Business Service) |
| CC | Acronym | Common Component — shared business logic component (Controller Layer) |
| SC | Acronym | Service Component — layer that encapsulates business service logic and interacts with DAO/DB |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| ISP | Acronym | Internet Service Provider — internet connectivity service offering |
| JCCModelCommon | Class | Common model utility class providing system-level helpers such as system datetime retrieval |
| fillCAANMSGNullMapping | Method | Utility method that populates a CAANMsg template with null values based on a CBS message definition's contents |
| オプショナルサービス契約 | Business term | Operation Supplementary Service Contract — supplementary service contract add-on for telephone services |
| サブオプショナルサービス契約 | Business term | Sub-Operation Supplementary Service Contract — nested supplementary service contract under an operation supplementary contract |
| 異動 | Business term | Transfer — a change operation applied to a service contract (addition, modification, cancellation) |
| 進捗 | Business term | Progress — the current state or advancement stage of a business process |
| 請求契約 | Business term | Request Contract — the billing/accounting-side contract number used for invoicing |
| 申請明細 | Business term | Application Detail — the specific line item within a service application |
