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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKGlobalIpAddCfmCC` |
| Layer | CC / Common Component (Shared service component within the EJB tier) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKGlobalIpAddCfmCC.execute()

This method registers a **Global (Fixed) IP Address** as part of a telecom service contract lifecycle within the K-Opticom eo customer base system. It serves as the primary entry point for the Global IP Address confirmation/registration business component (CC), invoked by the BPM operation flow of Screen KKSV0023 (Service Contract Confirmation Meeting). The method implements a **delegation pattern**: it first initializes the environment (mapper instantiation, work map setup), then validates the input data, and finally delegates the core business logic to a `main` method. A key design feature is a **function-code conditional branch**: when the function code (`func_cd`) is set to `"2"`, the method skips all registration processing and simply returns the input parameters — effectively acting in a **check-only (read) mode**. Otherwise, for function code `"1"`, it proceeds with full registration processing. This dual-mode behavior allows the same component to support both inquiry and CRUD operations, following a shared utility pattern consumed by multiple screens.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute start"])
    CHECK_START(["printlnEjbLog: execute start"])
    INIT["initSetUp: initialize mapper and work maps"]
    CHK_MAP["chkInMap: validate and extract input parameters"]
    FUNC_CHECK{FUNC_CD check}
    SKIP_MAIN["return param: check-only mode"]
    MAIN["main: execute global IP address registration"]
    LOG_END["printlnEjbLog: execute end"]
    RETURN["return param"]
    END(["execute end"])

    START --> CHECK_START --> INIT --> CHK_MAP --> FUNC_CHECK
    FUNC_CHECK -- "FUNC_CD equals 2" --> SKIP_MAIN --> RETURN
    FUNC_CHECK -- "FUNC_CD equals 1" --> MAIN --> LOG_END --> END
```

**Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|------------------|
| `FUNC_CD_1` (field) | `"1"` | Registration mode — perform full IP address registration |
| `FUNC_CD_2` (field) | `"2"` | Check-only mode — validate inputs without performing registration |
| `KEY_FUNC_CD` | `"func_cd"` | Map key for the function code field |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle — manages the database connection context and transaction boundary for this business operation. Carries the operator date and system session metadata. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter container — carries all input data for the IP address registration operation, including service contract numbers, ISP authentication IDs, fixed IP addresses, and work map data. Acts as the data transport object between the BPM framework and the CC layer. |
| 3 | `fixedText` | `String` | Service message key — an identifier used to retrieve the appropriate data section from `param.getData()`. It serves as the key to extract the specific business data map (e.g., `"KKSV002301CC"`). |

