# Business Logic — JKKIdoRsvHaneiCC.init() [12 LOC]

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

## 1. Role

### JKKIdoRsvHaneiCC.init()

This method performs the **initialization routine for the transfer reservation reflection processing** (異動予約反映の初期処理) in the K-Opticom customer base system (eo customer primary system). It is the entry point that prepares the runtime state before any substantive transfer reservation business logic is executed. Specifically, it ensures the mapper dependency (`JKKIdoRsvHaneiMapperCC`) is instantiated on first use, implementing a lazy-initialization pattern for the mapper group used in service interface calls. It also initializes the error information collection structure within the control map of the request parameter, creating an empty `ArrayList<Object>` that will accumulate error details during subsequent processing. This method plays the role of a shared initialization utility within the `JKKIdoRsvHaneiCC` class, which handles transfer (change of service) reservation reflection operations — essentially reflecting transfer reservation data back into the system after a service change has been processed. It is called internally by `executeIdoRsvHanei()` and `getInvokeCBS()` within the same class, forming the preparatory step for each invocation path.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["init(param, fixedText)"])
    CHECK_MAPPER["Check if this.mapper is null"]
    INIT_MAPPER["this.mapper = new JKKIdoRsvHaneiMapperCC()"]
    CLEAR_ERROR["param.setControlMapData(ERROR_INFO, new ArrayList<Object>())"]
    END_NODE(["Return / Next"])

    START --> CHECK_MAPPER
    CHECK_MAPPER -->|null| INIT_MAPPER
    CHECK_MAPPER -->|not null| CLEAR_ERROR
    INIT_MAPPER --> CLEAR_ERROR
    CLEAR_ERROR --> END_NODE
```

**CRITICAL — Constant Resolution:**
- `ERROR_INFO` references `SCControlMapKeys.ERROR_INFO` — a control map key constant defined in the `SCControlMapKeys` class (part of the Fujitsu Futurity X21 framework, package `com.fujitsu.futurity.common.x01.sc`). This key identifies the error information storage slot in the control map, used by the X21 BPM framework's error handling infrastructure.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The model group and control map containing parameter object. This is the X21 BPM framework's request parameter interface that carries the entire request context including model data, control flags, and error collection structures. It is mutated by this method to inject the initialized error list into its control map. |
| 2 | `fixedText` | `String` | User-specified arbitrary string (ユーザ任意文字列). Passed as a parameter but not referenced within this method body — it is available for downstream methods to use as a contextual marker or log annotation during transfer reservation reflection processing. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `mapper` | `JKKIdoRsvHaneiMapperCC` | The mapper group for service interface calls in the transfer reservation reflection CC class. Lazily initialized if null. |

## 4. CRUD Operations / Called Services

This method does not perform any database CRUD operations. It is purely a **setup/initialization** method with no service component (SC) or business component (CBS) calls.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | — | — | — | No database or service calls in this method. Only local object initialization and control map setup. |

**Called methods analysis:**

| Method Call | Classification | Notes |
|-------------|---------------|-------|
| `this.mapper = new JKKIdoRsvHaneiMapperCC()` | Object instantiation | Creates the mapper group instance for SC/CBS delegation. The mapper class contains the mapping methods that will be called in subsequent processing stages. |
| `param.setControlMapData(SCControlMapKeys.ERROR_INFO, new ArrayList<Object>())` | Control map setup | Initializes the error information container in the request parameter's control map. This is a framework-level setup for the X21 BPM error handling mechanism, not a CRUD operation. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | JKKIdoRsvHaneiCC | `executeIdoRsvHanei()` -> `init()` | (no terminal CRUD — this method only initializes state) |
| 2 | JKKIdoRsvHaneiCC | `getInvokeCBS()` -> `init()` | (no terminal CRUD — this method only initializes state) |

**Notes:**
- Both callers are methods within the same `JKKIdoRsvHaneiCC` class.
- `executeIdoRsvHanei()` — The main transfer reservation reflection execution method. This is the primary call site where `init()` prepares the state before executing the actual reflection logic.
- `getInvokeCBS()` — A method that retrieves invoked CBS (Common Business Service) results. Calls `init()` to ensure the mapper and error map are ready before CBS invocation.
- This method has no terminal CRUD operations of its own; it only sets up infrastructure for downstream processing.

## 6. Per-Branch Detail Blocks

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

> Mapper lazy initialization: If the mapper group has not yet been instantiated (first call), create a new `JKKIdoRsvHaneiMapperCC` instance. This ensures the mapper dependency is available for subsequent service interface calls in the transfer reservation reflection workflow.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `this.mapper = new JKKIdoRsvHaneiMapperCC()` | [-> LAZY INIT] Instantiate the mapper group for service interface calls. This mapper class (`JKKIdoRsvHaneiMapperCC`) provides the mapping methods that delegate to SC/CBS for transfer reservation data handling. |

**Block 2** — [EXEC] `(unconditional)` (L55)

> Control map error container initialization: Clear any existing error information in the control map and set up a fresh empty list for collecting errors during transfer reservation reflection processing.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, new ArrayList<Object>())` | [-> ERROR_INFO key] Initialize the error information storage in the request parameter's control map. Creates a new empty `ArrayList<Object>` that will hold `CAANMsg` objects accumulated during error conditions in subsequent processing. The `SCControlMapKeys.ERROR_INFO` constant is the framework-defined key for the error data slot. |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `JKKIdoRsvHaneiCC` | Class | Transfer Reservation Reflection Common Component — the class handling business logic for reflecting transfer (service change) reservations in the K-Opticom system. "JKK" = Fujitsu/K-Opticom prefix, "Ido" (異動) = transfer/change, "Rsv" (予約) = reservation, "Hanei" (反映) = reflection/registration. |
| `JKKIdoRsvHaneiMapperCC` | Class | Mapper group for transfer reservation reflection — contains methods that map to SC/CBS service interface calls. Lazily instantiated by `init()`. |
| `AbstractCommonComponent` | Class | Base class from the X21 BPM framework that common components extend. Provides shared infrastructure for BPM-based business component development. |
| `IRequestParameterReadWrite` | Interface | X21 BPM framework interface for the request parameter object that carries model data, control flags, and the control map throughout the request lifecycle. |
| `SCControlMapKeys` | Class | Framework constant class defining keys used in the control map (e.g., `ERROR_INFO`). Located in package `com.fujitsu.futurity.common.x01.sc`. |
| `ERROR_INFO` | Constant | Control map key constant identifying the error information storage slot. Used to store and retrieve `List<Object>` (typically `List<CAANMsg>`) for error handling across processing stages. |
| `CAANMsg` | Class | Fujitsu Futurity framework message class for application error/notification messages. Error objects accumulated in the error list are instances of this class. |
| `param` | Field | Request parameter object carrying the entire request context including model group data, control map, and session information. |
| `fixedText` | Field | User-specified arbitrary string passed through processing for contextual logging or annotation purposes. |
| `mapper` | Field | Instance of `JKKIdoRsvHaneiMapperCC` — the mapper group used for delegating to SC/CBS service interface calls in transfer reservation reflection processing. |
| `init()` | Method | Initialization routine that sets up the mapper instance and error information container before substantive business processing. |
| eo customer base system | System | The K-Opticom customer primary system (eo顧客基幹システム) — Fujitsu's telecommunications customer management platform for managing subscriber services, orders, and service changes. |
| 異動予約反映 (Ido Yoyaku Hanei) | Business term | Transfer reservation reflection — the business operation of reflecting recorded transfer (service change) reservations back into the system after a service change has been processed. |
