# Business Logic — JKKAdchgHakkoSODCC.editInMsg_EKK1081D010CBS() [237 LOC]

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

## 1. Role

### JKKAdchgHakkoSODCC.editInMsg_EKK1081D010CBS()

This method performs **upstream data mapping for Order Issuance Condition Registration** (上りマッピング（オーダ発行条件登録）). It is a data transformation method executed by a service component (SC) **before** the main CBS business logic runs. Specifically, it reads a work map (`HakkoSODCCWORK`) from the request parameter, extracts roughly 19 business fields — including service contract numbers, order codes, equipment identifiers, and customer contact information — and maps them into a `CAANMsg` template of type `EKK1081D010CBSMsg`. The template is then placed inside a `paramMap` alongside standard SC input metadata (transaction ID, use case ID, operation ID, hostname, IP, screen ID, operator ID) and returned for the CBS layer to consume.

The method implements a **data builder pattern**: it constructs a typed message envelope (`CAANMsg`), populates it field-by-field with null-safety checks, and returns the fully assembled input map. It handles **two functional scenarios** — **Check** and **Register** — via the `func_code` field set to `1` (`FUNC_CD_1`), which the downstream CBS uses to determine whether to validate existing records or create new ones.

It is a **shared utility** called by multiple order creation and modification context classes (`JKKHakkoSODCC`, `JKKKikiDslAddCC`, `JKKAdchgCancelHakkoSODCC`), making it a central hub for translating work-map data into CBS-message format across the order issuance and service change domain. The method has no conditional branches based on data values — every call path maps the same set of fields, with the null/empty check on `inMap` being the sole control flow divergence.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsg_EKK1081D010CBS param"])
    START --> INIT["Initialize paramMap and template_id = EKK1081D010"]
    INIT --> SC_DATA["Map SC input common data
TRANZACTION_ID_KEY, USECASE_ID_KEY, OPERATION_ID_KEY, CALL_TYPE_KEY"]
    SC_DATA --> CTRL_DATA["Map control map data
CLIENT_HOST_NAME_KEY, CLIENT_IP_ADDRESS_KEY, INVOKE_GAMEN_ID_KEY, OPERATOR_ID_KEY"]
    CTRL_DATA --> TEMPLATE["Create CAANMsg template with EKK1081D010CBSMsg"]
    TEMPLATE --> SET_TEMPLATE_ID["Set TEMPLATEID and FUNC_CODE = 1 (Check & Register)"]
    SET_TEMPLATE_ID --> EDIT_BASIC["Call editBasicCmn param, template"]
    EDIT_BASIC --> GET_INMAP["Get inMap from param.getData(HAKKOSODCCWORKMAP)"]
    GET_INMAP --> CHECK_INMAP{"inMap is null"}

    CHECK_INMAP -->|yes| ALL_NULLS["Set all template fields to null"]
    CHECK_INMAP -->|no| MAP_FIELDS["Map fields from inMap to template

svc_kei_no
svc_kei_ucwk_no
kktk_svc_kei_no
op_svc_kei_no
sbop_svc_kei_no
seiopsvc_kei_no
order_sbt_cd
svc_order_cd
yokyu_sbt_cd
odr_hakko_joken_cd
same_trn_no
taknkiki_model_cd
kiki_seizo_no
mlad
spot_login_sysid
send_req_fin_dtm
svc_kei_kaisen_ucwk_no (ANK-3731)
kei_svc_ctl_yokyu_odr_skcd (ANK-0099)"]

    ALL_NULLS --> PACK_TEMPLATES["Pack template into templates array"]
    MAP_FIELDS --> PACK_TEMPLATES
    PACK_TEMPLATES --> PUT_TEMPLATE["paramMap.put TEMPLATE_LIST_KEY with templates"]
    PUT_TEMPLATE --> RETURN["Return paramMap"]
    RETURN --> END(["End"])
```

**Constant Resolution:**

| Constant | Actual Value | Business Meaning |
|----------|-------------|------------------|
| `JPCModelConstant.FUNC_CD_1` | `"1"` | Check and Register (チエック＆登録) — the CBS processes both validation and insertion |
| `JKKHakkoSODConstCC.HAKKOSODCCWORKMAP` | `"HakkoSODCCWORK"` | Key to the work map holding order issuance condition registration data |
| `template_id` | `"EKK1081D010"` | Template identifier for the CBS message type |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadOnly` | The request parameter envelope carrying all business and control data required for the CBS call. It contains the work map (`HakkoSODCCWORK`) with service contract/order fields, a control map with host/IP/screen/operator metadata, and standard SC routing data (transaction ID, use case ID, operation ID, call type). |

**Instance fields / external state read:**
None — this method is fully stateless; it reads only from the `param` argument and constructs all output locally.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `editBasicCmn` | - | - | Sets common message fields (template ID, function code, etc.) on the CBS template |
| R | `param.getTelegramID` | - | - | Reads the transaction ID from the request parameter |
| R | `param.getUsecaseID` | - | - | Reads the use case ID from the request parameter |
| R | `param.getOperationID` | - | - | Reads the operation ID from the request parameter |
| R | `param.getCallType` | - | - | Reads the service call type discriminator from the request parameter |
| R | `param.getControlMapData` | - | - | Reads control map entries: hostname, IP address, screen ID, operator ID |
| R | `param.getData` | - | - | Retrieves the `HakkoSODCCWORK` work map containing business data fields |
| - | `template.set` / `template.setNull` | - | - | Sets or nullifies individual message fields on the CBS template |
| R | `paramMap.put` | - | - | Stores assembled data into the return parameter map |

**Note:** This method does not directly perform any database operations. It is a pure data-mapping layer that constructs the CBS input message. The actual CRUD operations (C/R/U/D) on database tables are performed by the downstream CBS `EKK1081D010CBS`, which receives the assembled `CAANMsg` template.

## 5. Dependency Trace

### Direct callers (methods that invoke this method):

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKAdchgHakkoSODCC` | `JKKAdchgHakkoSODCC.editInMsg_EKK1081D010CBS(param)` (line 18869) | — (private method) |
| 2 | `JKKHakkoSODCC` | `JKKHakkoSODCC.editInMsg_EKK1081D010CBS(param)` (line 26672) | — (private method) |
| 3 | `JKKKikiDslAddCC` | `JKKKikiDslAddCC.editInMsg_EKK1081D010CBS(param)` (line 741) | — (private method) |
| 4 | `JKKAdchgCancelHakkoSODCC` | `JKKAdchgCancelHakkoSODCC.editInMsg_EKK1081D010CBS(param)` (line 16402) | — (private method) |

**Note:** The `editInMsg_EKK1081D010CBS` method is declared as `private` within `JKKAdchgHakkoSODCC` and is also independently overridden as a private method in three other CC classes (`JKKHakkoSODCC`, `JKKKikiDslAddCC`, `JKKAdchgCancelHakkoSODCC`). Each of these classes has its own copy of this method (not inherited), suggesting it is part of a shared code-generation template. The callers of this private method are internal to those classes, typically in the main service method that orchestrates the CBS call flow. No screen (KKSV*) or batch entry points were found calling this method directly, as it sits deep within the CC layer as a data-mapping utility.

**Terminal operations from this method:** `template.set()` and `template.setNull()` — field setters on the CBS message template (no database or external I/O).

## 6. Per-Branch Detail Blocks

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

| # | Type | Code |
|---|------|------|
| 1 | SET | `template_id = "EKK1081D010"` // CBS template identifier constant |
| 2 | SET | `paramMap = new HashMap<String, Object>()` // Output map for the SC |

**Block 2** — [EXEC] Map SC input common data from param (L14119–14127)

> Copies routing and transaction metadata from the request parameter into the paramMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(JCMConstants.TRANZACTION_ID_KEY, param.getTelegramID())` // Transaction ID [-> "TRANZACTION_ID_KEY"] |
| 2 | SET | `paramMap.put(JCMConstants.USECASE_ID_KEY, param.getUsecaseID())` // Use case ID [-> "USECASE_ID_KEY"] |
| 3 | SET | `paramMap.put(JCMConstants.OPERATION_ID_KEY, param.getOperationID())` // Operation ID [-> "OPERATION_ID_KEY"] |
| 4 | SET | `paramMap.put(JCMConstants.CALL_TYPE_KEY, param.getCallType())` // Service call type discriminator [-> "CALL_TYPE_KEY"] |

**Block 3** — [EXEC] Map control map data from param (L14133–14143)

> Retrieves control context (hostname, IP, screen ID, operator ID) from the control map embedded in the request.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(JCMConstants.CLIENT_HOST_NAME_KEY, param.getControlMapData(SCControlMapKeys.REQ_HOSTNAME))` // Requested hostname [-> REQ_HOSTNAME] |
| 2 | SET | `paramMap.put(JCMConstants.CLIENT_IP_ADDRESS_KEY, param.getControlMapData(SCControlMapKeys.REQ_HOSTIP))` // Request source IP address [-> REQ_HOSTIP] |
| 3 | SET | `paramMap.put(JCMConstants.INVOKE_GAMEN_ID_KEY, param.getControlMapData(SCControlMapKeys.REQ_VIEWID))` // Request source screen ID [-> REQ_VIEWID] |
| 4 | SET | `paramMap.put(JCMConstants.OPERATOR_ID_KEY, param.getControlMapData(SCControlMapKeys.OPERATOR_ID))` // Operator ID [-> OPERATOR_ID] |

**Block 4** — [SET] Create CAANMsg template and set template-level fields (L14146–14153)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EKK1081D010CBSMsg.class.getName())` // CBS message template of type EKK1081D010CBSMsg |
| 2 | SET | `inMap = null` // Work map variable, to be populated from param |
| 3 | SET | `template.set(EKK1081D010CBSMsg.TEMPLATEID, template_id)` // Set template ID [-> "EKK1081D010"] |
| 4 | SET | `template.set(EKK1081D010CBSMsg.FUNC_CODE, JPCModelConstant.FUNC_CD_1)` // Function code [-> FUNC_CD_1 = "1"] (Check & Register) |

**Block 5** — [CALL] Invoke common message setup (L14155)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editBasicCmn(param, template)` // Sets basic common fields on the CBS template |

**Block 6** — [EXEC] Retrieve the work map from param (L14158)

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap = (HashMap)param.getData(JKKHakkoSODConstCC.HAKKOSODCCWORKMAP)` // Work map key [-> HAKKOSODCCWORKMAP = "HakkoSODCCWORK"] |

**Block 7** — [IF-ELSE chain] Map fields from inMap to template (L14161–14338)

> For each of the ~19 business fields, the method checks whether `inMap` is null, the field key is null, or the value is an empty string. If so, it sets the template field to null; otherwise it casts and copies the string value.

**Block 7.1** — [IF-ELSE] `svc_kei_no` (Service Contract Number) (L14161–14169)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.SVC_KEI_NO)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.SVC_KEI_NO, (String)inMap.get("svc_kei_no"))` // [-> mapped value] |

**Block 7.2** — [IF-ELSE] `svc_kei_ucwk_no` (Service Contract Detail Work Number) (L14173–14181)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.SVC_KEI_UCWK_NO)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.SVC_KEI_UCWK_NO, (String)inMap.get("svc_kei_ucwk_no"))` // [-> mapped value] |

**Block 7.3** — [IF-ELSE] `kktk_svc_kei_no` (Equipment-Provided Service Contract Number) (L14185–14193)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.KKTK_SVC_KEI_NO)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.KKTK_SVC_KEI_NO, (String)inMap.get("kktk_svc_kei_no"))` // [-> mapped value] |

**Block 7.4** — [IF-ELSE] `op_svc_kei_no` (Option Service Contract Number) (L14197–14205)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.OP_SVC_KEI_NO)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.OP_SVC_KEI_NO, (String)inMap.get("op_svc_kei_no"))` // [-> mapped value] |

