---
title: "Business Logic — JKKKyoseiDslRunMapperCC.mappingEKK2811C140InMsg()"
sourceFile: "source/koptBp/ejbModule/com/fujitsu/futurity/bp/custom/common/JKKKyoseiDslRunMapperCC.java"
sourceStart: 4124
sourceEnd: 4188
---

# Business Logic — JKKKyoseiDslRunMapperCC.mappingEKK2811C140InMsg() [65 LOC]

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

## 1. Role

### JKKKyoseiDslRunMapperCC.mappingEKK2811C140InMsg()

This method constructs the SIF (Service Integration Framework) input message for the EKK2811C140 service component, which handles **forced service contract termination** (強制解約) for device-option (機器オプション) subscriptions. It is a pure data-mapping method — it receives a pre-allocated `CAANMsg` template, fills it with all required business parameters, and returns it to the caller for submission to the downstream CBS.

The method follows a **routing/dispatch** pattern: it first initializes the message template by null-filling all fields via `fillCAANMSGNullMapping`, then retrieves previously computed results from `resultHash` (which contains outputs from earlier SC calls such as EKK2811A010 for service contract agreement consent and EKK2801A010 for consent agreement). Based on these retrieved values, it populates the template with service contract numbers, detail codes, dates, and termination-specific flags.

A key branch evaluates whether a contract formation penalty (違約金) has been incurred by checking the result from the non-chargeable determination process (KKK kop Hi Chrg Jdg). If a penalty exists (`PNLTY_HASSEI_UM == "1"`), the template is marked with a penalty occurrence code of "1"; otherwise it is marked as "0". This ensures the downstream CBS accurately reflects whether the customer owes a cancellation penalty.

The method's role in the larger system is that of a **message assembler** in the DSL run pipeline — it is called by `JKKKyoseiDslRunCC.callEKK2811C140SC()` after prior SC steps have completed, and its output is the fully-formed SIF request message ready for execution. It operates as a shared mapper called by multiple service flows that involve forced termination.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["mappingEKK2811C140InMsg"])

    START --> STEP1["Fill Null Mapping"]
    STEP1 --> STEP2["Set TEMPLATEID"]
    STEP2 --> STEP3["Set FUNC_CODE"]
    STEP3 --> STEP4["Retrieve eKK2811A010Hash"]
    STEP4 --> STEP5["Retrieve eKK2801A010Hash"]
    STEP5 --> STEP6["Retrieve kkopHiChrgJdgHash"]
    STEP6 --> STEP7["Set KKOP_SVC_KEI_NO"]
    STEP7 --> STEP8["Set MSKM_DTL_NO"]
    STEP8 --> STEP9["Set RSV_TSTA_KIBO_YMD"]
    STEP9 --> STEP10["Set SVC_ENDYMD"]
    STEP10 --> STEP11["Set SVC_CHRG_ENDYMD"]
    STEP11 --> STEP12["Set SVC_DLRE_CD"]
    STEP12 --> STEP13["Set IDO_DIV"]
    STEP13 --> STEP14["Set UPD_DTM_BF"]
    STEP14 --> INIT_PNLTY["pnltyHasseiUm = 0"]
    INIT_PNLTY --> CHECK_HASH{eKK2801A010Hash null?}
    CHECK_HASH -->|Yes| GET_PNLTY["Get PNLTY_HASSEI_UM"]
    CHECK_HASH -->|No| SET_VAL["pnltyHasseiUm stays 0"]
    GET_PNLTY --> CHECK_CD{pnltyHasseiUm == 1?}
    SET_VAL --> CHECK_CD
    CHECK_CD -->|Yes| SET_YES["Set PNLTY_HASSEI_CD = 1"]
    CHECK_CD -->|No| SET_NO["Set PNLTY_HASSEI_CD = 0"]
    SET_YES --> END_NODE(["Return"])
    SET_NO --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `template` | `CAANMsg` | The SIF message template to populate — represents the outbound service request message for the EKK2811C140 forced termination CBS. Its fields are set in-place and the filled template is submitted to the CBS in the caller. |
| 2 | `inHash` | `HashMap<String, Object>` | Input parameters carried from the screen or workflow — contains request-level data such as the application detail number (`MSKM_DTL_NO`) and requested year/month/day (`REQYMD`). These values determine the timing and identification of the service termination request. |
| 3 | `resultHash` | `HashMap<String, Object>` | Aggregated results from prior SC calls in the DSL pipeline — keyed by template IDs. Contains the service contract agreement consent result (`EKK2811A010`), the consent agreement result (`EKK2801A010`), and the non-chargeable determination result (`JKKKkopHiChrgJdg`). These drive the field population. |
| 4 | `svcKeiUpdDtm` | `String` | The service line update datetime prior to the current update (更新年月日時秒(更新前)) — captures the timestamp of the last modification to the service contract line, used for audit/tracking purposes during forced termination. |

