# Business Logic — JKKWrisvcAutoAplyGetSvcInfoCC.putParamMap() [7 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKWrisvcAutoAplyGetSvcInfoCC` |
| Layer | CC/Common Component — shared helper class within the business-process custom layer |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKWrisvcAutoAplyGetSvcInfoCC.putParamMap()

This method is a private utility that prepares the parameter map for downstream SC (Service Component) invocation by packaging a single `CAANMsg` template into the array-based message list format expected by the framework. In the Fujitsu futurility business process (BP) framework, many SC calls require the request message to be stored in the parameter map under a special key (`TEMPLATE_LIST_KEY`) as a `CAANMsg[]` array, even when only one message is involved. This method performs that single-boxing operation — wrapping one `CAANMsg` into a single-element `CAANMsg[]` and placing it into the map. It implements the **delegation pattern**, acting as a bridge between the single-message API used by the caller (`getSvcInfo()`) and the array-based contract required by the SC invocation layer. Its role is that of a **shared framework helper**: although declared private here, identical implementations exist across many other CC classes (e.g., `JKKHoseiKbtShosaInfoUtil`, `JKKCancelUsePlaceInfoCC`, `JKKAddKktkSvcKeiUtil`), indicating it is a standard boilerplate pattern for all BP custom screen processors. The method is called once by `getSvcInfo()`, which subsequently passes the enriched `paramMap` to an SC call to retrieve service information.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["putParamMap(params)"])
    STEP1(["Wrap single CAANMsg template into CAANMsg array"])
    STEP2(["Put array into paramMap using TEMPLATE_LIST_KEY"])
    RETURN(["Return paramMap"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> RETURN
```

**CONSTANT Resolution:**
- `JCMConstants.TEMPLATE_LIST_KEY` — the framework key under which the message array is stored in the parameter map. This key is used consistently across the BP framework to pass request/response message lists to and from SC invocations.

**Processing Flow:**
1. **Box the message** — The single `CAANMsg template` parameter is wrapped into a new `CAANMsg[]` array containing exactly one element.
2. **Register in map** — The resulting array is stored into `paramMap` using the key `TEMPLATE_LIST_KEY`. This makes the message available to the SC invocation layer, which reads it back from the map.
3. **Return** — The same `paramMap` instance (now enriched) is returned to the caller, enabling method chaining or further enrichment before the SC call.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramMap` | `HashMap<String, Object>` | The request parameter map that accumulates all data to be passed to the Service Component (SC). It is built incrementally by multiple CC helpers and ultimately consumed by the SC invocation as the input payload. |
| 2 | `template` | `CAANMsg` | A single application message (CAANMsg) that carries request data or metadata for the SC call. CAANMsg is the Fujitsu framework message envelope used for cross-layer communication between screens and service components. |

**No instance fields or external state** are read by this method. It operates purely on its parameters.

## 4. CRUD Operations / Called Services

This method does **not** invoke any SC, CBS, DAO, or service methods directly. It is a pure data-preparation utility. No database or entity operations occur within this method.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | — | — | — | No direct CRUD operations. This method only packages a message for downstream SC consumption. |

## 5. Dependency Trace

This method is private and only called internally within its owning class.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Internal: `JKKWrisvcAutoAplyGetSvcInfoCC.getSvcInfo()` | `getSvcInfo()` → `putParamMap(paramMap, template)` | Depends on what `getSvcInfo()` calls downstream |

**Caller detail:** `getSvcInfo()` is a private helper method in the same class. It builds up a `paramMap`, calls `putParamMap()` to register the template message, and then uses the enriched map to invoke a Service Component (the specific SC is determined by the `getSvcInfo()` implementation). No public entry points (screens or batches) reach this method directly.

## 6. Per-Branch Detail Blocks

The method has no conditional branches, loops, or exception handling. It is a linear 3-statement body.

**Block 1** — LINEAR PROCESS `(wrap template)` (L216)

> Wraps the single `CAANMsg template` into a `CAANMsg[]` array. This single-boxing is required because the framework's SC invocation contract expects an array of messages, even when only one message is being sent.

| # | Type | Code |
|---|------|------|
| 1 | SET | `templates = new CAANMsg[] { template }` // Create a single-element message array from the input template |

**Block 2** — LINEAR PROCESS `(store in map)` (L217)

> Registers the message array into the parameter map under the framework key so the downstream SC invocation can retrieve it.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` // Store message array in parameter map [-> CONSTANT: TEMPLATE_LIST_KEY = framework key for message list] |

**Block 3** — LINEAR PROCESS `(return)` (L219)

> Returns the enriched parameter map. The returned map reference is the same object passed in (modified in-place), allowing the caller to chain further operations if needed.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return paramMap` // Return the enriched parameter map to caller |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `paramMap` | Field | Parameter map — the shared request payload that accumulates all parameters (messages, data, flags) passed between CC helpers and the SC invocation layer |
| `CAANMsg` | Acronym | Fujitsu BP framework message envelope — the standard object used to carry structured request/response data between screen, CC, and SC layers |
| `TEMPLATE_LIST_KEY` | Constant | Framework key (String) used as the map key to store the `CAANMsg[]` array in the parameter map. The SC invocation layer reads from this key to obtain the list of request messages |
| `CAANMsg[]` | Type | Message array — the framework contract requires messages to be passed as an array (zero or more), even for single-message operations |
| CC | Acronym | Common Component — the shared helper/utility classes in the `com.fujitsu.futurity.bp.custom.common` package that provide cross-cutting functionality for business-process screens |
| SC | Acronym | Service Component — the backend service layer that handles database operations and business logic, invoked by CC classes via a standardized call mechanism |
| BP | Acronym | Business Process — the Fujitsu futurility framework for implementing screen-to-SC business workflows |
| `RequestParameterException` | Exception | Framework-checked exception thrown when parameter preparation or validation fails |
| `getSvcInfo` | Method | Service information retrieval — the method in the owning class that calls `putParamMap()` and then invokes a downstream SC to fetch service contract / line item details |
