# Business Logic — JKKPauseReceptCC.init() [24 LOC]

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

## 1. Role

### JKKPauseReceptCC.init()

This method performs the **initialization routine** for the "Pause Reception" (休止受付 — service suspension acceptance) feature, which is part of K-Opticom's customer base system for managing service contract suspensions and terminations. It prepares the component's internal state before any actual pause reception processing begins, acting as a **shared bootstrap** called by both `getInvokeCBS()` and `pauseReceptuCtrlTran()` within the same class. The method implements a **lazy-initialization pattern** for its mapper and service call invoker fields, ensuring they are instantiated on first use. It also sets up the control map's error-handling infrastructure by initializing an empty error info list, and determines whether the current session operates in a special "check mode" by inspecting a function code from the request parameter data. This check mode flag is later used throughout the pause reception workflow to enable additional validation or simulation behavior. The method also corresponds to the "Lock 2 addition" effort case for PT障害 (PT impairment) from eo Hikaridenwa (eo optical phone) requests, added on 2012-09-21.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["init(param, fixedText)"])
    
    START --> CHECK_MAPPER{"mapper is null?"}
    CHECK_MAPPER -->|true| CREATE_MAPPER["this.mapper = new JKKPauseReceptMapperCC()"]
    CHECK_MAPPER -->|false| CHECK_SC
    CREATE_MAPPER --> CHECK_SC{"scCall is null?"}
    
    CHECK_SC -->|true| CREATE_SC["this.scCall = new ServiceComponentRequestInvoker()"]
    CHECK_SC -->|false| INIT_CONTROL_MAP
    CREATE_SC --> INIT_CONTROL_MAP["param.setControlMapData(ERROR_INFO, new ArrayList<Object>())"]
    
    INIT_CONTROL_MAP --> GET_MAP["kksv020301ccMap = param.getData(KKSV020301CC)"]
    GET_MAP --> GET_FUNC["func_code = kksv020301ccMap.get(FUNC_CODE_KEY)"]
    GET_FUNC --> CHECK_MODE["isCheckMode = (FUNC_CD_2.equals(func_code))"]
    
    CHECK_MODE --> END_NODE(["Return / Next"])
```

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `SCControlMapKeys.ERROR_INFO` | `"errorInfo"` | Key for storing error information list in the control map [-> ERROR_INFO (SCControlMapKeys.java)] |
| `KKSV0203_KKSV0203OP.KKSV020301CC` | `"KKSV020301CC"` | Key for the Pause Reception CC Map, used to retrieve/handle the pause reception data [-> KKSV020301CC="KKSV020301CC" (KKSV0203_KKSV0203OP.java:55)] |
| `JCMConstants.FUNC_CODE_KEY` | `"funcCode"` | Key for the function code stored in the request parameter map [-> FUNC_CODE_KEY (JCMConstants.java)] |
| `JPCModelConstant.FUNC_CD_2` | `"2"` | Function code value indicating check mode — used for the "Lock 2 addition" effort case [-> FUNC_CD_2="2" (JPCModelConstant.java:32)] |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying the model group and control map for the screen session. It holds the pause reception context data under the key `KKSV020301CC`, and provides methods to read/write data and set control map entries (such as the error info list). |
| 2 | `fixedText` | `String` | User-defined arbitrary string. This parameter is accepted but **not used** within the `init()` method body — it is passed for future extension or forward compatibility with calling contracts that expect it. |

**Instance fields read by this method:**

| Field | Type | Access |
|-------|------|--------|
| `this.mapper` | `JKKPauseReceptMapperCC` | Read for null-check; set via lazy initialization |
| `this.scCall` | `ServiceComponentRequestInvoker` | Read for null-check; set via lazy initialization |
| `this.isCheckMode` | `boolean` | Written with the result of the function code comparison |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatDKNyukaFinAdd.getData` | JBSbatDKNyukaFinAdd | - | Calls `getData` in `JBSbatDKNyukaFinAdd` |
| R | `JFUeoTelOpTransferCC.getData` | JFUeoTelOpTransferCC | - | Calls `getData` in `JFUeoTelOpTransferCC` |
| R | `JFUTransferCC.getData` | JFUTransferCC | - | Calls `getData` in `JFUTransferCC` |
| R | `JFUTransferListToListCC.getData` | JFUTransferListToListCC | - | Calls `getData` in `JFUTransferListToListCC` |
| R | `KKW12701SFLogic.getData` | KKW12701SFLogic | - | Calls `getData` in `KKW12701SFLogic` |

