# Business Logic — JKKEmailInfoAddCfmCC.callEKK0411D010SC() [59 LOC]

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

## 1. Role

### JKKEmailInfoAddCfmCC.callEKK0411D010SC()

This method serves as a **Service Interface (SIF) adapter** for registering sub-option service contracts for ISP (Internet Service Provider) subscriptions. It encapsulates the full end-to-end lifecycle of invoking the `EKK0411D010SC` service component: building the request message from input parameters, executing the remote service call, processing the response, and mapping output data back to the caller's result hash.

The method implements the **SIF Request-Response pattern** — a standard enterprise integration approach where service components are invoked through a typed message envelope (`CAANMsg`), allowing asynchronous-style processing within a synchronous call. It handles both success and error paths: on success (status == 0), it maps the service component's output data into the caller's `resultHash` under the provided `mapKey`; on failure, it returns the non-zero status code so the caller can handle the error.

Its role in the larger system is as a **shared utility called by screen CBS methods** (notably `mainProc()`). It acts as a bridge between the screen-layer business logic and the lower-level service component `EKK0411D010SC`, translating between the request parameter model, the `CAANMsg` envelope model, and the hash-based I/O model.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["callEKK0411D010SC"])
    INIT["Initialize local variables:
sIFRequest, resultMsgs, template,
scCall, sIFResult, status = 0"]
    EDIT_IN["editInMsgCmn(param)
Set service IF common info"]
    TEMPLATE["Create CAANMsg template
from EKK0411D010CBSMsg"]
    MAP_IN["mappingEKK0411D010SCInMsg
Map input params to template"]
    EDIT_BASIC["editBasicCmn
Attach basic common info to template"]
    PUT_TEMPLATE["sIFRequest.put(TEMPLATE_LIST_KEY, template array)
Set request cluster"]
    SC_CALL["scCall = new ServiceComponentRequestInvoker()
Generate SC call cluster"]
    SIF_RUN["scCall.run(sIFRequest, handle)
Call SIF service component
EKK0411D010SC"]
    EDIT_RESULT["editResultRP
Map SIF response to param"]
    ERR_CHK["errChk(sIFResult)
Error check processing"]
    GET_RESULT["Extract resultMsgs from sIFResult"]
    GET_STATUS["Extract status from template"]
    CHECK_STATUS{status == 0?
Success?}
    MAP_OUT["mappingEKK0411D010SCOutMsg
Map result to output hash
under mapKey"]
    END_RETURN["Return status"]

    START --> INIT --> EDIT_IN --> TEMPLATE --> MAP_IN --> EDIT_BASIC --> PUT_TEMPLATE --> SC_CALL --> SIF_RUN --> EDIT_RESULT --> ERR_CHK --> GET_RESULT --> GET_STATUS --> CHECK_STATUS
    CHECK_STATUS -->|No, error| END_RETURN
    CHECK_STATUS -->|Yes, success| MAP_OUT --> END_RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying screen-bound input data and serving as the target for mapped output data. |
| 2 | `handle` | `SessionHandle` | The session context used by the SIF infrastructure to route the service component call across the service layer. |
| 3 | `inHash` | `HashMap<String, Object>` | Input condition map containing the source data to be mapped into the service component request (e.g., plan code, course code, sub-option contract details). |
| 4 | `resultHash` | `HashMap<String, Object>` | The output map where the service component's response data is written under the specified `mapKey` key on success. |
| 5 | `pplanCd` | `String` | Price Plan Code — the billing plan identifier for the sub-option service contract being registered. |
| 6 | `pcrsCd` | `String` | Price Course Code — the pricing course identifier associated with the sub-option service contract. |
| 7 | `mapKey` | `String` | The data storage map key used to store and retrieve the result hash under `resultHash`. Used as the key for `resultHash.put(mapKey, ...)`. |

### Instance Fields / External State Read

| Name | Type | Description |
|------|------|-------------|
| `KKSV000201CC` | (internal constant/reference) | Passed as the `cc` argument to `editResultRP` — likely a screen-level common component reference used for result mapping. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKEmailInfoAddCfmCC.editInMsgCmn` | - | - | Prepares the service IF request message envelope (Update) |
| - | `JKKEmailInfoAddCfmCC.mappingEKK0411D010SCInMsg` | - | - | Maps input parameters into the EKK0411D010CBSMsg template |
| U | `JKKEmailInfoAddCfmCC.editBasicCmn` | - | - | Attaches basic common information to the request template (Update) |
| - | `ServiceComponentRequestInvoker.run` | EKK0411D010SC | - | Invokes the SIF service component for sub-option ISP registration |
| U | `JKKEmailInfoAddCfmCC.editResultRP` | - | - | Maps the SIF response data back to the request parameter (Update) |
| - | `JKKEmailInfoAddCfmCC.errChk` | - | - | Error check processing on the SIF result |
| C | `JKKEmailInfoAddCfmCC.mappingEKK0411D010SCOutMsg` | - | - | Extracts and maps output data from service result into a hash (Create) |

Analyzed all method calls within this method:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `editInMsgCmn(param)` | - | - | Updates service IF common information in the request message |
| U | `editBasicCmn(param, template)` | - | - | Updates template with basic common fields (plan code, course code, etc.) |
| R | `scCall.run(sIFRequest, handle)` | EKK0411D010SC | - | Reads/invokes the sub-option service contract registration service component |
| U | `editResultRP(sIFResult, param, KKSV000201CC)` | - | - | Updates request parameter with mapped response data |
| - | `errChk(sIFResult)` | - | - | Validates the SIF result for error conditions |
| C | `mappingEKK0411D010SCOutMsg(resultMsgs)` | - | - | Creates a new HashMap of mapped output data from the service response |

## 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: `mappingEKK0411D010SCOutMsg` [-], `errChk` [-], `editResultRP` [U], `run` [-], `editBasicCmn` [U], `mappingEKK0411D010SCInMsg` [-], `editInMsgCmn` [U]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKEmailInfoAddCfmCC.mainProc()` | `mainProc()` -> `callEKK0411D010SC()` | `mappingEKK0411D010SCOutMsg` [-], `errChk` [-], `editResultRP` [U], `scCall.run(EKK0411D010SC)` [-], `editBasicCmn` [U], `mappingEKK0411D010SCInMsg` [-], `editInMsgCmn` [U] |

## 6. Per-Branch Detail Blocks

**Block 1** — VARIABLE DECLARATION (L1833)

| # | Type | Code |
|---|------|------|
| 1 | SET | `sIFRequest = null` // Service IF request map |
| 2 | SET | `resultMsgs = null` // Service response message array |
| 3 | SET | `template = null` // CAANMsg template for EKK0411D010CBSMsg |
| 4 | SET | `scCall = null` // Service Component Request Invoker |
| 5 | SET | `sIFResult = null` // Service IF result map |
| 6 | SET | `status = 0` // Default return status (success) |

**Block 2** — PROCESSING STEP: Set service IF common information (L1841)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `sIFRequest = editInMsgCmn(param)` // Prepares and returns the service IF request map from param |

**Block 3** — PROCESSING STEP: Set call parameters for EKK0411D010 (L1844)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EKK0411D010CBSMsg.class.getName())` // Creates typed message template |
| 2 | CALL | `mappingEKK0411D010SCInMsg(template, inHash, resultHash, pplanCd, pcrsCd)` // Maps input conditions into the template |
| 3 | CALL | `editBasicCmn(param, template)` // Attaches basic common info to template |

**Block 4** — PROCESSING STEP: Set request cluster (L1848)

| # | Type | Code |
|---|------|------|
| 1 | SET | `sIFRequest.put(JCMConstants.TEMPLATE_LIST_KEY, new CAANMsg[]{template})` // Adds template to request as cluster (constant: TEMPLATE_LIST_KEY) |

**Block 5** — PROCESSING STEP: Generate SC call cluster (L1851)

| # | Type | Code |
|---|------|------|
| 1 | SET | `scCall = new ServiceComponentRequestInvoker()` // Creates the SC invocation cluster |

**Block 6** — PROCESSING STEP: SIF call (L1854)

| # | Type | Code |
|---|------|------|
| 1 | SET | `sIFResult = scCall.run(sIFRequest, handle)` // Invokes service component EKK0411D010SC |

**Block 7** — PROCESSING STEP: Error mapping processing (L1857)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editResultRP(sIFResult, param, KKSV000201CC)` // Maps SIF result data back to param |

**Block 8** — PROCESSING STEP: Error check processing (L1859)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `errChk(sIFResult)` // Validates SIF result for errors |

**Block 9** — PROCESSING STEP: Acquire results (L1862)

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultMsgs = (CAANMsg[])sIFResult.get(JCMConstants.TEMPLATE_LIST_KEY)` // Extracts response message array (constant: TEMPLATE_LIST_KEY) |

**Block 10** — PROCESSING STEP: Acquire status code (L1865)

| # | Type | Code |
|---|------|------|
| 1 | SET | `status = template.getInt(JCMConstants.STATUS_INT_KEY)` // Gets status integer from template (constant: STATUS_INT_KEY) |

**Block 11** — IF (condition: `status == 0`) (L1868)

> (Optional: Business description of what this block does)
> If the service component returned a success status (0), map the output data to the result hash. The original Japanese comment states: "ステータスが0以外はエラーとなっている" (Status other than 0 indicates an error).

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultHash.put(mapKey, mappingEKK0411D010SCOutMsg(resultMsgs))` // Maps service output into resultHash under the mapKey key |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| EKK0411D010SC | Service Component | Sub-option service contract ISP registration — the service component invoked for registering sub-option internet service provider subscriptions |
| EKK0411D010CBSMsg | CBS Message Class | The service message class defining the request/response envelope for the EKK0411D010SC service component |
| SIF | Acronym | Service Interface — the enterprise integration layer for calling service components via message envelopes |
| SC | Acronym | Service Component — the low-level service class that performs the actual business data operations |
| CAANMsg | Technical term | Fujitsu's application message envelope class used to carry structured data between service layers |
| ServiceComponentRequestInvoker | Technical term | The runtime component that executes service component calls through the SIF infrastructure |
| sub-option service contract | Business term | A secondary service contract linked to a primary service, such as an ISP internet subscription attached to a phone line |
| ISP | Business term | Internet Service Provider — the internet connectivity add-on service |
| pplanCd | Field | Price Plan Code — the billing plan identifier for the subscription |
| pcrsCd | Field | Price Course Code — the pricing course associated with the subscription |
| mapKey | Field | Data storage map key — the HashMap key used to store/retrieve the result under resultHash |
| status | Field | Status code returned by the service component — 0 indicates success, non-zero indicates error |
| TEMPLATE_LIST_KEY | Constant | The JCM constant key for storing the message template array in the SIF request map |
| STATUS_INT_KEY | Constant | The JCM constant key for retrieving the integer status code from a CAANMsg |
| editInMsgCmn | Method | Sets up service IF common information in the request message |
| editBasicCmn | Method | Attaches basic common information fields to the request template |
| editResultRP | Method | Maps the SIF response result data back to the request parameter |
| errChk | Method | Performs error check processing on the SIF result |
| mappingEKK0411D010SCInMsg | Method | Maps input parameters into the EKK0411D010CBSMsg request template |
| mappingEKK0411D010SCOutMsg | Method | Extracts and maps output data from the service response into a HashMap result |
| Karr / resultHash | Field | The output hash map containing the mapped result data from the service component call |
