---

# Business Logic — JKKBumpMdsCC.callEKK0161B004SC() [54 LOC]

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

## 1. Role

### JKKBumpMdsCC.callEKK0161B004SC()

This method is a service interface (SIF) invocation wrapper that queries the **Address Change in Progress Address Change Detail List Inquiry 2 (EKK2101B501)** service. It is a shared common component method within the "number portability return" (number porting back) business flow of the K-Opticom eo customer core system. The method handles the full SIF lifecycle: it builds the request message template, maps inbound parameters into the SC (Service Component) message format, invokes the service through a `ServiceComponentRequestInvoker`, deserializes the response, performs error checking, and maps the returned message data back into the result hash for consumption by the calling screen.

The method implements the **delegation and facade pattern** — it encapsulates the boilerplate SIF invocation logic (message construction, request setup, result parsing) behind a single method call, so calling screens do not need to repeat this pattern. When invoked, it returns an integer status code: 0 indicates success, and any non-zero value indicates an error. Upon success, the result hash is populated with the `EKK0161B004` key containing a `CAANMsg[]` array of service contract line item records, which the caller (typically a screen CBS like KKSV0200) then iterates to validate portability eligibility.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["callEKK0161B004SC(params)"])
    SIF1["editInMsgCmn(param)"]
    TMPL["template = new CAANMsg(EKK0161B004CBSMsg)"]
    MAP1["mappingEKK0161B004InMsg(template, inHash, svcKeiUcwkNo, svckeino)"]
    BASIC["editBasicCmn(param, template)"]
    PUT["sIFRequest.put(TEMPLATE_LIST_KEY, new CAANMsg[]{template})"]
    INV["scCall = new ServiceComponentRequestInvoker()"]
    EXEC["sIFResult = scCall.run(sIFRequest, handle)"]
    EDITRP["editResultRP(sIFResult, param)"]
    CHK["errChk(sIFResult)"]
    GET["resultMsgs = (CAANMsg[])sIFResult.get(TEMPLATE_LIST_KEY)"]
    STS["status = template.getInt(STATUS_INT_KEY)"]
    COND{status == 0}
    OUT["resultHash.put(TEMPLATE_ID_EKK0161B004, mappingEKK0161B004SCOutMsg(resultMsgs))"]
    RET(["return status"])

    START --> SIF1 --> TMPL --> MAP1 --> BASIC --> PUT --> INV --> EXEC --> EDITRP --> CHK --> GET --> STS --> COND
    COND -->|true| OUT
    COND -->|false| RET
    OUT --> RET
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying I/O data for the current service transaction. Used to build SIF request metadata via `editInMsgCmn`. |
| 2 | `handle` | `SessionHandle` | Database session handle providing transaction context and DB connection for the service component invocation. |
| 3 | `inHash` | `HashMap<String, Object>` | Input parameter hash containing search conditions for the address change detail inquiry, such as service contract number and address change identifiers. |
| 4 | `resultHash` | `HashMap<String, Object>` | Output result hash where the mapped response data (`EKK0161B004` key → `CAANMsg[]`) is stored for the caller to consume. |
| 5 | `svcKeiUcwkNo` | `String` | Service detail work number — internal tracking ID for a service contract line item. Used to identify which specific service contract line's address change details to query. |
| 6 | `svckeino` | `String` | Service contract number — the top-level service contract identifier. Passed into the SC message as a search condition parameter. |

**External/Instance fields read:** None directly in this method.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `scCall.run(sIFRequest, handle)` | EKK2101B501 | Address Change Detail Inquiry tables | Calls the Address Change in Progress Address Change Detail List Inquiry 2 SIF via the SC runtime framework |

**Helper method calls (non-CRUD internal):**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `editInMsgCmn(param)` | — | — | Sets up common SIF request metadata (internal helper) |
| - | `mappingEKK0161B004InMsg(template, inHash, svcKeiUcwkNo, svckeino)` | — | — | Maps inbound parameters into the EKK0161B004CBSMsg template fields |
| - | `editBasicCmn(param, template)` | — | — | Sets basic template fields (template ID, etc.) |
| - | `editResultRP(sIFResult, param)` | — | — | Deserializes and extracts response data from the SIF result back into the parameter object |
| - | `errChk(sIFResult)` | — | — | Checks for system/SC-level errors in the SIF result; throws on error |
| - | `mappingEKK0161B004SCOutMsg(resultMsgs)` | — | — | Maps `CAANMsg[]` array output into `HashMap` format for the result hash |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | KKSV0200 (commented-out caller) | `KKSV0200OP.execute` → `JKKBumpMdsCC.callEKK0161B004SC` | `scCall.run [R] EKK2101B501 SIF (Address Change Detail Inquiry)` |

**Note:** The only documented caller is KKSV0200 (a screen CBS for address change operations), where the call has been commented out (lines 485–490). The method is currently unused in active code but remains as a shared utility for address change detail list inquiries via the EKK0161B004 SIF.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize local variables (L1345)

| # | Type | Code |
|---|------|------|
| 1 | SET | `sIFRequest = null` |
| 2 | SET | `resultMsgs = null` |
| 3 | SET | `template = null` |
| 4 | SET | `scCall = null` |
| 5 | SET | `sIFResult = null` |
| 6 | SET | `status = 0` |