### Direct operations within this method:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| SET | `param.setControlMapData` | - | Control Map | Initializes the error information list (`ERROR_INFO`) in the request parameter's control map. This prepares a fresh `ArrayList` to collect any errors encountered during subsequent pause reception processing. |
| GET | `param.getData` | - | Request Parameter | Retrieves the HashMap stored under the key `KKSV020301CC` from the request parameter, which holds the pause reception context data for the screen. |
| GET | `Map.get` | - | HashMap | Extracts the function code (`func_code`) from the retrieved HashMap using `FUNC_CODE_KEY` to determine the operational mode. |
| SET | `this.mapper` | - | Instance Field | Lazy-initializes the `JKKPauseReceptMapperCC` mapper if it has not yet been created. |
| SET | `this.scCall` | - | Instance Field | Lazy-initializes the `ServiceComponentRequestInvoker` if it has not yet been created. |
| SET | `this.isCheckMode` | - | Instance Field | Sets the check mode flag based on whether the function code equals `FUNC_CD_2` ("2"). |

**CRUD Summary:** This method performs no database or entity operations. It is purely an in-memory initialization routine that configures the component's internal state and prepares the request parameter's control map for downstream processing.

## 5. Dependency Trace

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `setControlMapData` [SET], `getData` [GET], `get` [GET], `isCheckMode` [SET].

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKPauseReceptCC.getInvokeCBS()` | `getInvokeCBS()` -> `init(param, fixedText)` | `setControlMapData [SET]`, `getData [GET]` |
| 2 | CBS: `JKKPauseReceptCC.pauseReceptuCtrlTran()` | `pauseReceptuCtrlTran()` -> `init(param, fixedText)` | `setControlMapData [SET]`, `getData [GET]` |

The `JKKPauseReceptCC` class is a Common Component (CC) with no direct screen entry points. Both callers are other methods within the same class, meaning this method is a **private bootstrap helper** invoked at the start of different entry-point paths into the pause reception workflow.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(null == this.mapper)` (L125)

> Lazy-initialization of the mapper. The mapper (`JKKPauseReceptMapperCC`) is responsible for mapping data between the request parameters and the internal data structures used by the pause reception processing. If this is the first invocation, the mapper is instantiated; otherwise, the existing instance is retained.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.mapper = new JKKPauseReceptMapperCC()` // Instantiate mapper on first call [-> new JKKPauseReceptMapperCC()] |

**Block 2** — [IF] `(null == this.scCall)` (L131)

> Lazy-initialization of the service call invoker. The `ServiceComponentRequestInvoker` (`scCall`) is the mechanism used to invoke downstream Service Component (SC) and Business Logic Component (CBS) methods. It is created on first use so that the pause reception CC can call SC/CBS methods (e.g., data retrieval, validation, registration) as needed during processing. If the invoker is already instantiated, this block is skipped.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.scCall = new ServiceComponentRequestInvoker()` // Instantiate service call invoker on first call [-> new ServiceComponentRequestInvoker()] |

**Block 3** — [EXEC] (L134)

