# (DD49) Business Logic — JDKCommon08CC.editResultUktk() [29 LOC]

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

## 1. Role

### JDKCommon08CC.editResultUktk()

This method extracts result data from a **Watch Control Order Acceptance Service** (視聴制御オーダ受付サービス) response and populates the working parameter map (`tmpParamMap`) for downstream processing. It receives the raw CAANMsg template array returned by the service call, identifies the primary template (index 0), and safely retrieves three key fields — watch control order number, control request key, and update datetime — from it. If any field is null, the method places an empty String into the result map to prevent downstream null-pointer issues.

The method implements a **defensive data extraction pattern**: it does not contain any conditional business logic (no service-type branching), but rather performs uniform null-safe extraction across all three fields. Each field follows the same pattern — check for null via `CAANMsg.isNull()`, then either store the actual value or a default empty String. This is a **delegated result parser** called after every Watch Control Order Acceptance SC invocation, serving as the bridge between the SC response and the working parameter map used by subsequent processing steps (e.g., order send and result registration).

It is a shared utility within `JDKCommon08CC`, which acts as the central common component for cable/telecom service order processing (including FTTH and watch control operations). The method has no CRUD operations of its own — it exclusively reads from the in-memory message object (`CAANMsg`) and writes to the in-memory parameter map.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editResultUktk msgList, tmpParamMap"])
    START --> EXTRACT["Extract CAANMsg[] templates from msgList via TEMPLATE_LIST_KEY"]
    EXTRACT --> PARENT["parentTemplate = templates[0]"]
    PARENT --> COND1{isNull WCTRL_ORDER_NO}
    COND1 -->|true| NULL1["put empty String to wctrl_order_no"]
    COND1 -->|false| VAL1["put parentTemplate.getString WCTRL_ORDER_NO"]
    NULL1 --> COND2
    VAL1 --> COND2{isNull CTRL_YOKYU_KEY}
    COND2 -->|true| NULL2["put empty String to ctrl_yokyu_key"]
    COND2 -->|false| VAL2["put parentTemplate.getString CTRL_YOKYU_KEY"]
    NULL2 --> COND3
    VAL2 --> COND3{isNull UPD_DTM}
    COND3 -->|true| NULL3["put empty String to last_upd_dtm_bf"]
    COND3 -->|false| VAL3["put parentTemplate.getString UPD_DTM"]
    NULL3 --> END1(["return"])
    VAL3 --> END1
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `msgList` | `Map<?, ?>` | The raw response from the Watch Control Order Acceptance SC call. Contains a `CAANMsg[]` array at key `TEMPLATE_LIST_KEY` (`"trgt_data"`). The first element (`templates[0]`) is the primary result template carrying extracted service fields. |
| 2 | `tmpParamMap` | `HashMap<String, Object>` | Working parameter map that accumulates intermediate data across the service invocation flow. This method populates three keys: `wctrl_order_no`, `ctrl_yokyu_key`, and `last_upd_dtm_bf`. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JACBatCommon.isNull` | JACBatCommon | - | Calls `isNull` in `JACBatCommon` |
| - | `JACbatRknBusinessUtil.isNull` | JACbatRknBusiness | - | Calls `isNull` in `JACbatRknBusinessUtil` |
| - | `JCHbatSeikyKaknoBusinessUtil.isNull` | JCHbatSeikyKaknoBusiness | - | Calls `isNull` in `JCHbatSeikyKaknoBusinessUtil` |
| - | `JBSbatACInsentetivePrcInfoSaksei.isNull` | JBSbatACInsentetivePrcInfoSaksei | - | Calls `isNull` in `JBSbatACInsentetivePrcInfoSaksei` |
| - | `JBSbatAKCHSeikyYsoInfMake.isNull` | JBSbatAKCHSeikyYsoInfMake | - | Calls `isNull` in `JBSbatAKCHSeikyYsoInfMake` |
| R | `JBSbatFUCaseFileRnkData.getString` | JBSbatFUCaseFileRnkData | - | Calls `getString` in `JBSbatFUCaseFileRnkData` |
| R | `JBSbatFUMoveNaviData.getString` | JBSbatFUMoveNaviData | - | Calls `getString` in `JBSbatFUMoveNaviData` |
| R | `JBSbatZMAdDataSet.getString` | JBSbatZMAdDataSet | - | Calls `getString` in `JBSbatZMAdDataSet` |
| R | `JESC0101B010TPMA.getString` | JESC0101B010TPMA | - | Calls `getString` in `JESC0101B010TPMA` |
| R | `JESC0101B020TPMA.getString` | JESC0101B020TPMA | - | Calls `getString` in `JESC0101B020TPMA` |

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `CAANMsg.isNull` | EWC0011D010CBSMsg | In-memory CAANMsg | Checks if watch control order number (`WCTRL_ORDER_NO = "wctrl_order_no"`) is null in the response template [-> WCTRL_ORDER_NO="wctrl_order_no" (EWC0011D010CBSMsg.java:549)] |
| R | `CAANMsg.getString` | EWC0011D010CBSMsg | In-memory CAANMsg | Reads the actual watch control order number value from the response template when not null [-> WCTRL_ORDER_NO="wctrl_order_no" (EWC0011D010CBSMsg.java:549)] |
| R | `CAANMsg.isNull` | EWC0011D010CBSMsg | In-memory CAANMsg | Checks if control request key (`CTRL_YOKYU_KEY = "ctrl_yokyu_key"`) is null in the response template [-> CTRL_YOKYU_KEY="ctrl_yokyu_key" (EWC0011D010CBSMsg.java:550)] |
| R | `CAANMsg.getString` | EWC0011D010CBSMsg | In-memory CAANMsg | Reads the actual control request key value from the response template when not null [-> CTRL_YOKYU_KEY="ctrl_yokyu_key" (EWC0011D010CBSMsg.java:550)] |
| R | `CAANMsg.isNull` | EWC0011D010CBSMsg | In-memory CAANMsg | Checks if update datetime (`UPD_DTM = "upd_dtm"`) is null in the response template [-> UPD_DTM="upd_dtm" (EWC0011D010CBSMsg.java:553)] |
| R | `CAANMsg.getString` | EWC0011D010CBSMsg | In-memory CAANMsg | Reads the actual update datetime value from the response template when not null [-> UPD_DTM="upd_dtm" (EWC0011D010CBSMsg.java:553)] |

**Note:** This method does not directly call any database SC or CBS methods. All operations are in-memory data extraction from the `CAANMsg` response object returned by the Watch Control Order Acceptance SC. The SC codes referenced above (e.g., `EWC0011D010CBSMsg`) identify the message schema used for field access, not a separate SC invocation.

## 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: `isNull` [R], `getString` [R], `isNull` [R], `getString` [R], `isNull` [R], `getString` [R], `get` [R], `put` [R], `put` [R], `put` [R], `put` [R], `put` [R], `put` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JDKCommon08CC.unlink` | `unlink(param, keyTkMdlCd, keyKkSeizoNo, keySvcKeiNo, checkMap, scCall, handle, keyHmpinKikiNo)` -> `scCall.run(paramMap, handle)` (Watch Control Order Acceptance SC) -> `editResultRrr(result, param)` -> `editResultUktk(result, tmpParamMap)` | `CAANMsg.isNull [R]`, `CAANMsg.getString [R]` — no DB access; in-memory extraction from Watch Control Order Acceptance response |