**Constants used (resolved from constant files):**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `JKKKyoseiDslRunCC.TEMPLATE_ID_EKK2811C140` | `"EKK2811C140"` | SIF template identifier for forced termination service |
| `JKKKyoseiDslRunCC.TEMPLATE_ID_EKK2811A010` | `"EKK2811A010"` | Template ID for device-option service contract agreement consent |
| `JKKKyoseiDslRunCC.TEMPLATE_ID_EKK2801A010` | `"EKK2801A010"` | Template ID for device-option service consent agreement |
| `JKKKyoseiDslRunCC.MAP_KEY_JKKKKOPHICHRGJDG` | `"JKKKkopHiChrgJdg"` | Key for non-chargeable determination result in resultHash |
| `JKKKyoseiDslRunCC.SVC_DLRE_CD_KYOSEI` | `"02"` | Forced termination reason code (強制解約) |
| `JKKKyoseiDslRunCC.IDO_DIV_KYOSEI` | `"00064"` | Movement division for forced termination |
| `JKPCModelConstant.FUNC_CD_1` | `"1"` | Function code for check & registration (チェック＆登録) |
| `JKKStrConst.CD_DIV_UM_ARI` | `"1"` | Penalty has occurred (違約金有) |
| `JKKStrConst.CD_DIV_UM_NASHI` | `"0"` | Penalty has not occurred (違約金無) |
| `JKKStrConst.CD01375_PNLTY_HASSEI` | `"1"` | Penalty occurrence flag — occurred |
| `JKKStrConst.CD01375_PNLTY_NASHI` | `"0"` | Penalty occurrence flag — not occurred |
| `JKKKKkopHiChrgJdgConstCC.KKOP_SVC_CHRG_ENDYMD` | `"kkop_svc_chrg_endymd"` | Field key for service charge end date in non-chargeable determination result |

**Instance fields / external state:** None — this method is stateless and reads all data from its parameters.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKKyoseiDslRunMapperCC.fillCAANMSGNullMapping` | JKKKyoseiDslRunMapperCC | - | Calls `fillCAANMSGNullMapping` in `JKKKyoseiDslRunMapperCC` to initialize all template fields with null values |
| R | `EKK2811C140CBSMsg.getContents` | EKK2811C140CBSMsg | - | Calls `getContents` in `EKK2811C140CBSMsg` to obtain the field list for null mapping |
| R | `KK2811A010CBSMsg1List.getContents` | KK2811A010CBSMsg1List | - | Calls `getContents` in `EKK2811A010CBSMsg1List` — used to retrieve the field name for `KKOP_SVC_KEI_NO` |
| R | `KK0771A010CBSMsg1List.getContents` | KK0771A010CBSMsg1List | - | Calls `getContents` in `EKK0771A010CBSMsg1List` — used to retrieve the field name for `PNLTY_HASSEI_UM` |
| R | `KK0381CBMMsg.getContents` | KK0381CBMMsg | - | (Not called in this method) |
| R | `KK0391CBMMsg.getContents` | KK0391CBMMsg | - | (Not called in this method) |
| R | `KK0401CBMMsg.getContents` | KK0401CBMMsg | - | (Not called in this method) |
| R | `KK0411CBMMsg.getContents` | KK0411CBMMsg | - | (Not called in this method) |

**Notes:**
- This method is a **pure mapper** — it does not perform any direct database CRUD operations. All data sources are in-memory `HashMap` objects populated by prior SC calls.
- The `fillCAANMSGNullMapping` call initializes the message template fields but does not query or write to the database.
- The actual CRUD operations for the forced termination process are performed by the downstream CBS (EKK2811C140SC) that receives the populated template from the caller.

## 5. Dependency Trace

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

Direct callers found: 1 method.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: JKKKyoseiDslRunCC | `JKKKyoseiDslRunCC.callEKK2811C140SC` -> `JKKKyoseiDslRunMapperCC.mappingEKK2811C140InMsg` | `fillCAANMSGNullMapping [-], getContents [R], getContents [R], getContents [R], getContents [R], getContents [R]` |

## 6. Per-Branch Detail Blocks

**Block 1** — EXEC (Null Mapping Initialization) (L4129)

> First step: null-map all fields of the template to ensure a clean message structure before population.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `fillCAANMSGNullMapping(template, new EKK2811C140CBSMsg().getContents())` // Initializes all template fields to null using the EKK2811C140 field definition |

**Block 2** — SET (Template ID) (L4132)

> Set the SIF template identifier on the message.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.TEMPLATEID, JKKKyoseiDslRunCC.TEMPLATE_ID_EKK2811C140)` [-> `TEMPLATE_ID_EKK2811C140` = "EKK2811C140"] // Template ID (SIF ID) |

