# (DD16) Business Logic — JFUSetVariTsushinKikiMskmCC.setFUSV013407CC() [32 LOC]

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

## 1. Role

### JFUSetVariTsushinKikiMskmCC.setFUSV013407CC()

This method performs the **upper-level mapping (上りマッピング) for ticket-based service application requests (チケット利用申請依頼CC)** within the telecom equipment provision and modification workflow. Specifically, it injects equipment provision service contract number (`kktkSvcKeiNo`) and equipment change number (`kikiChgNo`) into a per-iteration discount eligibility target list maintained by the BPM operation `FUSV0134OPOperation`.

The method operates as a **mapping/dispatcher pattern** — it does not perform business logic or data access itself, but rather routes data into a pre-built list structure. It retrieves a `HashMap` from the request parameter under the key `FUSV013407CC`, extracts a child-list associated with `ticket_use_shin_irai_list`, and then iterates over each entry. For entries whose `sisak_cd` (施策コード — policy/discount code) matches the value `B001` (which corresponds to "o-光 multi-function router additional/swap fees discount" / 「o光多機能ルーター追加・交換費用 割引」), it populates two target keys (`cmp_add_optnty_tg_key_1` and `cmp_add_optnty_tg_key_2`) with the service contract number and equipment change number respectively.

This mapping is consumed downstream by the ticket-based discount auto-application logic in the FUSV0134 BPM process, enabling automatic price discounts for eligible equipment swap operations tied to multi-function router promotions. The method is a private, non-public utility called from `JFUSetVariTsushinKikiMskmCC.setKktkSvcKeiNoMapCC()` during the broader equipment provision service contract modification flow.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setFUSV013407CC param, kktkSvcKeiNo, kikiChgNo"])
    START --> GETDATA["param.getData FUSV013407CC"]
    GETDATA --> PARENT_MAP["parentMap = HashMap cast of getData result"]
    PARENT_MAP --> CHECK_LIST{parentMap.containsKey ticket_use_shin_irai_list}
    CHECK_LIST -->|false| EARLY_RETURN["return early - exit method"]
    CHECK_LIST -->|true| GET_LIST["list = ArrayList cast of parentMap.get ticket_use_shin_irai_list"]
    GET_LIST --> INIT_LOOP["i = 0"]
    INIT_LOOP --> LOOP_CHECK{i lt list.size}
    LOOP_CHECK -->|true| GET_CHILD["childMap = HashMap cast of list.get i"]
    GET_CHILD --> GET_SISAK["sisakCd = String cast of childMap.get sisak_cd"]
    GET_SISAK --> CHECK_SISAK{SISAK_CD_PARAMSET.contains sisakCd}
    CHECK_SISAK -->|sisak_cd B001| SET_KEY1["childMap.put cmp_add_optnty_tg_key_1, kktkSvcKeiNo"]
    SET_KEY1 --> SET_KEY2["childMap.put cmp_add_optnty_tg_key_2, kikiChgNo"]
    CHECK_SISAK -->|sisak_cd not in B001| INC_LOOP["i++"]
    SET_KEY2 --> INC_LOOP
    INC_LOOP --> LOOP_CHECK
    LOOP_CHECK -->|false| PUT_LIST["parentMap.put ticket_use_shin_irai_list, list"]
    PUT_LIST --> END(["End return"])
    EARLY_RETURN --> END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying the full BPM request context. It holds the parent `HashMap` (key `FUSV013407CC`) which contains the ticket-based service application request list (`ticket_use_shin_irai_list`). This list is pre-populated by the BPM operation (`FUSV0134OPOperation`) and its nested mappings are modified in-place during this method. |
| 2 | `kktkSvcKeiNo` | `String` | Equipment provision service contract number (機器提供サービス契約番号). This is the unique identifier for the equipment provision service contract line being modified. It is written into `cmp_add_optnty_tg_key_1` to identify which service contract is eligible for the discount. |
| 3 | `kikiChgNo` | `String` | Equipment change number (機器変更番号). This identifies the specific equipment change event associated with the modification. It is written into `cmp_add_optnty_tg_key_2` to link the discount to a particular equipment swap operation. |