## 6. Per-Branch Detail Blocks

**Block 1** — [DATA EXTRACTION] `(L3344)`

> Extract the CAANMsg template array from the response map and identify the primary template at index 0.

| # | Type | Code |
|---|------|------|
| 1 | GET | `templates = (CAANMsg[]) msgList.get(JCMConstants.TEMPLATE_LIST_KEY)` // Extract template array from SC response [-> TEMPLATE_LIST_KEY="trgt_data" (JKKEponSwchKjInfSksiConstCC.java:180)] |
| 2 | SET | `parentTemplate = templates[0]` // Primary result template from Watch Control Order Acceptance service |

**Block 2** — [IF/ELSE] `(watch control order number: WCTRL_ORDER_NO = "wctrl_order_no")` (L3347)

> Extract the watch control order number from the response. If the field is null, store an empty String as a safe default.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `parentTemplate.isNull(EWC0011D010CBSMsg.WCTRL_ORDER_NO)` [-> WCTRL_ORDER_NO="wctrl_order_no" (EWC0011D010CBSMsg.java:549)] |
| 2 | SET (null path) | `tmpParamMap.put("wctrl_order_no", new String())` // Store empty String as safe default |
| 3 | SET (value path) | `tmpParamMap.put("wctrl_order_no", parentTemplate.getString(EWC0011D010CBSMsg.WCTRL_ORDER_NO))` // Store actual order number value |