**Block 7.5** — [IF-ELSE] `sbop_svc_kei_no` (Sub-Option Service Contract Number) (L14209–14217)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.SBOP_SVC_KEI_NO)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.SBOP_SVC_KEI_NO, (String)inMap.get("sbop_svc_kei_no"))` // [-> mapped value] |

**Block 7.6** — [IF-ELSE] `seiopsvc_kei_no` (Billing Option Service Contract Number) (L14221–14229)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.SEIOPSVC_KEI_NO)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.SEIOPSVC_KEI_NO, (String)inMap.get("seiopsvc_kei_no"))` // [-> mapped value] |

**Block 7.7** — [IF-ELSE] `order_sbt_cd` (Order Type Code) (L14233–14241)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.ORDER_SBT_CD)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.ORDER_SBT_CD, (String)inMap.get("order_sbt_cd"))` // [-> mapped value] |

**Block 7.8** — [IF-ELSE] `svc_order_cd` (Service Order Code) (L14245–14253)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.SVC_ORDER_CD)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.SVC_ORDER_CD, (String)inMap.get("svc_order_cd"))` // [-> mapped value] |

**Block 7.9** — [IF-ELSE] `yokyu_sbt_cd` (Requirement Type Code) (L14257–14265)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.YOKYU_SBT_CD)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.YOKYU_SBT_CD, (String)inMap.get("yokyu_sbt_cd"))` // [-> mapped value] |

**Block 7.10** — [IF-ELSE] `odr_hakko_joken_cd` (Order Issuance Condition Code) (L14269–14277)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.ODR_HAKKO_JOKEN_CD)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.ODR_HAKKO_JOKEN_CD, (String)inMap.get("odr_hakko_joken_cd"))` // [-> mapped value] |