**Instance Fields / External State:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `mapper` | `JKKGlobalIpAddCfmCCMapper` | Data mapping object — instantiated during `initSetUp` to handle SC/CBS calls and data transformation between entity objects and business maps. |
| `inMap` | `HashMap<String, Object>` | Input data map — extracted from `param.getData(fixedText)`, contains all raw input fields for the IP address registration. |
| `ccWorkMap` | `HashMap<String, Object>` | Working area map — populated with validated parameters by `chkInMap`, used throughout `main()` for data passing between processing steps. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKGlobalIpAddCfmCC.chkInMap` | JKKGlobalIpAddCfmCC | - | Validates input parameters and copies them from `inMap` to `ccWorkMap` |
| - | `JKKGlobalIpAddCfmCC.initSetUp` | JKKGlobalIpAddCfmCC | - | Initializes mapper instance, extracts work data from `param`, creates `ccWorkMap` |
| - | `JKKGlobalIpAddCfmCC.main` | JKKGlobalIpAddCfmCC | - | Core registration logic — delegates all SC/CBS calls for IP address registration |
| - | `JKKGlobalIpAddCfmCC.printlnEjbLog` | JKKGlobalIpAddCfmCC | - | EJB logging utility — writes debug log messages |

The actual CRUD operations are performed within `main()`, which calls:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0081A010` | EKK0081A010SC | `KK_T_OPSVKEI_ISP` | Reads service contract information (ISP agreement) by service contract number |
| R | `callEKK0081A010` (second call) | EKK0081A010SC | `KK_T_OPSVKEI_ISP` | Reads last update date/time for service contract (nested within EKK0361D010 call) |
| R | `callEKK0011D020` | EKK0011D020SC | `KK_T_ODR_HAKKO_JOKEN` | Reads order release conditions (detail list) for service contract |
| R | `callEKK0171A010` | EKK0171A010SC | `KK_T_OPSVKEI_INFO` | Reads service contract agreement meeting (consent) information |
| R | `callEKK0321B002` | EKK0321B002SC | `KK_T_SEIKY_ISH` | Reads billing contract information (for invoice chain) |
| C | `callEKK0361D010` | EKK0361D010SC | `KK_T_OPSVKEI_ISP` | Registers/updates ISP service contract — creates or modifies the ISP service line item |
| C | `callEKK0021C060` (conditional) | EKK0021C060SC | `KK_T_MSKM` | Registers application details and follow-up work requests (when consent not yet confirmed) |
| C | `callEKK1091D010` | EKK1091D010SC | `KK_T_ODR_HAKKO_JOKEN` | Registers order release conditions — records the order authorization with status and details |
| - | `callEKK0171A010` (for ISP lookup) | EKK0171A010SC | `KK_T_OPSVKEI_INFO` | Retrieves ISP authentication ID from service contract agreement for fixed IP allocation |
| C | `hakkoSOD` (JKKHakkoSODCC) | JKKHakkoSODCC | Various SOD entities | Service Order Data issuance — creates service order records with basic info, service contract info, and ISP service contract info |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0023 | `KKSV0023OPOperation.run` -> `target13.execute` -> `JKKGlobalIpAddCfmCC.execute` | `callEKK0081A010 [R] KK_T_OPSVKEI_ISP`, `callEKK0361D010 [C] KK_T_OPSVKEI_ISP`, `callEKK1091D010 [C] KK_T_ODR_HAKKO_JOKEN` |

## 6. Per-Branch Detail Blocks

### Block 1 — PROCESSING (Entry) (L206)

> Log the start of the execute method.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `printlnEjbLog("execute start")` |

### Block 2 — PROCESSING (Initialization) (L209)

> Initialize the mapper and work maps for this operation.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `initSetUp(handle, param, fixedText)` | Initialize mapper instance, extract input data, create work maps |

**initSetUp internal processing:**

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `printlnEjbLog("initSetUp start")` | Log entry |
| 2 | SET | `opeDate = JCCBPCommon.getOpeDate(null)` | Get operator date for the current business day |
| 3 | SET | `this.mapper = new JKKGlobalIpAddCfmCCMapper(handle, param, opeDate)` | Instantiate the mapping layer with session, parameter, and date |
| 4 | SET | `this.inMap = (HashMap<String, Object>) param.getData(fixedText)` | Extract the business data map using the service message key |
| 5 | EXEC | `printlnEjbLog("fixedText=" + fixedText)` | Log the fixedText key value |
| 6 | SET | `this.ccWorkMap = new HashMap()` | Create the working area map for processed parameters |
| 7 | EXEC | `printlnEjbLog("initSetUp end")` | Log exit |

### Block 3 — PROCESSING (Input Validation) (L212)

> Validate all input parameters and copy them from the input map to the work map.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `chkInMap(handle, param)` | Validate and transfer 37+ input parameters into `ccWorkMap` |

**chkInMap internal processing:**

