# Business Logic — JBSbatKKAdChgTekkyoKjFinUpd.isSingleCheckKKIFM629_INF1() [105 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKAdChgTekkyoKjFinUpd` |
| Layer | Service (Batch processing service layer) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKAdChgTekkyoKjFinUpd.isSingleCheckKKIFM629_INF1()

This method performs **single-item (field-level) validation** on incoming address-change-withdrawal-construction-completion data (TXT-KKIFM629-INF1), a batch processing input record in NTT East's telecom service fulfillment domain. The service processes residential address change requests where withdrawal construction work has been completed, validating each input field against mandatory, length, and character-attribute rules before the record is accepted for downstream processing. It follows a **gatekeeper validation pattern** — iterating through four business fields in sequence, each checked against three validation rules, returning false and logging the first error encountered so that corrections can be made before data progresses. The method is a shared validation utility called directly by the `execute()` method of the same class, which orchestrates the full batch job for this service type. Design pattern: **Early Return (Fail-Fast)** — each failed validation immediately logs the error and returns `false`, preventing cascading errors and reducing the error report to a single actionable issue at a time.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["isSingleCheckKKIFM629_INF1(rsMap, itemvalueMap)"])
    START --> DEBUG["printDebugLog: Enter single item check"]
    DEBUG --> INIT["Initialize strValue = null"]

    INIT --> GET_SVC["Get SVC_KEI_NO from rsMap"]
    GET_SVC --> SVC_NULL{SVC_KEI_NO is null or blank?}
    SVC_NULL -->|Yes| SVC_ERR["printBusinessErrorLog: EKKB0060TE - Required field missing"]
    SVC_ERR --> SVC_RETURN["Return false"]
    SVC_NULL -->|No| SVC_LEN{Length 2-10 and alphanumeric?}
    SVC_LEN -->|No| SVC_ATTR_ERR["printBusinessErrorLog: EKKB0070TE - Invalid length"]
    SVC_ATTR_ERR --> SVC_ATTR_RETURN["Return false"]
    SVC_LEN -->|Yes| SVC_ATTR{Alphanumeric attribute?}
    SVC_ATTR -->|No| SVC_ATTR_ERR2["printBusinessErrorLog: EKKB0080TE - Invalid attribute"]
    SVC_ATTR_ERR2 --> SVC_ATTR_RETURN2["Return false"]
    SVC_ATTR -->|Yes| GET_KOJI["Get KOJI_ANK_NO from rsMap"]

    GET_KOJI --> KOJI_NULL{KOJI_ANK_NO is null or blank?}
    KOJI_NULL -->|Yes| KOJI_ERR["printBusinessErrorLog: EKKB0060TE - Required field missing"]
    KOJI_ERR --> KOJI_RETURN["Return false"]
    KOJI_NULL -->|No| KOJI_LEN{Length 2-10 and alphanumeric?}
    KOJI_LEN -->|No| KOJI_ATTR_ERR["printBusinessErrorLog: EKKB0070TE - Invalid length"]
    KOJI_ATTR_ERR --> KOJI_ATTR_RETURN["Return false"]
    KOJI_LEN -->|Yes| KOJI_ATTR{Alphanumeric attribute?}
    KOJI_ATTR -->|No| KOJI_ATTR_ERR2["printBusinessErrorLog: EKKB0080TE - Invalid attribute"]
    KOJI_ATTR_ERR2 --> KOJI_ATTR_RETURN2["Return false"]
    KOJI_ATTR -->|Yes| GET_MSKM["Get MSKM_NO from rsMap"]

    GET_MSKM --> MSKM_NULL{MSKM_NO is null or blank?}
    MSKM_NULL -->|Yes| MSKM_ERR["printBusinessErrorLog: EKKB0060TE - Required field missing"]
    MSKM_ERR --> MSKM_RETURN["Return false"]
    MSKM_NULL -->|No| MSKM_LEN{Length 2-12 and alphanumeric?}
    MSKM_LEN -->|No| MSKM_ATTR_ERR["printBusinessErrorLog: EKKB0070TE - Invalid length"]
    MSKM_ATTR_ERR --> MSKM_ATTR_RETURN["Return false"]
    MSKM_LEN -->|Yes| MSKM_ATTR{Alphanumeric attribute?}
    MSKM_ATTR -->|No| MSKM_ATTR_ERR2["printBusinessErrorLog: EKKB0080TE - Invalid attribute"]
    MSKM_ATTR_ERR2 --> MSKM_ATTR_RETURN2["Return false"]
    MSKM_ATTR -->|Yes| GET_DATE["Get KOJIAK_JSSI_YMD from rsMap"]

    GET_DATE --> DATE_NULL{KOJIAK_JSSI_YMD is null or blank?}
    DATE_NULL -->|Yes| DATE_ERR["printBusinessErrorLog: EKKB0060TE - Required field missing"]
    DATE_ERR --> DATE_RETURN["Return false"]
    DATE_NULL -->|No| DATE_LEN{Length 2-8 and alphanumeric?}
    DATE_LEN -->|No| DATE_ATTR_ERR["printBusinessErrorLog: EKKB0070TE - Invalid length"]
    DATE_ATTR_ERR --> DATE_ATTR_RETURN["Return false"]
    DATE_LEN -->|Yes| DATE_ATTR{Alphanumeric attribute?}
    DATE_ATTR -->|No| DATE_ATTR_ERR2["printBusinessErrorLog: EKKB0080TE - Invalid attribute"]
    DATE_ATTR_ERR2 --> DATE_ATTR_RETURN2["Return false"]
    DATE_ATTR -->|Yes| SUCCESS["Return true - All checks passed"]
    SVC_RETURN --> END(["End"])
    SVC_ATTR_RETURN --> END
    SVC_ATTR_RETURN2 --> END
    KOJI_RETURN --> END
    KOJI_ATTR_RETURN --> END
    KOJI_ATTR_RETURN2 --> END
    MSKM_RETURN --> END
    MSKM_ATTR_RETURN --> END
    MSKM_ATTR_RETURN2 --> END
    DATE_RETURN --> END
    DATE_ATTR_RETURN --> END
    DATE_ATTR_RETURN2 --> END
    SUCCESS --> END
