---

# Business Logic — JDKCommon08CC.editTkniKikiMsg() [37 LOC]

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

## 1. Role

### JDKCommon08CC.editTkniKikiMsg()

This method assembles the parameter envelope for the **Indoor Equipment Model Unique Lookup** service (宅内機器型式一意照会サービス), identified by service IF ID `EZM0411A010`. It acts as a message builder that transforms flat input parameters from various business screens into a structured `CAANMsg` template object conforming to the `EZM0411A010CBSMsg` schema.

Specifically, it instantiates a `CAANMsg` object, configures standard operational metadata — a hardcoded function code (value `"1"`, the default), the operator's date, datetime, and ID drawn from `tmpParamMap` — and then conditionally sets the indoor equipment model code (`taknkiki_mdl_cd`) from the same parameter map, using `setNull` when the value is absent or empty to signal an unfiltered lookup. The completed template is wrapped into a single-element `CAANMsg[]` array and stored back into `paramMap` under the key `TEMPLATE_LIST_KEY`, making it available for downstream service component invocation via `scCall.run()`.

This method implements the **delegation pattern**: it does not perform any business logic itself but shapes and packages request parameters for the CBS (Central Business System) layer. It is a shared utility method referenced by multiple screens that need to query indoor equipment model information, including the screen handler `DKSV0008` (via method `DKSV008101` at line 1650 of the same class).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editTkniKikiMsg params"])
    A["Create CAANMsg template
EZM0411A010CBSMsg"]
    B["Set TEMPLATEID
EZM0411A010"]
    START --> A
    A --> B
    B --> C{"inMap
is not null"}
    C -->|true| D["Set FUNC_CODE
value 1"]
    C -->|false| L["Wrap template in array
and put in paramMap"]
    D --> E["Set OPERATEDATE
tmpParamMap get operate_date_key"]
    E --> F["Set OPERATEDATETIME
tmpParamMap get operate_datetime_key"]
    F --> G["Set OPERATORID
tmpParamMap get operator_id"]
    G --> H{"taknkiki_mdl_cd
is null or empty"}
    H -->|true| I["SetNull
KEY_TAKNKIKI_MODEL_CD"]
    H -->|false| J["Set KEY_TAKNKIKI_MODEL_CD
tmpParamMap get taknkiki_mdl_cd"]
    I --> L
    J --> L
    L --> K["paramMap put TEMPLATE_LIST_KEY
CAANMsg array"]
    K --> M(["Return paramMap"])
```

**Processing summary:**

1. **Template Creation:** Instantiate a `CAANMsg` using the `EZM0411A010CBSMsg` schema class, which defines the CBS request structure for the indoor equipment model unique lookup service.
2. **Template ID Set:** Hardcode the template identifier to `"EZM0411A010"`, matching the service IF ID.
3. **Operational Metadata (conditional on `inMap != null`):** When `inMap` is non-null (indicating valid caller context), set the function code to `"1"` (default), and populate the operator date, operator datetime, and operator ID from `tmpParamMap`. These fields ensure audit trail and operational traceability for the CBS call.
4. **Indoor Equipment Model Code (conditional):** If the indoor equipment model code (`taknkiki_mdl_cd`) from `tmpParamMap` is null or an empty string, call `setNull` to signal that the CBS should not filter by model code (i.e., return all models). Otherwise, set the actual model code value to enable filtered lookup.
5. **Template Assembly:** Wrap the single `CAANMsg` template into a `CAANMsg[]` array and store it into `paramMap` under the key `JCMConstants.TEMPLATE_LIST_KEY`.
6. **Return:** Return the modified `paramMap`, now containing the assembled service request template, for further processing by the caller (typically `scCall.run()`).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramMap` | `HashMap<String, Object>` | The shared parameter envelope passed through the service call pipeline. It carries control data (client hostname, IP, screen ID, operator ID) set by the caller, and this method writes the assembled `CAANMsg` template array into it under the `TEMPLATE_LIST_KEY` key. The map is mutated in-place and returned to the caller. |
| 2 | `inMap` | `HashMap` | The functional input map carrying caller context. When non-null, it signals that the caller has a valid functional context, triggering the population of operational metadata (function code `"1"`, operator date, datetime, and ID). A null `inMap` skips operational metadata but the template is still assembled. Acts as a guard for optional audit fields. |
| 3 | `tmpParamMap` | `HashMap<String, Object>` | The temporary parameter map that holds the query parameters for the indoor equipment model lookup. Contains the `operate_date_key` (operational date), `operate_datetime_key` (operational datetime), `operator_id` (the ID of the operator performing the action), and `taknkiki_mdl_cd` (indoor equipment model code — when present, the CBS filters results to the specified model; when null or empty, all models are returned). |

**External state / fields read:**
- No instance fields are read directly by this method. All state is passed through parameters.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `CAANMsg.<init>` | - | - | Instantiates a CAANMsg message template using EZM0411A010CBSMsg schema |
| - | `CAANMsg.set` | - | - | Sets message fields: TEMPLATEID, FUNC_CODE, OPERATEDATE, OPERATEDATETIME, OPERATORID, KEY_TAKNKIKI_MODEL_CD |
| - | `CAANMsg.setNull` | - | - | Clears KEY_TAKNKIKI_MODEL_CD field when taknkiki_mdl_cd is null or empty |
| R | `EZM0411A010CBS` (called by scCall) | EZM0411A010SC | Indoor equipment model tables | The assembled template is passed to scCall.run() which invokes the CBS service EZM0411A010 for indoor equipment model unique lookup. The CBS performs a read operation against indoor equipment model master tables. |

**Note:** This method itself performs no direct database operations. All data access is delegated to the CBS service `EZM0411A010SC` through the `scCall.run()` invocation in the caller (`DKSV008101`). The `setNull` and `set` calls on `CAANMsg` are message schema manipulation, not CRUD on persistent data.

## 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: `setNull` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JDKCommon08CC.DKSV008101` (L1650) | `DKSV008101` -> `editTkniKikiMsg(paramMap, inMap, tmpParamMap)` -> `scCall.run(paramMap, handle)` -> `EZM0411A010SC [R] Indoor Equipment Model Tables` | `setNull [-]`, `set [-]`, `CAANMsg.set(TEMPLATEID, "EZM0411A010")`, `CAANMsg.set(FUNC_CODE, "1")`, `CAANMsg.set(OPERATEDATE)`, `CAANMsg.set(OPERATEDATETIME)`, `CAANMsg.set(OPERATORID)`, `CAANMsg.set(KEY_TAKNKIKI_MODEL_CD)` |

**Caller details:** The method is called from `DKSV008101` (line 1650 of `JDKCommon08CC.java`), which handles the indoor equipment model unique lookup processing (宅内機器型式一意照会処理) as part of the user area constant mapping section (取得元: ユーザエリア(コントローラムップ)). The caller sets control map data (client hostname, IP, screen ID, operator ID) and retrieves user data from `param` before invoking `editTkniKikiMsg`, then passes the enriched `paramMap` to `scCall.run()` for CBS invocation.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(L2526-2528)` Initialize message template

> Creates a new CAANMsg message using the EZM0411A010CBSMsg schema class, then sets the hardcoded template ID to "EZM0411A010" matching the service IF ID for indoor equipment model unique lookup.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EZM0411A010CBSMsg.class.getName())` // Create CAANMsg with EZM0411A010CBSMsg schema |
| 2 | SET | `template.set(EZM0411A010CBSMsg.TEMPLATEID, "EZM0411A010")` // Set template ID to "EZM0411A010" [-> Constant: TEMPLATEID = "templateID"] |

**Block 2** — [IF] `(inMap != null)` `(L2529)`

> When inMap is not null, populate operational metadata fields. The comment 機能コード（デフォルト：1）indicates this is the default function code for the service.

**Block 2.1** — [nested: SET operations] `(L2532-2537)`

> Sets the four operational metadata fields on the template when inMap is present.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EZM0411A010CBSMsg.FUNC_CODE, "1")` // Set function code to "1" (default) [-> Constant: FUNC_CODE = "func_code"] |
| 2 | SET | `template.set(EZM0411A010CBSMsg.OPERATEDATE, tmpParamMap.get("operate_date_key"))` // Set operational date from tmpParamMap [-> Constant: OPERATEDATE = "operateDate"] |
| 3 | SET | `template.set(EZM0411A010CBSMsg.OPERATEDATETIME, tmpParamMap.get("operate_datetime_key"))` // Set operational datetime from tmpParamMap [-> Constant: OPERATEDATETIME = "operateDatetime"] |
| 4 | SET | `template.set(EZM0411A010CBSMsg.OPERATORID, tmpParamMap.get("operator_id"))` // Set operator ID from tmpParamMap [-> Constant: OPERATORID = "operatorID"] |

**Block 3** — [IF-ELSE] `(taknkiki_mdl_cd is null or empty)` `(L2540)`

> Conditional handling of the indoor equipment model code (宅内機器型式コード). If the model code from tmpParamMap is null or an empty string, the field is set to null to indicate no model filter (unfiltered lookup). Otherwise, the actual model code value is set to enable filtered lookup for a specific indoor equipment model.
>
> The comment 宅内機器型式コード translates to "Indoor Equipment Model Code".

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EZM0411A010CBSMsg.KEY_TAKNKIKI_MODEL_CD)` // Clear model code field — no filter [-> Constant: KEY_TAKNKIKI_MODEL_CD = "key_taknkiki_model_cd"] |
| 2 | SET | `template.set(EZM0411A010CBSMsg.KEY_TAKNKIKI_MODEL_CD, tmpParamMap.get("taknkiki_mdl_cd"))` // Set specific model code for filtered lookup [-> Constant: KEY_TAKNKIKI_MODEL_CD = "key_taknkiki_model_cd"] |

**Block 4** — [SET] `(L2547-2549)` Assemble template array and write to paramMap

> Wraps the single CAANMsg template into a CAANMsg array of size 1, then stores it in paramMap under the template list key constant, making it available for the CBS call.

| # | Type | Code |
|---|------|------|
| 1 | SET | `templates = new CAANMsg[1]` // Create single-element CAANMsg array |
| 2 | SET | `templates[0] = template` // Assign the built template to index 0 |
| 3 | SET | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` // Store template array in paramMap [-> Constant: TEMPLATE_LIST_KEY] |

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

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return paramMap` // Return the mutated paramMap containing the assembled CAANMsg template array |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `taknkiki_mdl_cd` | Field | Indoor equipment model code — the model/type identifier for indoor units (宅内機器型式). When null or empty, the CBS returns all models; when set, filters to a specific model. |
| `operate_date_key` | Field | Operational date — the date on which the service operation is performed, provided by tmpParamMap. |
| `operate_datetime_key` | Field | Operational datetime — the full timestamp of the service operation. |
| `operator_id` | Field | Operator ID — the identifier of the system operator performing the action, used for audit trail. |
| `TEMPLATE_LIST_KEY` | Constant | Template list key — the paramMap key under which the CAANMsg template array is stored for CBS invocation. |
| `FUNC_CODE` | Field | Function code — identifies the service function. Value `"1"` is the default (デフォルト). |
| `TEMPLATEID` | Field | Service IF ID — the identifier of the CBS service interface. Value `"EZM0411A010"` corresponds to the indoor equipment model unique lookup service. |
| `KEY_TAKNKIKI_MODEL_CD` | Field | Key for indoor equipment model code in the CBS message schema. |
| `EZM0411A010` | Service ID | Indoor equipment model unique lookup service (宅内機器型式一意照会サービス) — a CBS service that queries indoor equipment model master data. |
| `CAANMsg` | Technical | Canonical message envelope — a Fujitsu message schema object that carries structured parameters for CBS service calls. Extends `CAANSchemaInfo`. |
| `CAANSchemaInfo` | Technical | Base class for CBS message schemas, providing `set()` and `setNull()` methods for field population. |
| `scCall` | Technical | Service component call handler — the runtime mechanism that invokes CBS services (e.g., `scCall.run(paramMap, handle)`) based on the assembled template in paramMap. |
| 宅内機器型式一意照会 | Japanese term | Indoor Equipment Model Unique Lookup — the business operation of looking up indoor equipment models by their unique model code. |
| 宅内機器型式コード | Japanese term | Indoor Equipment Model Code — the model identifier for indoor units (e.g., indoor air conditioning units, indoor network equipment). |
| 機能コード | Japanese term | Function Code — a code identifying which function of the CBS service is being invoked. |
| 運用日付 / 運用日時 | Japanese terms | Operational Date / Operational Datetime — audit fields recording when the service operation was performed. |
| オペレータID | Japanese term | Operator ID — the ID of the person or system component performing the operation, for audit trail purposes. |

---