Validates each required parameter via `setterWorkParam(key)`. The following parameters are extracted:

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `setterWorkParam(KEY_FUNC_CD)` | Function code — mode selector |
| 2 | CALL | `setterWorkParam(KEY_SVC_KEI_NO)` | Service contract number |
| 3 | CALL | `setterWorkParam(KEY_SYSID)` | System ID |
| 4 | CALL | `setterWorkParam(KEY_RSV_APLY_YMD)` | Reservation application date |
| 5 | CALL | `setterWorkParam(MSKM_SBT_CD)` | Application type code |
| 6 | CALL | `setterWorkParam(MSKM_UK_DTM)` | Operation date/time |
| 7 | CALL | `setterWorkParam(CONSMBSN_MSKM_STAT_SKBT_CD)` | Consumption business application status code |
| 8 | CALL | `setterWorkParam(OP_SVC_CD)` | Operation service code |
| 9 | CALL | `setterWorkParam(PCRS_CD)` | Operation service code |
| 10 | CALL | `setterWorkParam(PPLAN_CD)` | Pricing plan code |
| 11 | CALL | `setterWorkParam(OYA_KEI_SKBT_CD)` | Parent contract identification code |
| 12 | CALL | `setterWorkParam(SVC_KEI_UCWK_NO)` | Service contract detail number |
| 13 | CALL | `setterWorkParam(SVC_USE_STA_KIBO_YMD)` | Service start desired date |
| 14 | CALL | `setterWorkParam(KOTEI_IP_AD)` | Fixed IP address |
| 15 | CALL | `setterWorkParam(NETMASK)` | Subnet mask |
| 16 | CALL | `setterWorkParam(SEIKY_KEI_NO)` | Billing contract number |
| 17 | CALL | `setterWorkParam(RULE0059_AUTO_APLY)` | Administrative fee auto-application flag |
| 18 | CALL | `setterWorkParam(SVC_CHRG_STAYMD)` | Billing start date |
| 19 | CALL | `setterWorkParam(IDO_DIV)` | Migration division code |
| 20 | CALL | `setterWorkParam(SVC_KEI_KAISEN_UCWK_NO)` | Service contract line revision detail number |
| 21 | CALL | `setterWorkParam(PRG_STAT)` | Progress status |
| 22 | CALL | `setterWorkParam(PRG_TKJK_1)` | Progress special item 1 |
| 23 | CALL | `setterWorkParam(ORDER_SBT_CD)` | Order type code |
| 24 | CALL | `setterWorkParam(SVC_ORDER_CD)` | Service order code |
| 25 | CALL | `setterWorkParam(YOKYU_SBT_CD)` | Request type code |
| 26 | CALL | `setterWorkParam(ODR_HAKKO_JOKEN_CD)` | Order release condition code |
| 27 | CALL | `setterWorkParam(ODR_NAIYO_CD)` | Order content code |
| 28 | CALL | `setterWorkParam(KK0161_GENE_ADD_DTM)` | Generation registration date/time |
| 29 | CALL | `setterWorkParam(FIXIPAD_IN)` | Fixed IP address (input) |
| 30 | CALL | `setterWorkParam(ZM0101_UPD_DTM_BF)` | Update date/time before |
| 31 | CALL | `setterWorkParam(USE_STAT_YMD)` | Usage start date |
| 32 | CALL | `setterWorkParam(SHYAKK_CHUSKK_CD_IN)` | Collection office |
| 33 | CALL | `setterWorkParam(KOTEI_IP_STKU_SBT_CD_IN)` | Fixed IP acquisition type code |
| 34 | CALL | `setterWorkParam(USE_CNT_IN)` | Usage count |
| 35 | CALL | `setterWorkParamList("EKK0011D020CBSMsg1List")` | Order release condition detail list |
| 36 | CALL | `setterWorkParamList("EKK1091D010CBSMsg1List")` | Order release registration detail list |

Each `setterWorkParam` call reads the value from `inMap`, and if the value is null or blank, it throws a `CCException` (unless the key starts with `"key_"`). List parameters are validated for non-null and non-empty.

### Block 4 — IF (Function Code Check) (L215)

> Conditional branch: when the function code is `"2"`, skip the main processing and return immediately in check-only mode.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `if (this.FUNC_CD_2.equals(this.ccWorkMap.get(KEY_FUNC_CD)))` | Check if function code is "2" (check-only) |

**Block 4.1 — ELSE branch (Check-only, skip)** (L216)