**External state / constants read:**
- `FUSV013407CC` = `"FUSV013407CC"` [-> `FUSV013407CC="FUSV013407CC" (JFUSetVariTsushinKikiMskmCC.java:745)] — the map key for the ticket-based application request data.
- `FUSV013407CC_LIST` = `"ticket_use_shin_irai_list"` [-> `FUSV013407CC_LIST="ticket_use_shin_irai_list" (JFUSetVariTsushinKikiMskmCC.java:748)] — the key within the parent map that holds the child list of ticket application entries.
- `FUSV013407CC_SISAK_CD` = `"sisak_cd"` [-> `FUSV013407CC_SISAK_CD="sisak_cd" (JFUSetVariTsushinKikiMskmCC.java:750)] — the key within each child map that holds the policy/discount code.
- `FUSV013407CC_KEY1` = `"cmp_add_optnty_tg_key_1"` [-> `FUSV013407CC_KEY1="cmp_add_optnty_tg_key_1" (JFUSetVariTsushinKikiMskmCC.java:752)] — the target key for the service contract number in the child map.
- `FUSV013407CC_KEY2` = `"cmp_add_optnty_tg_key_2"` [-> `FUSV013407CC_KEY2="cmp_add_optnty_tg_key_2" (JFUSetVariTsushinKikiMskmCC.java:754)] — the target key for the equipment change number in the child map.
- `SISAK_CD_PARAMSET` = `Arrays.asList("B001")` [-> `SISAK_CD_PARAMSET=["B001"] (JFUSetVariTsushinKikiMskmCC.java:757)] — the set of policy codes eligible for parameter injection. Currently only `B001` is included.

## 4. CRUD Operations / Called Services

This method performs **no direct CRUD operations** on databases or external services. It is purely an in-memory data mapping layer. All operations are HashMap `put()`/`get()` calls on local objects derived from the request parameter.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `param.getData(FUSV013407CC)` | - | - | Reads the parent `HashMap` containing the ticket-based application request list from the request parameter (in-memory) |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `getData` [R], `put` [R/U], `put` [R/U]  # NOSONAR

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | BPM: `JFUSetVariTsushinKikiMskmCC` (custom processing) | `FUSV0134OPOperation.run()` -> `FUSV0134OPOperation` (targeta BPM execution) -> `JFUSetVariTsushinKikiMskmCC.mainProcess()` -> `setKktkSvcKeiNoMapCC()` -> `setFUSV013407CC()` | `param.getData [R] in-memory HashMap` |
| 2 | BPM: `FUSV0134OPOperation` | `FUSV0134OPOperation.run()` -> `JFUSetVariTsushinKikiMskmCC` -> `setKktkSvcKeiNoMapCC()` -> `setFUSV013407CC()` | `param.getData [R] in-memory HashMap` |

**Call chain detail:**
The method is called from `setKktkSvcKeiNoMapCC()` (same class, line ~1536) within the same `JFUSetVariTsushinKikiMskmCC` class, which is itself a custom BPM processing component invoked by the BPM operation `FUSV0134OPOperation`. The execution condition for this branch is controlled by `JFUTicketUseShinIraiCCReqChk` (ticket-based service application request check) as defined in `FUSV0134OPOperation.java:245`.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(parentMap.containsKey(FUSV013407CC_LIST))` (L3414)

> Retrieves the ticket-based service application request list from the parent map. If the list is not present, the method returns early — no mapping is performed. This is a guard clause to ensure the BPM operation has pre-populated the list structure.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `parentMap = (HashMap)param.getData(FUSV013407CC)` // Retrieves parent map [-> `FUSV013407CC="FUSV013407CC"` (JFUSetVariTsushinKikiMskmCC.java:745)] |
| 2 | SET | `list = null` // Initializes list variable |
| 3 | IF | `parentMap.containsKey(FUSV013407CC_LIST)` [-> `FUSV013407CC_LIST="ticket_use_shin_irai_list"` (JFUSetVariTsushinKikiMskmCC.java:748)] |

**Block 1.1** — [ELSE-IF-TRUE] `(containsKey returned true)` (L3415-3416)

> The list exists in the parent map. Extract it for iteration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `list = (ArrayList)parentMap.get(FUSV013407CC_LIST)` // Casts to ArrayList [-> `FUSV013407CC_LIST="ticket_use_shin_irai_list"` (JFUSetVariTsushinKikiMskmCC.java:748)] |

**Block 1.2** — [ELSE] `(containsKey returned false)` (L3417-3418)

> The list is not present in the parent map. Return early — no further processing is performed. This prevents null pointer exceptions and indicates the BPM layer did not initialize the ticket list.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return` // Early exit — ticket list not found |

**Block 2** — [FOR LOOP] `(i = 0; i < list.size(); i++)` (L3420)