```

**Processing Summary:** The method validates four fields in sequential order. Each field undergoes three checks: (1) **mandatory check** — the field must not be null or empty; (2) **length check** — the field length must fall within a specific range using `JBSbatCheckUtil.invoke()` with the `ketasuu2` validator; (3) **attribute check** — the field content must match the `hannkakuesuuji1` pattern (alphanumeric characters only). On any failure, an error log is emitted via `commonItem.getLogPrint().printBusinessErrorLog()` with a specific error code and the display name from `itemvalueMap`, then the method returns `false` immediately.

| Field | Mandatory | Length | Attribute |
|-------|-----------|--------|-----------|
| SVC_KEI_NO (Service Contract Number) | Yes | 0–10 characters | hannkakuesuuji1 |
| KOJI_ANK_NO (Construction Project Number) | Yes | 0–10 characters | hannkakuesuuji1 |
| MSKM_NO (Application Number) | Yes | 0–12 characters | hannkakuesuuji1 |
| KOJIAK_JSSI_YMD (Construction Implementation Date) | Yes | 0–8 characters | hannkakuesuuji1 |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `rsMap` | `HashMap` | Input data map (from TXT file or DB) containing key-value pairs for the address-change-withdrawal-construction-completion record. Keys map to field names like `SVC_KEI_NO`, `KOJI_ANK_NO`, `MSKM_NO`, `KOJIAK_JSSI_YMD`. Each value is a String representing the raw field value. |
| 2 | `itemvalueMap` | `HashMap` | Map holding display-name strings for error messages. Keys follow the pattern `TXT-KKIFM629-INF1.<FIELD_NAME>` and provide human-readable labels (e.g., "Address-change-withdrawal-construction-completion data. Service contract number") used when logging business errors. |

**Instance fields accessed:**

| Field | Type | Business Meaning |
|-------|------|-----------------|
| `commonItem` | (Common item holder) | Provides `getLogPrint()` which returns a logger for printing business error logs via `printBusinessErrorLog()` |
| `logPrint` | (Debug log handler) | Provides `printDebugLog()` for debug tracing — called at method entry to log "Enter single item check." |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JACBatCommon.printDebugLog` | JACBatCommon | - | Calls `printDebugLog` in `JACBatCommon` (debug logging utility) |
| - | `JACbatDebugLogUtil.printDebugLog` | JACbatDebugLog | - | Calls `printDebugLog` in `JACbatDebugLogUtil` (debug logging utility) |
| - | `JCKLcsRenkeiUtil.printDebugLog` | JCKLcsRenkei | - | Calls `printDebugLog` in `JCKLcsRenkeiUtil` (debug logging utility) |
| - | `JKKBatOneTimeLogWriter.printBusinessErrorLog` | JKKBatOneTimeLogWriter | - | Calls `printBusinessErrorLog` in `JKKBatOneTimeLogWriter` (business error logging) |
| - | `JKKHttpCommunicator.printBusinessErrorLog` | JKKHttpCommunicator | - | Calls `printBusinessErrorLog` in `JKKHttpCommunicator` (business error logging) |
| - | `JKKHttpCommunicator.printDebugLog` | JKKHttpCommunicator | - | Calls `printDebugLog` in `JKKHttpCommunicator` (debug logging) |
| - | `JBSbatCheckUtil.invoke` | JBSbatCheckUtil | - | Field validation utility — validates field length and character attributes (non-CRUD utility method) |
| - | `commonItem.getLogPrint().printBusinessErrorLog` | CommonLogPrint | - | Logs business-level validation errors with error code and field label. Uses error codes: EKKB0060TE (mandatory missing), EKKB0070TE (invalid length), EKKB0080TE (invalid character attribute). |
| - | `super.logPrint.printDebugLog` | BatchDebugLog | - | Prints debug log message at method entry ("Enter single item check.") |