> When `func_cd` equals `"2"`, return the parameter without executing registration logic.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return param` | Return input parameter unchanged — no registration is performed |

**Block 4.2 — IF branch (Registration mode)** (L215)

> When `func_cd` equals `"1"`, proceed to execute the main registration logic.

### Block 5 — PROCESSING (Main Logic) (L218)

> Execute the core global IP address registration processing.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `main(handle, param)` | Delegate to main method which performs: service contract agreement retrieval, fixed IP address allocation, ISP service contract registration, service order issuance, application details registration (conditional), and order release conditions registration |

### Block 6 — PROCESSING (Logging) (L220)

> Log the completion of the execute method.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `printlnEjbLog("execute end")` | Log completion |

### Block 7 — RETURN (L221)

> Return the processed parameter object to the caller.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return param` | Return the parameter with updated work data |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `func_cd` | Field | Function code — distinguishes between registration mode ("1") and check-only/inquiry mode ("2") |
| `svc_kei_no` | Field | Service contract number — unique identifier for a service contract in the K-Opticom system |
| `svc_kei_ucwk_no` | Field | Service contract detail number — internal tracking ID for service contract line items/sections |
| `sysid` | Field | System ID — identifies the subsystem or system component |
| `mskm_sbt_cd` | Field | Application type code — classifies the type of application (e.g., new registration, modification) |
| `op_svc_cd` | Field | Operation service code — code identifying the operation/service being performed |
| `pplan_cd` | Field | Pricing plan code — identifies the pricing plan associated with the service |
| `kotei_ip_ad` | Field | Fixed IP address — the static IP address being registered for the customer |
| `netmask` | Field | Subnet mask — network mask associated with the fixed IP address |
| `seiky_kei_no` | Field | Billing contract number — links the service contract to the billing/ invoicing contract |
| `rule0059_auto_aply` | Field | Administrative fee auto-application flag — indicates whether administrative fees are auto-applied |
| `ido_div` | Field | Migration division code — code indicating migration status/type |
| `order_sbt_cd` | Field | Order type code — classifies the type of order |
| `svc_order_cd` | Field | Service order code — identifies the specific service order |
| `yokyu_sbt_cd` | Field | Request type code — classifies the type of customer request |
| `odr_hakko_joken_cd` | Field | Order release condition code — codes governing order authorization conditions |
| `odr_naiyo_cd` | Field | Order content code — classifies the content/type of the order |
| `kotei_ip_stku_sbt_cd_in` | Field | Fixed IP acquisition type code — how the fixed IP was acquired (new, existing, etc.) |
| `shyakk_chuskk_cd_in` | Field | Collection office — the regional office responsible for the collection/billing |
| `use_stat_ymd` | Field | Usage start date — the date service usage begins |
| `opeDate` | Field | Operator date — the current business date set by the operator |
| `inMap` | Field | Input data map — the raw HashMap containing all input parameters from the request |
| `ccWorkMap` | Field | CC working map — internal data structure populated with validated parameters for processing |
| `EKK0081A010SC` | SC Code | Read service contract (ISP agreement) information |
| `EKK0361D010SC` | SC Code | Register/modify ISP service contract |
| `EKK1091D010SC` | SC Code | Register order release conditions |
| `EKK0171A010SC` | SC Code | Read service contract agreement meeting information |
| `JKKHakkoSODCC` | CC | Service Order Data issuing component — creates service order records |
| `JKKFixipadCC` | CC | Fixed IP address processing component — handles fixed IP allocation and retrieval |
| `KKSV0023` | Screen | Service Contract Confirmation Meeting screen |
| `KKSV002301CC` | CC | Screen-specific processing component (KKSV0023's primary business logic CC) |
| `OPOperation` | Class | BPM operation class — wraps CC calls in a transactional BPM flow |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service (context from SOD constants) |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity |
| ISP | Acronym | Internet Service Provider — the network service provider in the service chain |
| CC | Acronym | Common Component — a shared business logic component in the Fujitsu Futurity BP framework |
| CBS | Acronym | Component-Based Service — a service component that performs CRUD operations on database entities |
| SC | Acronym | Service Component — a service component layer, often used in method names like `callEKKxxxxSC` |
| CAANMsg | Class | Common Application ANy Message — a message wrapper class used for inter-component data transfer |