**Block 3** — SET (Function Code) (L4135)

> Set the function code for check & registration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.FUNC_CODE, JPCModelConstant.FUNC_CD_1)` [-> `FUNC_CD_1` = "1"] // Function Code - Check & Registration (チェック＆登録) |

**Block 4** — SET (Retrieve Prior SC Results) (L4138–4146)

> Retrieve results from three prior SC calls stored in resultHash.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> eKK2811A010Hash = (HashMap<String, Object>)resultHash.get(JKKKyoseiDslRunCC.TEMPLATE_ID_EKK2811A010)` [-> `TEMPLATE_ID_EKK2811A010` = "EKK2811A010"] // Retrieve device-option service contract agreement consent result |
| 2 | SET | `HashMap<String, Object> eKK2801A010Hash = (HashMap<String, Object>)resultHash.get(JKKKyoseiDslRunCC.TEMPLATE_ID_EKK2801A010)` [-> `TEMPLATE_ID_EKK2801A010` = "EKK2801A010"] // Retrieve device-option service consent agreement result |
| 3 | SET | `HashMap<String, Object> kkopHiChrgJdgHash = (HashMap<String, Object>)resultHash.get(JKKKyoseiDslRunCC.MAP_KEY_JKKKKOPHICHRGJDG)` [-> `MAP_KEY_JKKKKOPHICHRGJDG` = "JKKKkopHiChrgJdg"] // Retrieve non-chargeable determination result |

**Block 5** — SET (Service Contract Number) (L4149)

> Set the service contract number from the EKK2811A010 result.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.KKOP_SVC_KEI_NO, eKK2811A010Hash.get(EKK2811A010CBSMsg1List.KKOP_SVC_KEI_NO))` // Device-option service contract number (機器オプションサービス契約番号) |

**Block 6** — SET (Application Detail Number) (L4152)

> Set the application detail number from input hash.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.MSKM_DTL_NO, inHash.get(JKKKyoseiDslRunCC.MSKM_DTL_NO))` // Application detail number (申込明细番号) |

**Block 7** — SET (Reservation Effective Start Date) (L4155)

> Set the desired contract effective start date from input hash.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.RSV_TSTA_KIBO_YMD, inHash.get(JKKKyoseiDslRunCC.REQYMD))` [-> `REQYMD` = "REQYMD"] // Reservation effective start desired year/month/day (予約適用開始希望年月日) |

**Block 8** — SET (Service End Date) (L4158)

> Set the service end date — reuses the same requested date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.SVC_ENDYMD, inHash.get(JKKKyoseiDslRunCC.REQYMD))` // Service end date (サービス終了年月日) |

**Block 9** — SET (Service Charge End Date) (L4161)

> Set the service charge end date from the non-chargeable determination result.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.SVC_CHRG_ENDYMD, (String)kkopHiChrgJdgHash.get(JKKKkopHiChrgJdgConstCC.KKOP_SVC_CHRG_ENDYMD))` [-> `KKOP_SVC_CHRG_ENDYMD` = "kkop_svc_chrg_endymd"] // Service charge end date (サービス課金終了年月日) |

**Block 10** — SET (Service Discontinuation Reason Code) (L4164)

> Hard-code the forced termination reason code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.SVC_DLRE_CD, JKKKyoseiDslRunCC.SVC_DLRE_CD_KYOSEI)` [-> `SVC_DLRE_CD_KYOSEI` = "02"] // Service discontinuation reason code (forced termination) fixed (サービス解約理由コード(強制解約)固定) |

**Block 11** — SET (Movement Division) (L4167)

> Hard-code the movement division for forced termination.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.IDO_DIV, JKKKyoseiDslRunCC.IDO_DIV_KYOSEI)` [-> `IDO_DIV_KYOSEI` = "00064"] // Movement division (forced termination) fixed (異動区分(強制解約)固定) |

**Block 12** — SET (Update Timestamp Before) (L4170)

> Set the pre-update timestamp from the parameter.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.UPD_DTM_BF, svcKeiUpdDtm)` // Update year/month/day/hour/minute/second (before update) (更新年月日時秒(更新前)) |

**Block 13** — SET (Initialize Penalty Flag) (L4173)

> Initialize the contract formation penalty flag to default "no penalty" (違約金無).