**Block 7.11** — [IF-ELSE] `same_trn_no` (Same Transaction Number) (L14281–14289)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.SAME_TRN_NO)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.SAME_TRN_NO, (String)inMap.get("same_trn_no"))` // [-> mapped value] |

**Block 7.12** — [IF-ELSE] `taknkiki_model_cd` (Home Equipment Model Code) (L14293–14301)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.TAKNKIKI_MODEL_CD)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.TAKNKIKI_MODEL_CD, (String)inMap.get("taknkiki_model_cd"))` // [-> mapped value] |

**Block 7.13** — [IF-ELSE] `kiki_seizo_no` (Equipment Manufacturing Number / Serial Number) (L14305–14313)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.KIKI_SEIZO_NO)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.KIKI_SEIZO_NO, (String)inMap.get("kiki_seizo_no"))` // [-> mapped value] |

**Block 7.14** — [IF-ELSE] `mlad` (Mailing Address) (L14317–14325)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.MLAD)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.MLAD, (String)inMap.get("mlad"))` // [-> mapped value] |

**Block 7.15** — [IF-ELSE] `spot_login_sysid` (Spot Login System ID) (L14329–14337)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.SPOT_LOGIN_SYSID)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.SPOT_LOGIN_SYSID, (String)inMap.get("spot_login_sysid"))` // [-> mapped value] |

**Block 7.16** — [IF-ELSE] `send_req_fin_dtm` (Transmission Request Completion Datetime) (L14341–14349)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.SEND_REQ_FIN_DTM)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.SEND_REQ_FIN_DTM, (String)inMap.get("send_req_fin_dtm"))` // [-> mapped value] |

