# Business Logic — JKKKojiWrisvcAutoAplyCC.setSvcKeiGrpList() [9 LOC]

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

## 1. Role

### JKKKojiWrisvcAutoAplyCC.setSvcKeiGrpList()

This method is a lightweight data-preparation utility within the **Work Assignment Service Auto-Apply Common Component** (工事割当サービス自動適用-common). Its sole purpose is to construct a **service contract group list** (サービス契約グループリスト) by wrapping a given `HashMap` representing a service contract group into a `List`, enabling consistent downstream consumption by the calling `execute()` method. Specifically, it injects a **group division code** (`grp_div`) with the hardcoded value `"00"` into the input map — this code signifies a standard / default group classification, distinguishing it from alternative group types that might use other numeric codes. The method follows a simple **builder / wrapping pattern**: receive a map, annotate it with a group-level discriminator, and return it as a single-element list. It has no conditional branches, no external service calls, and no database or CRUD interactions — it is a pure data-structure adapter called from the `execute()` entry point whenever a new service contract group needs to be assembled (e.g., for equipment-provided service contracts, new-service registrations, or other auto-apply scenarios).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setSvcKeiGrpList"])
    STEP1["Create empty ArrayList svcKeiGrpList"]
    STEP2["Put grp_div equals 00 into svcKeiGrpMap"]
    STEP3["Add svcKeiGrpMap to svcKeiGrpList"]
    END_NODE(["Return svcKeiGrpList"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> END_NODE
```

**Step-by-step breakdown:**

1. **Initialize** an empty `ArrayList<HashMap<String, Object>>` named `svcKeiGrpList`. This list will hold one or more service contract group entries.
2. **Annotate the input map** by calling `svcKeiGrpMap.put("grp_div", "00")`. The key `"grp_div"` represents the **group division** (グループ区分) code, and `"00"` is a hardcoded constant indicating the standard/default group type. This annotation enables downstream code to distinguish this group from others.
3. **Add the annotated map** to the list via `svcKeiGrpList.add(svcKeiGrpMap)`. This wraps the single map into the list structure expected by the caller.
4. **Return** the populated list to the caller (`execute()` method).

There are no conditional branches, loops, or exception-throwing paths in this method. It executes all steps unconditionally.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `svcKeiGrpMap` | `HashMap` | A map representing a **service contract group** (サービス契約グループ). It is a mutable key-value container passed by reference, into which the method injects the `grp_div` field and whose reference is then added to the returned list. The caller creates this map as an empty `new HashMap<String, Object>()` before passing it, and may populate additional keys (e.g., `svc_kei_list`) after the method returns. |
| 2 | *(none)* | — | No additional parameters. |

**No instance fields or external state are read by this method.** It operates entirely on its input parameter and local variables.

## 4. CRUD Operations / Called Services

This method performs **no database operations, no service component (SC) calls, and no CRUD operations**. It is a pure in-memory data structure preparation method. The only operations are standard Java `HashMap` and `ArrayList` collection methods.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *(none)* | — | — | — | This method does not interact with any database, entity, or service component. It only prepares an in-memory data structure. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method (`execute()`).

This method is called exclusively from the `execute()` method of the same class (`JKKKojiWrisvcAutoAplyCC`). The `execute()` method is the public entry point invoked by the BPM framework to carry out the work-assignment service auto-apply process. The call chain is direct — no intermediate layers.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `execute()` (CC entry point) | `JKKKojiWrisvcAutoAplyCC.execute()` → `JKKKojiWrisvcAutoAplyCC.setSvcKeiGrpList()` | *(none — no CRUD endpoints)* |

**Note:** The `execute()` method calls `setSvcKeiGrpList()` in multiple branches (approximately 8 call sites across different service-type branches such as equipment-provided services, new-service registration, etc.), always passing an empty `HashMap` and then enriching the returned list with additional data.

## 6. Per-Branch Detail Blocks

> This method has no conditional branches (no if/else, switch, for, while, or try/catch). All processing is linear.

**Block 1** — [LINEAR PROCESS] `(no condition)` (L394–L402)

> Create an empty list, annotate the input map with the group division code, add the map to the list, and return.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiGrpList = new ArrayList<HashMap<String, Object>>()` // Initialize empty list |
| 2 | EXEC | `svcKeiGrpMap.put("grp_div", "00")` // Put グループ区分 (group division) = "00" (standard group) into the map [-> GRP_DIV="00"] |
| 3 | EXEC | `svcKeiGrpList.add(svcKeiGrpMap)` // Add the annotated map to the list |
| 4 | RETURN | `return svcKeiGrpList` // Return the single-element list to the caller |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `grp_div` | Field | **Group Division Code** — An internal key used to classify service contract groups. The value `"00"` indicates a standard/default group type. |
| `svc_kei_grp_list` | Field | **Service Contract Group List** — A list of service contract group maps, assembled by `setSvcKeiGrpList()` and consumed by downstream processing. |
| `svc_kei_grp_map` | Field | **Service Contract Group Map** — A single map representing one service contract group, containing fields like `grp_div` and optionally `svc_kei_list`. |
| `svc_kei_list` | Field | **Service Contract List** — A list of service contract details (サービス契約リスト) stored within a service contract group map. |
| `kojiakInfoMap` | Field | **Construction Information Map** — A data map holding construction/installation details, including the `stb_tekkyo` field. |
| `stb_tekkyo` | Field | **STB Return (Check Yes/No)** — Indicates whether a Set-Top Box needs to be returned. `"1"` = Yes (チェック有), `"0"` = No (チェック無). |
| `mskm_no` | Field | **Contract Number** — The customer contract identifier (契約番号). |
| `KikiInfoAddMap` | Field | **Equipment Information Addition Map** — A map containing equipment-provided service contract data, including a `create_list` key. |
| `add_chge_div` | Field | **Registration/Change Division Code** — Distinguishes between registration (`"01"`) and other operation types. |
| STB | Acronym | **Set-Top Box** — A hardware device used for cable/satellite TV and internet services. |
| CC | Acronym | **Common Component** — A reusable software component in the Fujitsu Futurity BPM framework, typically containing shared business logic. |
| BPM | Acronym | **Business Process Management** — The framework (`com.fujitsu.futurity.bp.x21.bpm`) used to orchestrate business processes in this system. |
| 工事割当サービス自動適用 | Business term | **Work Assignment Service Auto-Apply** — The overall process that automatically applies service contracts based on work assignment (installation/construction) data. |
| _GROUP区分 | Business term | **Group Division** — A classification field that determines the type or category of a service contract group. |