**Block 3** — [IF/ELSE] `(control request key: CTRL_YOKYU_KEY = "ctrl_yokyu_key")` (L3352)

> Extract the control request key from the response. If the field is null, store an empty String as a safe default.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `parentTemplate.isNull(EWC0011D010CBSMsg.CTRL_YOKYU_KEY)` [-> CTRL_YOKYU_KEY="ctrl_yokyu_key" (EWC0011D010CBSMsg.java:550)] |
| 2 | SET (null path) | `tmpParamMap.put("ctrl_yokyu_key", new String())` // Store empty String as safe default |
| 3 | SET (value path) | `tmpParamMap.put("ctrl_yokyu_key", parentTemplate.getString(EWC0011D010CBSMsg.CTRL_YOKYU_KEY))` // Store actual control request key value |

**Block 4** — [IF/ELSE] `(update datetime: UPD_DTM = "upd_dtm")` (L3357)

> Extract the last update datetime from the response. If the field is null, store an empty String as a safe default.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `parentTemplate.isNull(EWC0011D010CBSMsg.UPD_DTM)` [-> UPD_DTM="upd_dtm" (EWC0011D010CBSMsg.java:553)] |
| 2 | SET (null path) | `tmpParamMap.put("last_upd_dtm_bf", new String())` // Store empty String as safe default |
| 3 | SET (value path) | `tmpParamMap.put("last_upd_dtm_bf", parentTemplate.getString(EWC0011D010CBSMsg.UPD_DTM))` // Store actual update datetime value |

**Block 5** — [RETURN] `(L3363)`

> Return to caller. The `tmpParamMap` now contains three keys populated from the Watch Control Order Acceptance service response.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // End method execution; tmpParamMap is fully populated |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `wctrl_order_no` | Field | Watch Control Order Number — the unique identifier assigned to a watch control order, used to track the acceptance of remote service control commands for subscriber equipment. |
| `ctrl_yokyu_key` | Field | Control Request Key — a key identifying the specific control request context, linking the order to its originating control directive. |
| `last_upd_dtm_bf` | Field | Last Update DateTime (Before) — timestamp of the most recent update to the watch control order record, used for optimistic locking and audit trail. |
| `CAANMsg` | Class | Common Application ANMsg — Fujitsu's enterprise message wrapper class used to encapsulate service call input/output data. Provides `isNull()` and `getString()` for safe field access. |
| `TEMPLATE_LIST_KEY` | Constant | `"trgt_data"` — the map key used to store and retrieve the CAANMsg template array in the SC response. |
| `EWC0011D010CBSMsg` | CBS Message Class | Message schema class for the Watch Control Order Acceptance Service (EWC0011D010), defining field constants for order number, control request key, and update datetime. |
| Watch Control (視聴制御) | Business term | Remote control of subscriber equipment (e.g., STB/C-CAS) — a telecom service feature enabling operators to remotely manage set-top box functions such as unlocking, firmware updates, and service entitlement changes. |
| Watch Control Order (視聴制御オーダ) | Business term | A service order record that initiates a remote control action on subscriber equipment. This is the core entity managed by the EWC0011D010 SC. |
| `JDKCommon08CC` | Class | Common component class containing shared utility methods for Fujitsu telecom cable/FTTH service order processing, including watch control, equipment registration, and order result extraction. |
| `unlink` | Method | A method in JDKCommon08CC that processes equipment unlinking (detachment from service) by invoking a series of service calls including watch control order acceptance. |
| `SCCallException` | Exception | Custom exception thrown when a Service Component (SC) call fails, carrying a Japanese error message, error code "0", and a numeric return code from the SC. |
| `SC` | Acronym | Service Component — a backend service layer component in the Fujitsu JBS framework that encapsulates business logic and data access. |
| `CAANMsg[]` | Type | Array of CAANMsg objects, representing the template list returned by an SC call containing the response data. |