| # | Type | Code |
|---|------|------|
| 1 | SET | `String pnltyHasseiUm = JKKStrConst.CD_DIV_UM_NASHI` [-> `CD_DIV_UM_NASHI` = "0"] // Contract formation penalty occurrence code (違約金発生コード) |

**Block 14** — IF (Check EKK2801A010 Hash) (L4174–4176)

> If the consent agreement result hash is available, retrieve the actual penalty status from it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `pnltyHasseiUm = (String)eKK2801A010Hash.get(EKK0771A010CBSMsg1List.PNLTY_HASSEI_UM)` // Get penalty occurrence status (違約金発生有無) from consent agreement result |

**Block 14.1** — IF (Penalty Has Occurred? — ARI / 有) (L4177–4179) `[CD_DIV_UM_ARI = "1"]`

> If the consent agreement indicates a penalty was incurred, set the penalty occurrence flag to "1".

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.PNLTY_HASSEI_CD, JKKStrConst.CD01375_PNLTY_HASSEI)` [-> `CD01375_PNLTY_HASSEI` = "1"] // Penalty occurrence flag set to "1" (違約金発生 = "1") |

**Block 14.2** — ELSE (Penalty Not Occurred — NASHI / 無) (L4180–4182) `[CD_DIV_UM_NASHI = "0"]`

> If no penalty was incurred (or the hash was null), set the penalty occurrence flag to "0".

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK2811C140CBSMsg.PNLTY_HASSEI_CD, JKKStrConst.CD01375_PNLTY_NASHI)` [-> `CD01375_PNLTY_NASHI` = "0"] // Penalty occurrence flag set to "0" (違約金無 = "0") |

**Block 15** — RETURN (L4185)

> The method completes. The caller (JKKKyoseiDslRunCC.callEKK2811C140SC()) receives the populated template and executes the EKK2811C140SC service component.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KKOP_SVC_KEI_NO` | Field | Device-option service contract number — identifies the specific service contract line item for device-option services |
| `MSKM_DTL_NO` | Field | Application detail number — the internal sequence number identifying the specific application/detail within a request batch |
| `RSV_TSTA_KIBO_YMD` | Field | Reservation effective start desired year/month/day — the customer's requested start date for the service |
| `SVC_ENDYMD` | Field | Service end date — the date when the service contract terminates |
| `SVC_CHRG_ENDYMD` | Field | Service charge end date — the last date the customer is billed for the service |
| `SVC_DLRE_CD` | Field | Service discontinuation reason code — the code identifying why the service ended (here, "02" = forced termination) |
| `IDO_DIV` | Field | Movement division — the type of service change operation (here, "00064" = forced termination) |
| `UPD_DTM_BF` | Field | Update timestamp before — the datetime of the last update to the service line prior to the current operation |
| `PNLTY_HASSEI_UM` | Field | Penalty occurrence status — indicates whether a contract formation penalty is due ("1" = yes, "0" = no) |
| `PNLTY_HASSEI_CD` | Field | Penalty occurrence code — the flag written to the message indicating penalty status to the downstream CBS |
| `svcKeiUpdDtm` | Parameter | Service line update datetime — the current timestamp passed in as the pre-update value for the service contract line |
| SIF | Acronym | Service Integration Framework — the messaging framework used to communicate between CBS service components |
| CBS | Acronym | Central Business System — the core business service component architecture |
| SC Code | Acronym | Service Component code (e.g., EKK2811C140SC) — identifies specific business service components |
| EKK2811C140 | CBS | Forced termination CBS — handles forced service contract termination for device-option subscriptions |
| EKK2811A010 | SC | Device-option service contract agreement consent SC — retrieves consent for device-option service contracts |
| EKK2801A010 | SC | Device-option service consent agreement SC — retrieves the consent agreement result including penalty status |
| KKK kop Hi Chrg Jdg | CBS | Non-chargeable determination — determines whether charges are applicable for a service line |
| KYOSEI | Japanese term | 強制 — forced; refers to forced termination initiated by the carrier, not the customer |
| UI (違約金) | Japanese term | Contract formation penalty / early termination fee — a fee charged when a customer terminates a contract before its natural expiration |
| ARI (有) | Japanese term | Present / exists — indicates a value is set (e.g., 違約金有 = penalty exists) |
| NASHI (無) | Japanese term | Absent / none — indicates a value is not set (e.g., 違約金無 = no penalty) |
| FUNC_CD_1 | Constant | Function code "1" — represents check & registration mode (チェック＆登録) |
| TEMPLATE_ID | Constant | Template identifier key used in resultHash to store and retrieve SC call results by service code |
| CAANMsg | Type | Service message object — the standard message wrapper used to carry structured data between CBS components |
