# Business Logic — JKKGlobalIpAddCfmCC.initSetUp() [21 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKGlobalIpAddCfmCC` |
| Layer | CC/Common Component (Controller layer — extends `AbstractCommonComponent`) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKGlobalIpAddCfmCC.initSetUp()

This method performs the initial setup phase for the Global IP Addition Confirmation business component. The `JKKGlobalIpAddCfmCC` class is responsible for registering multi-session contracts that include a fixed (static) IP address assignment — a service feature where a customer is allocated a dedicated, unchanging IP address for their internet connection. The `initSetUp` method serves as a shared utility preparation routine that initializes all core instance state required by the `execute()` method of this component before the main business logic begins. Specifically, it (1) retrieves the current operation date from the common business date service (`JCCBPCommon.getOpeDate`), (2) constructs the data-mapper object (`JKKGlobalIpAddCfmCCMapper`) which handles the translation between request parameters and the internal entity model, (3) extracts the user-data payload from the request parameter map using the `fixedText` key, and (4) allocates an independent work area (`ccWorkMap`) used later for processing discount cancellation (割引解約) new component creation. The method follows a sequential delegation pattern with no conditional branches — it unconditionally prepares all state in a deterministic order. It plays the role of a setup/hook method within the broader execute-check pattern common to Fujitsu's X21 BPM framework, where `initSetUp()` is invoked early in the component's execution lifecycle to prime all instance fields.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initSetUp handle param fixedText"])
    STEP1["Log: initSetUp start"]
    STEP2["opeDate = JCCBPCommon.getOpeDate"]
    STEP3["mapper = new JKKGlobalIpAddCfmCCMapper"]
    STEP4["inMap = param.getData fixedText"]
    STEP5["Log: fixedText value"]
    STEP6["ccWorkMap = new HashMap"]
    STEP7["Log: initSetUp end"]
    END_NODE(["Return"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> STEP5
    STEP5 --> STEP6
    STEP6 --> STEP7
    STEP7 --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | The X21 BPM session handle that carries the database transaction context and security credentials. It provides the SQL execution environment used by the mapper and all downstream service calls. |
| 2 | `param` | `IRequestParameterReadWrite` | The request parameter object that holds all user input and screen-transmitted data for this operation. It contains the user-data map (retrieved via `getData(fixedText)`) which carries the global IP addition request fields such as service contract number, key system ID, fixed IP address, and netmask. |
| 3 | `fixedText` | `String` | A service message string that serves as the map key to retrieve the user-data payload from `param`. In this codebase convention, `fixedText` is the standardized request parameter key that identifies the section of the parameter map containing the screen-submitted form data for the Global IP Addition Confirmation screen. |

**Instance fields read/written by this method:**

| Field | Access | Business Description |
|-------|--------|---------------------|
| `this.mapper` (`JKKGlobalIpAddCfmCCMapper`) | Write | The data-mapper instance that mediates between request parameters and the internal entity model for Global IP addition confirmation. Created here with the session handle, request parameter, and operation date. |
| `this.inMap` (`HashMap<String, Object>`) | Write | The user-data information map — a key-value store containing all form fields submitted by the user on the Global IP Addition Confirmation screen (e.g., service contract number, fixed IP address, netmask, subscription effective date). |
| `this.ccWorkMap` (`Map<String, Object>`) | Write | A work area map for discount cancellation (割引解約) new component processing. Created fresh and empty here; later populated during the execute phase with temporary data needed for handling discount-related logic. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBPCommon.getOpeDate` | - | - | Retrieves the current operation date (business date) for use in mapper construction. A read-only date lookup service. |
| - | `JKKGlobalIpAddCfmCCMapper.<constructor>` | - | - | Constructs the mapper with session handle, request parameters, and operation date. Sets up data translation mappings for the Global IP addition confirmation business object. |
| R | `param.getData(fixedText)` | - | - | Retrieves the user-data map from the request parameter, keyed by `fixedText`. Reads form-submitted field values for global IP addition confirmation. |
| - | `JKKGlobalIpAddCfmCC.printlnEjbLog` | - | - | Logs method lifecycle events (start, fixedText value, end) to the EJB log (`JSYejbLog`). Diagnostic logging, no data mutation. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JCKSearchKyokyuChtnTokutNoCC` (CBS) | `execute()` -> `initSetUp()` | `printlnEjbLog [-]`, `getOpeDate [R]`, `param.getData [R]` |
| 2 | `JKKGlobalIpAddCfmCC` (CC) | `execute()` -> `initSetUp()` | `printlnEjbLog [-]`, `getOpeDate [R]`, `param.getData [R]` |

**Call chain detail:**
- **JCKSearchKyokyuChtnTokutNoCC.execute()** — A CBS (Business Component Service) for searching billing charge special items. It calls `initSetUp()` to prepare the mapper and data maps before performing its search logic.
- **JKKGlobalIpAddCfmCC.execute()** — The main business logic method of this same class. It calls `initSetUp()` as its first step to initialize the mapper, user-data map, and work area before proceeding with the global IP addition confirmation registration flow.

## 6. Per-Branch Detail Blocks

The `initSetUp` method contains no conditional branches, switch/case, or loops. It executes as a single linear sequence of 7 operations.

---

**Block 1** — LINEAR_SEQUENCE `(no branching)` (L248-L258)

> The entire method body executes as a single linear flow with no if/else, switch, or loop constructs. Each statement prepares state for downstream processing in the main `execute()` method.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `printlnEjbLog("initSetUp start")` | Logs the start of the initialization routine for traceability in EJB logs. |
| 2 | CALL | `opeDate = JCCBPCommon.getOpeDate(null)` | Retrieves the current business operation date. The `null` argument indicates no specific site/locale constraint. This date is used by the mapper to timestamp records. |
| 3 | SET | `this.mapper = new JKKGlobalIpAddCfmCCMapper(handle, param, opeDate)` | Creates the data mapper instance that mediates between the request parameter object and the internal entity model. The mapper uses the session handle for DB access, the request parameter for form data, and the operation date for timestamps. |
| 4 | SET | `this.inMap = (HashMap<String, Object>) param.getData(fixedText)` | Extracts the user-data map from the request parameter keyed by `fixedText`. This map contains all form fields submitted by the user on the Global IP Addition Confirmation screen, including service contract number, fixed IP address, netmask, and related fields. The raw `Map` is cast to `HashMap<String, Object>` for type-safe access. |
| 5 | EXEC | `printlnEjbLog("fixedText=" + fixedText)` | Logs the value of `fixedText` for debugging and traceability. |
| 6 | SET | `this.ccWorkMap = new HashMap()` | Allocates a fresh, empty work area map for discount cancellation (割引解約) new component creation. This work map will be populated during the main `execute()` phase with temporary data needed for handling discount-related logic. |
| 7 | EXEC | `printlnEjbLog("initSetUp end")` | Logs the completion of the initialization routine. |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| Global IP Addition | Business term | A telecom service where a fixed (static) IP address is assigned to an existing customer internet connection, enabling them to host servers, use VPN, or access services from outside their network. |
| `fixedText` | Field | A service message string that serves as the request parameter map key. In this codebase convention, it identifies the section of the parameter map containing screen-submitted form data. |
| `opeDate` | Field | Operation date — the current business date used for record timestamps and business logic. Retrieved from `JCCBPCommon.getOpeDate()`. |
| `inMap` | Field | User-data information map — a key-value store containing all form fields submitted by the user (e.g., service contract number, fixed IP address, netmask). |
| `ccWorkMap` | Field | CC work area map — a temporary workspace for discount cancellation (割引解約) new component creation during the execute phase. |
| `JKKGlobalIpAddCfmCC` | Class | Global IP Addition Confirmation Common Component — the business component that handles the registration workflow for assigning fixed IP addresses to customer connections. |
| `JKKGlobalIpAddCfmCCMapper` | Class | The data-mapper class that translates between request parameters and the internal entity model for Global IP addition confirmation. |
| `JCCBPCommon` | Class | Common business utility class that provides shared services such as operation date retrieval. |
| `SessionHandle` | Class | X21 BPM framework session handle — carries the database transaction context and security credentials for the current operation. |
| `IRequestParameterReadWrite` | Interface | X21 BPM interface for reading and writing request parameters submitted by screens. Used to pass form data between the presentation layer and business components. |
| AbstractCommonComponent | Class | Base class for all X21 CC (Common Component) classes, providing shared infrastructure for logging, exception handling, and lifecycle management. |
| 割引解約 (waribiki kaiyaku) | Japanese term | Discount cancellation — a business process for handling the cancellation of discounted service plans and associated components. The `ccWorkMap` is reserved for temporary data needed during this sub-process. |
| X21 BPM | Technical term | Fujitsu's business process management framework used to build Java EE application components. Provides lifecycle management, parameter handling, exception handling, and logging infrastructure. |