**Block 7.17** — [IF-ELSE] `svc_kei_kaisen_ucwk_no` (Service Contract Revision Detail Work Number) — ANK-3731 ADD (L14352–14360)

> Added per change request ANK-3731-00-00. Maps the service contract revision detail work number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.SVC_KEI_KAISEN_UCWK_NO)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.SVC_KEI_KAISEN_UCWK_NO, (String)inMap.get("svc_kei_kaisen_ucwk_no"))` // [-> mapped value] |

**Block 7.18** — [IF-ELSE] `kei_svc_ctl_yokyu_odr_skcd` (Contract Service Control Requirement Order Identification Code) — ANK-0099 (L14363–14371)

> Added per change request ANK-0099-00-00 on 2012/05/25 by kitatani. Maps the contract service control requirement order identification code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK1081D010CBSMsg.KEI_SVC_CTL_YOKYU_ODR_SKCD)` // [-> null if missing] |
| 2 | SET | `template.set(EKK1081D010CBSMsg.KEI_SVC_CTL_YOKYU_ODR_SKCD, (String)inMap.get("kei_svc_ctl_yokyu_odr_skcd"))` // [-> mapped value] |

**Block 8** — [SET] Pack template into array and put into paramMap (L14374–14377)

| # | Type | Code |
|---|------|------|
| 1 | SET | `templates = new CAANMsg[1]` // Single-element template array |
| 2 | SET | `templates[0] = template` // Assign the assembled template |
| 3 | SET | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` // [-> "TEMPLATE_LIST_KEY"] |

**Block 9** — [RETURN] Return the assembled paramMap (L14379)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return paramMap` // Returns the fully assembled CBS input parameter map |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service Contract Number — the primary identifier for a service contract line item |
| `svc_kei_ucwk_no` | Field | Service Contract Detail Work Number — internal tracking ID for a service contract's detailed work process |
| `svc_kei_kaisen_ucwk_no` | Field | Service Contract Revision Detail Work Number — tracking ID for revised/modified service contract work |
| `kktk_svc_kei_no` | Field | Equipment-Provided Service Contract Number — contract number associated with equipment provided by the vendor |
| `op_svc_kei_no` | Field | Option Service Contract Number — contract number for optional/add-on services |
| `sbop_svc_kei_no` | Field | Sub-Option Service Contract Number — contract number for sub-option services |
| `seiopsvc_kei_no` | Field | Billing Option Service Contract Number — contract number for billing-related optional services |
| `order_sbt_cd` | Field | Order Type Code — classifies the type of order (e.g., new registration, modification, cancellation) |
| `svc_order_cd` | Field | Service Order Code — identifies the service order category |
| `yokyu_sbt_cd` | Field | Requirement Type Code — classifies the type of customer requirement (e.g., installation, change, inquiry) |
| `odr_hakko_joken_cd` | Field | Order Issuance Condition Code — determines the conditions under which an order is issued to downstream systems |
| `same_trn_no` | Field | Same Transaction Number — links related transactions that belong to the same business operation |
| `taknkiki_model_cd` | Field | Home Equipment Model Code — identifies the model of customer premises equipment (CPE) |
| `kiki_seizo_no` | Field | Equipment Manufacturing Number — serial number of the provided equipment |
| `mlad` | Field | Mailing Address — the customer's postal mailing address |
| `spot_login_sysid` | Field | Spot Login System ID — identifier for the spot login/authentication system |
| `send_req_fin_dtm` | Field | Transmission Request Completion Datetime — timestamp of when the transmission request was completed |
| `kei_svc_ctl_yokyu_odr_skcd` | Field | Contract Service Control Requirement Order Identification Code — code for identifying contract-level service control requirements |
| `HakkoSODCCWORK` | Constant | Key name for the work map (`HashMap`) that holds order issuance condition registration data in the request parameter |
| `FUNC_CD_1` | Constant | Function Code value `"1"` — means "Check and Register" (チエック＆登録), where the CBS validates and creates/updates records |
| SOD | Acronym | Service Order Data — the order data domain within the Fujitsu eo customer system |
| CC | Acronym | Common Component — a shared business logic component in the application layer |
| CAANMsg | Acronym | Fujitsu's message envelope class used to structure CBS input/output data |
| CBS | Acronym | Common Business Service — the backend service component layer that executes business logic |
| SC | Acronym | Service Component — a server-side component that coordinates business processing |
| `EKK1081D010CBS` | SC Code | Service Component for Order Issuance Condition Registration — processes registration of order issuance conditions |
| ANK-3731 | Change Request | Feature addition for service contract revision detail work number field |
| ANK-0099 | Change Request | Feature addition for contract service control requirement order identification code (2012/05/25, kitatani) |