**Note:** This method performs **no database reads or writes**. It is a pure validation method that reads from the in-memory `rsMap` and writes error messages to the logging system. No SC Code or CBS (CBS = Common Business Service) codes apply — this is a client-side input validation step, not a service-component call.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKAdChgTekkyoKjFinUpd | `JBSbatKKAdChgTekkyoKjFinUpd.execute()` -> `isSingleCheckKKIFM629_INF1(rsMap, itemvalueMap)` | `printBusinessErrorLog` [Logging] EKKB0060TE / EKKB0070TE / EKKB0080TE |

**Call chain detail:**
- The `execute()` method of `JBSbatKKAdChgTekkyoKjFinUpd` (the batch job orchestrator for address-change-withdrawal-construction-completion data) calls `isSingleCheckKKIFM629_INF1()` to validate input data before further processing.
- If validation fails, `execute()` receives `false` and handles the error (likely skipping the record or terminating the batch iteration for that record).
- No screen/batch entry points were found within 8 hops of the call graph. This method is exclusively called internally by its parent class's execute method.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize local variable (L327)

> Debug log entry and local variable initialization.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `super.logPrint.printDebugLog("Enter single item check.")` // Debug trace at method entry |
| 2 | SET | `strValue = null` // Local buffer for field value extraction |

---

**Block 2** — [IF/ELSE-IF sequence] Service Contract Number (SVC_KEI_NO) validation (L330–L348)

> Validates the service contract number field: mandatory check, length check (0-10 chars), and character attribute check (alphanumeric only).

**Block 2.1** — [GET] Extract SVC_KEI_NO (L331)

| # | Type | Code |
|---|------|------|
| 1 | SET | `strValue = (String)rsMap.get("SVC_KEI_NO")` // Extract service contract number from input map |

**Block 2.2** — [IF] Mandatory check for SVC_KEI_NO [EKKB0060TE] (L333)

> Checks that the service contract number is not null or empty. `TXT-KKIFM629-INF1.SVC_KEI_NO` resolves to "Address-change-withdrawal-construction-completion data. Service contract number."

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `strValue == null || "".equals(strValue)` // Null or blank check |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0060TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.SVC_KEI_NO")})` // Log mandatory field error |
| 3 | RETURN | `return false` // Short-circuit: error detected |