> Iterates over each entry in the ticket-based service application request list. For each entry, it checks whether the policy code (`sisak_cd`) matches an eligible discount target code. If so, it injects the equipment provision service contract number and equipment change number into the child map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `i = 0` // Loop initialization |
| 2 | SET | `childMap = (HashMap)list.get(i)` // Retrieves current iteration's child map |
| 3 | IF | `SISAK_CD_PARAMSET.contains(childMap.get(FUSV013407CC_SISAK_CD))` [-> `FUSV013407CC_SISAK_CD="sisak_cd"` (JFUSetVariTsushinKikiMskmCC.java:750)] [-> `SISAK_CD_PARAMSET=["B001"] (JFUSetVariTsushinKikiMskmCC.java:757)] |

**Block 2.1** — [IF-TRUE] `(sisak_cd matches B001)` (L3428-3432)

> The policy code is `B001`, corresponding to the "o-光 multi-function router additional/swap fees discount" (「o光多機能ルーター追加・交換費用 割引」). This is the only code currently in `SISAK_CD_PARAMSET`. The method populates the two discount eligibility target keys with the service contract number and equipment change number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put(FUSV013407CC_KEY1, kktkSvcKeiNo)` // Equipment provision service contract number -> discount target key 1 [-> `FUSV013407CC_KEY1="cmp_add_optnty_tg_key_1"` (JFUSetVariTsushinKikiMskmCC.java:752)] |
| 2 | SET | `childMap.put(FUSV013407CC_KEY2, kikiChgNo)` // Equipment change number -> discount target key 2 [-> `FUSV013407CC_KEY2="cmp_add_optnty_tg_key_2"` (JFUSetVariTsushinKikiMskmCC.java:754)] |

**Block 2.2** — [IF-FALSE] `(sisak_cd does not match B001)` (L3426)

> The policy code does not match any eligible discount code. No keys are set for this entry — it is silently skipped. The loop continues to the next entry.

| # | Type | Code |
|---|------|------|
| 1 | (no-op) | // No action — entry is not eligible for discount parameter injection |

**Block 3** — [EXPRESSION] `(L3434)`

> After iterating through all entries, puts the (potentially modified) list back into the parent map. This ensures that any changes made to child maps are reflected in the parent map for downstream BPM consumption.

| # | Type | Code |
|---|------|------|
| 1 | SET | `parentMap.put(FUSV013407CC_LIST, list)` // Stores the list back [-> `FUSV013407CC_LIST="ticket_use_shin_irai_list"` (JFUSetVariTsushinKikiMskmCC.java:748)] |
| 2 | RETURN | `return` // Method completes (void return) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sisak_cd` | Field | Policy/Discount code — classifies the type of promotional discount or policy applied to a ticket-based service request. `B001` specifically identifies the "o-光 multi-function router additional/swap fees discount." |
| `ticket_use_shin_irai_list` | Field | Ticket-based service application request list — a list of HashMap entries representing individual ticket application requests processed during the BPM workflow. |
| `cmp_add_optnty_tg_key_1` | Field | Comprehensive add-on optional target key 1 — target key within each ticket application entry where the equipment provision service contract number is stored for discount eligibility. |
| `cmp_add_optnty_tg_key_2` | Field | Comprehensive add-on optional target key 2 — target key within each ticket application entry where the equipment change number is stored for discount eligibility. |
| `kktkSvcKeiNo` | Field | Equipment provision service contract number (機器提供サービス契約番号) — unique identifier for a service contract line item related to equipment provision. |
| `kikiChgNo` | Field | Equipment change number (機器変更番号) — unique identifier for an equipment change/swapping event. |
| `FUSV013407CC` | Constant | Internal map key identifier for the ticket-based service application request data within the request parameter. |
| `B001` | Value | Discount policy code for "o-光 multi-function router additional/swap fees discount" (「o光多機能ルーター追加・交換費用 割引」). |
| FUSV0134 | BPM | A BPM operation for ticket-based service application processing in the telecom equipment modification domain. |
| FUSV0134OPOperation | Class | The BPM operation class that orchestrates the ticket-based service application workflow, including calling this method. |
| JFUTicketUseShinIraiCCReqChk | Class | Request check class that determines whether ticket-based service application processing should be executed. |
| 上りマッピング | Japanese comment | Upper-level mapping — data mapping at the upper layer of the processing chain, typically meaning mapping data into structures consumed by higher-level components. |
| チケット利用申請依頼CC | Japanese comment | Ticket-based service application request CC — the business context of this mapping, where "CC" refers to a Common Component for processing ticket-based requests. |
| システム | System | Telecom billing and service provisioning system where equipment contracts, changes, and promotional discounts are managed. |