**Block 2** — [EXEC] Set up common SIF request information (`// サービスIF共通の情報を設定`) (L1351)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `sIFRequest = editInMsgCmn(param)` |

**Block 3** — [SET] Set call parameters to EKK0161B004 (`// EKK0161B004への呼び出しパラメータ設定`) (L1354)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EKK0161B004CBSMsg.class.getName())` |
| 2 | CALL | `mappingEKK0161B004InMsg(template, inHash, svcKeiUcwkNo, svckeino)` |
| 3 | CALL | `editBasicCmn(param, template)` |

**Block 4** — [SET] Set up request-class information (`// リクエスト用のクラスの設定`) (L1359)

| # | Type | Code |
|---|------|------|
| 1 | SET | `sIFRequest.put(JCMConstants.TEMPLATE_LIST_KEY, new CAANMsg[]{template})` |

**Block 5** — [SET] Generate SC call invoker (`// SC呼び出しクラスの生成`) (L1362)

| # | Type | Code |
|---|------|------|
| 1 | SET | `scCall = new ServiceComponentRequestInvoker()` |

**Block 6** — [EXEC] Invoke SIF (`// SIFの呼び出し`) (L1365)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `sIFResult = scCall.run(sIFRequest, handle)` |

**Block 7** — [EXEC] Error mapping processing (`// エラーマッピング処理`) (L1368)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editResultRP(sIFResult, param)` |

**Block 8** — [EXEC] Error check (`// エラーチェック`) (L1371)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `errChk(sIFResult)` |

**Block 9** — [SET] Acquire results (`// 結果の取得`) (L1374)

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultMsgs = (CAANMsg[])sIFResult.get(JCMConstants.TEMPLATE_LIST_KEY)` |

**Block 10** — [SET] Acquire status code (`// ステータスコードの取得`) (L1377)

| # | Type | Code |
|---|------|------|
| 1 | SET | `status = template.getInt(JCMConstants.STATUS_INT_KEY)` |

**Block 11** — [IF] Status check: status == 0 (`// ステータスが0以外エラーとなっている`) (L1380)

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultHash.put(TEMPLATE_ID_EKK0161B004, mappingEKK0161B004SCOutMsg(resultMsgs))` `[-> TEMPLATE_ID_EKK0161B004 = "EKK0161B004"]` |

**Block 11.1** — [ELSE-IF] status != 0 (implicit path) (L1380)

> The else path (status != 0) simply skips the result population and proceeds directly to return. No explicit ELSE block exists in the code.

| # | Type | Code |
|---|------|------|
| 1 | (no-op) | Status is non-zero; skip result mapping |

**Block 12** — [RETURN] Return status code (L1388)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return status;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svcKeiUcwkNo` | Field | Service detail work number — internal tracking ID for a service contract line item, used to uniquely identify a line within a service contract |
| `svckeino` | Field | Service contract number — the top-level identifier for a customer's service contract |
| EKK0161B004 | SIF Code | Service Contract Line Item List Inquiry (by service contract number) — a query screen service that returns details of line items under a given service contract |
| EKK2101B501 | SIF Code | Address Change in Progress Address Change Detail List Inquiry 2 — a service interface for querying address change detail records when an address change is actively in progress |
| SIF | Acronym | Service Interface — the integration layer between screens/CBSes and backend Service Components (SCs) |
| SC | Acronym | Service Component — a backend business logic module that performs database operations and returns results via the SIF framework |
| CBS | Acronym | CBS (Call Business System) — the screen-level business logic component that orchestrates user-facing transactions |
| CAANMsg | Class | Common Array ANimation Message — a message container class used throughout the framework to hold structured data and metadata (like status codes) for SIF communication |
| ServiceComponentRequestInvoker | Class | Framework class that performs the actual SC invocation, handling request serialization, DB session management, and response deserialization |
| TEMPLATE_LIST_KEY | Constant | Key string `"template_list"` used in JCMConstants to store/retrieve the CAANMsg[] array in the SIF request and result hashes |
| STATUS_INT_KEY | Constant | Key string `"status"` used in JCMConstants to retrieve the integer status code from a CAANMsg template (0 = success, non-zero = error) |
| KKSV0200 | Screen | Address Change Screen — a screen CBS where this method was originally called (now commented out) as part of the number portability return workflow |
| Number Portability Return | Business term | 番ポ返 (bampo-kaeshi) — a business process where a customer's phone number is returned/portability reversed after a number port request |
| JCMConstants | Class | Fujitsu common framework constants class providing SIF communication keys like TEMPLATE_LIST_KEY and STATUS_INT_KEY |
| requestParam | Field | Data map extracted from the IRequestParameterReadWrite object, used as the primary input/output carrier for screen data |
| addrchgFlg | Field | Address change flag — indicates whether an address change is currently in progress (referenced by the commented-out caller) |
| ERR_LV_NOMAL | Constant | Normal completion code `"0000"` — the business error level indicating successful processing |
| ERR_LV_BIJINES_ERR | Constant | Business error code `"1100"` — the error level indicating a business logic violation |

---