**Block 2.3** — [IF] Length check for SVC_KEI_NO [EKKB0070TE] (L340)

> Uses `JBSbatCheckUtil.invoke()` with `ketasuu2` validator and range 0-10 characters. `ketasuu2` is a standard check utility that validates character count (digit count) within a range.

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!JBSbatCheckUtil.invoke(strValue, new String[]{"ketasuu2", "0", "10"})` // Length must be 0-10 |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0070TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.SVC_KEI_NO")})` // Log length error |
| 3 | RETURN | `return false` // Short-circuit: error detected |

**Block 2.4** — [IF] Attribute check for SVC_KEI_NO [EKKB0080TE] (L346)

> Uses `JBSbatCheckUtil.invoke()` with `hannkakuesuuji1` validator — alphanumeric character validation.

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!JBSbatCheckUtil.invoke(strValue, new String[]{"hannkakuesuuji1"})` // Must be alphanumeric |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0080TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.SVC_KEI_NO")})` // Log attribute error |
| 3 | RETURN | `return false` // Short-circuit: error detected |

---

**Block 3** — [IF/ELSE-IF sequence] Construction Project Number (KOJI_ANK_NO) validation (L352–L370)

> Validates the construction project number field: mandatory check, length check (0-10 chars), and character attribute check (alphanumeric only). Pattern mirrors Block 2.

**Block 3.1** — [GET] Extract KOJI_ANK_NO (L353)

| # | Type | Code |
|---|------|------|
| 1 | SET | `strValue = (String)rsMap.get("KOJI_ANK_NO")` // Extract construction project number from input map |

**Block 3.2** — [IF] Mandatory check for KOJI_ANK_NO [EKKB0060TE] (L355)

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `strValue == null || "".equals(strValue)` |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0060TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.KOJI_ANK_NO")})` |
| 3 | RETURN | `return false` |

**Block 3.3** — [IF] Length check for KOJI_ANK_NO [EKKB0070TE] (L362)

> `ketasuu2` validator, range 0-10 (same as Block 2.3).

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!JBSbatCheckUtil.invoke(strValue, new String[]{"ketasuu2", "0", "10"})` |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0070TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.KOJI_ANK_NO")})` |
| 3 | RETURN | `return false` |

**Block 3.4** — [IF] Attribute check for KOJI_ANK_NO [EKKB0080TE] (L368)

> `hannkakuesuuji1` validator (alphanumeric only).

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!JBSbatCheckUtil.invoke(strValue, new String[]{"hannkakuesuuji1"})` |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0080TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.KOJI_ANK_NO")})` |
| 3 | RETURN | `return false` |

---

**Block 4** — [IF/ELSE-IF sequence] Application Number (MSKM_NO) validation (L374–L392)

> Validates the application number field: mandatory check, length check (0-12 chars — wider range than previous fields), and character attribute check (alphanumeric only).

**Block 4.1** — [GET] Extract MSKM_NO (L375)

| # | Type | Code |
|---|------|------|
| 1 | SET | `strValue = (String)rsMap.get("MSKM_NO")` // Extract application number from input map |

**Block 4.2** — [IF] Mandatory check for MSKM_NO [EKKB0060TE] (L377)

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `strValue == null || "".equals(strValue)` |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0060TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.MSKM_NO")})` |
| 3 | RETURN | `return false` |

**Block 4.3** — [IF] Length check for MSKM_NO [EKKB0070TE] (L384)

> `ketasuu2` validator, range 0-12 (wider than SVC_KEI_NO and KOJI_ANK_NO — applications may have longer identifiers).

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!JBSbatCheckUtil.invoke(strValue, new String[]{"ketasuu2", "0", "12"})` |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0070TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.MSKM_NO")})` |
| 3 | RETURN | `return false` |

**Block 4.4** — [IF] Attribute check for MSKM_NO [EKKB0080TE] (L390)

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!JBSbatCheckUtil.invoke(strValue, new String[]{"hannkakuesuuji1"})` |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0080TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.MSKM_NO")})` |
| 3 | RETURN | `return false` |

---

**Block 5** — [IF/ELSE-IF sequence] Construction Implementation Date (KOJIAK_JSSI_YMD) validation (L397–L418)