> Initializes the error information list in the control map. This creates a fresh, empty `ArrayList<Object>` and stores it under the `ERROR_INFO` key (`[-> SCControlMapKeys.ERROR_INFO]`). Downstream processing code will append error objects to this list when validation or business rule checks fail during pause reception. This ensures the error list exists even before any errors have occurred.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, new ArrayList<Object>())` // Prepare empty error info list [-> ERROR_INFO] |

**Block 4** — [IF] `(null == this.mapper)` — Nested Branch: mapper null check (L125)

> This block is the alternative path (else) of Block 1. If `this.mapper` is **not** null (i.e., the mapper was already initialized in a previous call), the method simply passes through without re-initializing.

| # | Type | Code |
|---|------|------|
| 1 | SKIP | mapper already initialized — no action taken |

**Block 5** — [IF] `(null == this.scCall)` — Nested Branch: scCall null check (L131)

> This block is the alternative path (else) of Block 2. If `this.scCall` is **not** null (i.e., the service call invoker was already initialized), the method passes through without creating a new instance.

| # | Type | Code |
|---|------|------|
| 1 | SKIP | scCall already initialized — no action taken |

**Block 6** — [ASSIGNMENT + IF-THEN] (L139-140)

> **Lock 2 addition effort case for PT障害 (PT impairment) from eo Hikaridenwa (eo optical phone) requests** — added 2012-09-21. This block retrieves the function code from the request parameter's HashMap (stored under key `KKSV020301CC`) and compares it against `FUNC_CD_2` ("2"). If the function code matches, the `isCheckMode` flag is set to `true`, enabling a check mode that presumably allows additional validation or simulation behavior during pause reception processing. This was added as part of the "Lock 2 addition" effort to support PT impairment scenarios from eo optical phone channels.

| # | Type | Code |
|---|------|------|
| 1 | GET | `HashMap kksv020301ccMap = (HashMap) param.getData(KKSV0203_KKSV0203OP.KKSV020301CC)` // Retrieve Pause Reception CC Map [-> KKSV020301CC="KKSV020301CC" (KKSV0203_KKSV0203OP.java:55)] |
| 2 | GET | `String func_code = (String) kksv020301ccMap.get(JCMConstants.FUNC_CODE_KEY)` // Extract function code [-> FUNC_CODE_KEY (JCMConstants.java)] |
| 3 | SET | `isCheckMode = (JPCModelConstant.FUNC_CD_2.equals(func_code))` // Check mode flag: true if func_code == "2" [-> FUNC_CD_2="2" (JPCModelConstant.java:32)] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| 休止受付 (Shūshi Uketuke) | Business term | Pause Reception — the process of accepting and processing a customer's request to suspend (pause) their active service contract without terminating it |
| JKKPauseReceptCC | Class | Pause Reception Common Component — the central component class for the service suspension acceptance feature |
| JKKPauseReceptMapperCC | Class | Pause Reception Mapper Component — handles data mapping between request parameters and internal structures for pause reception |
| ServiceComponentRequestInvoker | Class | SC Call Invoker — the framework component used to invoke downstream Service Component (SC) and Business Logic Component (CBS) methods |
| KKSV020301CC | Constant | Pause Reception CC Map key — the key under which the pause reception context HashMap is stored in the request parameter |
| KKSV0203_KKSV0203OP | Constant class | KKSV0203 Screen operation constants — defines operation keys for the Service Contract Update / Pause Reception screen |
| ERROR_INFO | Constant | Control map error information key — used to store a list of error objects during screen processing |
| FUNC_CD_2 | Constant | Function code "2" — indicates check mode, used for the "Lock 2 addition" effort case for PT impairment from eo optical phone |
| isCheckMode | Field | Check mode flag — when true, the system enters a special validation/simulation mode for pause reception processing |
| REQUEST_PARAMETER | Technical term | IRequestParameterReadWrite — the request/response parameter object that carries data between screen, controller, and common component layers |
| Control Map | Technical term | A per-session map stored within the request parameter that holds screen-level data such as error lists, selection states, and control flags |
| SC (Service Component) | Technical term | Service Component — a layer component that handles specific business logic operations, typically invoked via SC codes like `EKKxxxxSC` |
| CBS (Business Support Component) | Technical term | Business Support Component — a layer component containing business logic that is invoked for data processing and validation |
| eo Hikaridenwa | Business term | eo Hikaridenwa — K-Opticom's fiber-optic telecommunications service brand (eo Optical Phone) |
| PT障害 (PT Shōgai) | Business term | PT (Provisioning Task) impairment — a scenario where service provisioning encounters an error or abnormal condition, requiring special handling |
| Lock 2 追加対応 (Lock 2 Tuka Taiou) | Business term | Lock 2 addition effort — a development initiative to add supplementary lock/check mechanisms to the pause reception process |