> Validates the construction implementation date field: mandatory check, length check (0-8 chars for YYYYMMDD format), and character attribute check (alphanumeric only). This block was added under change request OM-2014-0003696 (ADD START / ADD END markers).

**Block 5.1** — [GET] Extract KOJIAK_JSSI_YMD (L399)

| # | Type | Code |
|---|------|------|
| 1 | SET | `strValue = (String)rsMap.get("KOJIAK_JSSI_YMD")` // Extract construction implementation date from input map |

**Block 5.2** — [IF] Mandatory check for KOJIAK_JSSI_YMD [EKKB0060TE] (L401)

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `strValue == null || "".equals(strValue)` |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0060TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.KOJIAK_JSSI_YMD")})` |
| 3 | RETURN | `return false` |

**Block 5.3** — [IF] Length check for KOJIAK_JSSI_YMD [EKKB0070TE] (L408)

> `ketasuu2` validator, range 0-8 (suitable for YYYYMMDD date format — 8 digits).

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!JBSbatCheckUtil.invoke(strValue, new String[]{"ketasuu2", "0", "8"})` |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0070TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.KOJIAK_JSSI_YMD")})` |
| 3 | RETURN | `return false` |

**Block 5.4** — [IF] Attribute check for KOJIAK_JSSI_YMD [EKKB0080TE] (L414)

| # | Type | Code |
|---|------|------|
| 1 | CONDITION | `!JBSbatCheckUtil.invoke(strValue, new String[]{"hannkakuesuuji1"})` |
| 2 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog("EKKB0080TE", new String[]{(String)itemvalueMap.get("TXT-KKIFM629-INF1.KOJIAK_JSSI_YMD")})` |
| 3 | RETURN | `return false` |

---

**Block 6** — [RETURN] Success path (L420)

> All four fields passed all three validation checks. No errors logged.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // All validation passed — no errors |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SVC_KEI_NO` | Field | Service Contract Number — unique identifier for a service contract line item in the NTT East billing and provisioning system |
| `KOJI_ANK_NO` | Field | Construction Project Number — internal tracking ID for construction work orders related to service installation or withdrawal |
| `MSKM_NO` | Field | Application Number — unique application/registration number used to identify a customer request or order submission |
| `KOJIAK_JSSI_YMD` | Field | Construction Implementation Date — date (YYYYMMDD format) when the construction work was actually performed |
| `rsMap` | Field | Input data HashMap — carries field values from TXT file input or database query results into the validation method |
| `itemvalueMap` | Field | Error message display map — maps internal field keys to human-readable Japanese labels for error reporting |
| TXT-KKIFM629-INF1 | Domain | Address-Change-Withdrawal-Construction-Completion Data — batch input file/service for recording completion of withdrawal construction work when a customer's address has changed |
| KKIFM629 | Domain | Internal service code for the address-change-withdrawal-construction-completion batch processing module |
| EKKB0060TE | Error Code | Mandatory field missing — the required field is null or empty |
| EKKB0070TE | Error Code | Invalid length — the field value length is outside the allowed range |
| EKKB0080TE | Error Code | Invalid attribute — the field value contains characters not allowed by the validation pattern |
| `ketasuu2` | Validator | Character-count validator — validates that the input string length falls within a specified min-max range |
| `hannkakuesuuji1` | Validator | Alphanumeric character validator — validates that the input contains only letters and digits (no special characters or spaces) |
| JBSbatCheckUtil | Component | Batch validation utility class — provides standard field-level validators (length, character type, format) used across batch service classes |
| logPrint | Component | Debug log handler — inherited from parent class, used to trace method entry and execution flow |
| commonItem | Component | Common item holder — provides access to shared logging, error handling, and utility infrastructure |
| printBusinessErrorLog | Method | Business error logging — writes structured error records with error code and context (field name, value) for downstream error reporting and retry |
| printDebugLog | Method | Debug tracing — writes informational log entries for method execution tracking |
| Return `true` | Logic | No errors found — the input data passed all validation rules |
| Return `false` | Logic | Error found — at least one validation rule failed, an error was logged, and the caller should handle the failure |
