# Business Logic — JKKNsidPwdChgOrsjgsCC.addMskmNyoSnn() [55 LOC]

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

## 1. Role

### JKKNsidPwdChgOrsjgsCC.addMskmNyoSnn()

This method executes the **Subscription Content Registration and Follow-Up Process** (申込内容承認登録) for an ISP authentication ID and password change operation targeting ex-contractors (卸先事業者). It is a private helper within the shared common component class `JKKNsidPwdChgOrsjgsCC`, which handles ISP authentication ID/password change workflows for ex-contractors.

The method performs two sequential business operations through the service component (SC) delegation pattern. First, it constructs and submits a registration request (CBS `EKK0011D020`) to register the subscription content details, then extracts the returned registration detail number (`mskmDtlNo`) and update timestamp (`updDtmBf`) from the response. Second, it constructs and submits a consultation and follow-up business delegation request (CBS `EKK0021C060`) using the extracted detail number to trigger downstream business processing. The method operates within the broader ISP authentication ID/password change flow, which is initiated by the caller `chgNsidPwd()` that orchestrates the full credential update lifecycle for ex-contractor accounts.

The method implements the **delegation pattern** via its private `callSC()` helper, which dispatches input mapping tables to the appropriate service components. It uses a mapping-table approach (`Object[][]`) to configure CBS messages with template IDs, function codes, timestamps, and domain-specific codes, making the logic data-driven rather than procedural.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["addMskmNyoSnn params"])
    CREATE_CHILD["Create CAANMsg childTemplate
EKK0011D020CBSMsg1List"]
    CREATE_MSG_LIST["Create CAANMsg[] ekk0011d020Msg1List
with childTemplate"]
    BUILD_INPUT1["Build Object[][] ekk0011d020In
EKK0011D020CBSMsg mapping table"]
    SET_FORM_CD["Set childTemplate.MSKM_FORM_CD
CD00591_01 = 01"]
    CALL_SC1["Call callSC
EKK0011D020 CBS"]
    GET_MSG_LIST["Get CAANMsg[] from response
EKK0011D020CBSMSG1LIST"]
    CHECK_MSG["msgList != null AND length > 0"]
    GET_DTL_NO["Set mskmDtlNo from
ekk0011d020MsgList[0].getString"]
    GET_UPD_DTM["Set updDtmBf from
ekk0011d020Msg.getString UPD_DTM"]
    BUILD_INPUT2["Build Object[][] ekk0021c060In
EKK0021C060CBSMsg mapping table"]
    CALL_SC2["Call callSC
EKK0021C060 CBS"]
    END_NODE(["Return"])

    START --> CREATE_CHILD --> CREATE_MSG_LIST --> BUILD_INPUT1 --> SET_FORM_CD --> CALL_SC1 --> GET_MSG_LIST --> CHECK_MSG
    CHECK_MSG -->|Yes| GET_DTL_NO --> GET_UPD_DTM --> BUILD_INPUT2
    CHECK_MSG -->|No| BUILD_INPUT2
    BUILD_INPUT2 --> CALL_SC2 --> END_NODE
```

**Block 1 — Create child message template** (L548)

Business description: Creates a child message template for the subscription content registration detail list.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `ekk0011d020childTemplate = new CAANMsg(EKK0011D020CBSMsg1List.class.getName())` // Create child message [-> `EKK0011D020CBSMsg1List`] |
| 2 | SET | `ekk0011d020Msg1List = new CAANMsg[]{ekk0011d020childTemplate}` // Build message array [1 element] |

**Block 2 — Build first CBS input mapping table (EKK0011D020: Subscription Content Registration)** (L551–L562)

Business description: Constructs the input parameter mapping table for the registration request, setting the template ID, function code, SYSID, subscription subtype code, update timestamp, registration date, consumption contract registration status code, and the child message list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `EKK0011D020CBSMsg.TEMPLATEID, "EKK0011D020"` // [-> `TEMPLATE_ID_EKK0011D020`] Template ID for subscription content registration |
| 2 | SET | `EKK0011D020CBSMsg.FUNC_CODE, "1"` // [-> `JPCModelConstant.FUNC_CD_1 = "1"`] Function code 1: registration |
| 3 | SET | `EKK0011D020CBSMsg.SYSID, sysid` // SYSID from parameter |
| 4 | SET | `EKK0011D020CBSMsg.MSKM_SBT_CD, "00026"` // [-> `JKKSvcConst.MSKM_SBT_CD_00026 = "00026"`] Subscription subtype code for ISP auth ID/password change |
| 5 | SET | `EKK0011D020CBSMsg.MSKM_UK_DTM, JPCBPCommon.getOpeDateTimeStamp(null)` // Update date/time from operation timestamp |
| 6 | SET | `EKK0011D020CBSMsg.MSKM_YMD, opeDate` // Registration date from instance field |
| 7 | SET | `EKK0011D020CBSMsg.CONSMBSN_MSKM_STAT_SKBT_CD, "04"` // [-> `JKKStrConst.CD00760_04 = "04"`] Consumption contract registration status sub-type code |
| 8 | SET | `EKK0011D020CBSMsg.EKK0011D020CBSMSG1LIST, ekk0011d020Msg1List` // Child message list |

**Block 3 — Set subscription form code on child template** (L565)

Business description: Sets the subscription form code on the child message template to indicate the application form type.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ekk0011d020childTemplate.set(EKK0011D020CBSMsg1List.MSKM_FORM_CD, "01")` // [-> `JKKStrConst.CD00591_01 = "01"`] Subscription form code 01: Internet service |

**Block 4 — Execute first service call (EKK0011D020 CBS)** (L568–L569)

Business description: Invokes the service component to register the subscription content details. The `callSC` private helper dispatches the input mapping and returns a response `CAANMsg`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callSC(handle, scCall, param, ekk0011d020In, fixedText, new EKK0011D020CBSMsg().getContents())` // Register subscription content [-> `EKK0011D020CBS` SC] |

**Block 5 — Extract message list from response** (L571)

Business description: Retrieves the child message list from the CBS response using the nested list key.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0011d020MsgList = ekk0011d020Msg.getCAANMsgList(EKK0011D020CBSMsg.EKK0011D020CBSMSG1LIST)` // Extract detail list |

**Block 6 — Conditional: process registration response** (L573–L582)

Business description: If the registration was successful (message list is non-null and has elements), extract the registration detail number and update timestamp from the response.

| # | Type | Code |
|---|------|------|
| 1 | SET | `updDtmBf = ""` // Initialize update timestamp buffer |
| 2 | IF | `ekk0011d020MsgList != null && ekk0011d020MsgList.length > 0` // Check response validity |
| 3 | SET | `mskmDtlNo = ekk0011d020MsgList[0].getString(EKK0011D020CBSMsg1List.MSKM_DTL_NO)` // [-> Instance field] Extract registration detail number from first message |
| 4 | SET | `updDtmBf = ekk0011d020Msg.getString(EKK0011D020CBSMsg.UPD_DTM)` // [-> Local var] Extract update timestamp from parent message |

**Block 7 — Build second CBS input mapping table (EKK0021C060: Detail Consultation & Follow-Up Business Delegation)** (L585–L592)

Business description: Constructs the input parameter mapping for the follow-up business delegation request, using the registration detail number obtained from the previous step, the request date, the pre-update timestamp, and the movement division code for ISP authentication ID/password reset/reissue.

| # | Type | Code |
|---|------|------|
| 1 | SET | `EKK0021C060CBSMsg.TEMPLATEID, "EKK0021C060"` // [-> `TEMPLATE_ID_EKK0021C060`] Template ID for detail consultation and follow-up |
| 2 | SET | `EKK0021C060CBSMsg.FUNC_CODE, "1"` // [-> `JPCModelConstant.FUNC_CD_1 = "1"`] Function code 1 |
| 3 | SET | `EKK0021C060CBSMsg.MSKM_DTL_NO, mskmDtlNo` // [-> Instance field] Registration detail number from previous CBS response |
| 4 | SET | `EKK0021C060CBSMsg.KZKWRK_REQYMD, JPCBPCommon.getOpeDate(null)` // Consultation work request date |
| 5 | SET | `EKK0021C060CBSMsg.UPD_DTM_BF, updDtmBf` // Pre-update timestamp from previous step |
| 6 | SET | `EKK0021C060CBSMsg.IDO_DIV, "00052"` // [-> `JKKSvcConst.IDO_DIV_IDPWD_SHKKA_SAIFURI = "00052"`] Movement division: ISP auth ID/password reset/reissue |

**Block 8 — Execute second service call (EKK0021C060 CBS)** (L595–L596)

Business description: Invokes the service component to delegate the follow-up business processing for the registered subscription details.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callSC(handle, scCall, param, ekk0021c060In, fixedText, new EKK0021C060CBSMsg().getContents())` // Delegate follow-up business [-> `EKK0021C060CBS` SC] |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle providing the transactional context for all database operations within this method. Used by `callSC` to execute service components against the backend data layer. |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | Service component request invoker — the dispatcher that routes CBS/SC calls to their respective service component implementations. Acts as the invocation bridge between this CC method and the downstream CBS layer. |
| 3 | `param` | `IRequestParameterReadWrite` | Request parameter object for bidirectional read/write of request-scoped parameters. Provides access to request-level data and error handling through `RequestParameterException`. |
| 4 | `fixedText` | `String` | User-defined string (ユーザ定義文字列) — passed through to CBS messages for traceability and audit logging purposes. Used by `callSC` to embed contextual identifiers in CBS calls. |
| 5 | `sysid` | `String` | System identifier (SYSID) — identifies the originating system for the subscription registration. Used as a routing and auditing field in both CBS calls to distinguish between different upstream systems (e.g., retail vs. ex-contractor channels). |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `opeDate` | `String` | Operation date — set earlier in the calling flow (`chgNsidPwd()`) via `JPCBPCommon.getOpeDate(null)`. Represents the business date for the subscription registration. |
| `mskmDtlNo` | `String` | Registration detail number — instance-level buffer populated by this method from the first CBS response and used in the second CBS call. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `callSC` (via EKK0011D020CBSMsg) | EKK0011D020CBS | KK_T_MSKM (Subscription Registration Detail) | Registers subscription content details — creates a new record with template ID EKK0011D020, function code 1 (registration), subscription subtype 00026 (ISP auth ID/password change), form code 01 (Internet service), and status code 04 (consumption contract registration status). Returns the newly created detail number (`mskmDtlNo`) and update timestamp. |
| R | `callSC` (via EKK0021C060CBSMsg) | EKK0021C060CBS | KK_T_MSKM_DTL (Subscription Detail Consultation) | Delegates follow-up business processing — queries the registered subscription detail (using `mskmDtlNo` from previous step) and triggers downstream consultation work with movement division code 00052 (ISP auth ID/password reset/reissue for ex-contractors). |

## 5. Dependency Trace

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `callSC` [C], `callSC` [R], `getCAANMsgList` [R], `getString` [R], `getString` [R], `getContents` [R], `getContents` [R], `getOpeDateTimeStamp` [R], `getOpeDate` [R], `getOpeDate` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `chgNsidPwd()` | `JKKNsidPwdChgOrsjgsCC.chgNsidPwd()` -> `JKKNsidPwdChgOrsjgsCC.addMskmNyoSnn()` | `EKK0011D020CBS [C] KK_T_MSKM`, `EKK0021C060CBS [R] KK_T_MSKM_DTL` |

**Caller details:**

| # | Caller Class | Caller Method | Kind |
|---|-------------|-------------|------|
| 1 | `JKKNsidPwdChgOrsjgsCC` | `chgNsidPwd()` | CC private method — calls `addMskmNyoSnn()` as part of the ISP authentication ID/password change flow for ex-contractors |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET/NEW] (L548)

> Creates the child message template and wraps it in an array for the subscription content registration detail list structure.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `ekk0011d020childTemplate = new CAANMsg(EKK0011D020CBSMsg1List.class.getName())` |
| 2 | SET | `ekk0011d020Msg1List = new CAANMsg[]{ekk0011d020childTemplate}` |

**Block 2** — [SET] (L551–L562)

> Builds the input mapping table for the subscription content registration CBS call. This is a data-driven configuration step that maps template IDs, function codes, and domain-specific constants into a 2D array.

| # | Type | Code |
|---|------|------|
| 1 | SET | `EKK0011D020CBSMsg.TEMPLATEID, "EKK0011D020"` [-> `TEMPLATE_ID_EKK0011D020 = "EKK0011D020"`] |
| 2 | SET | `EKK0011D020CBSMsg.FUNC_CODE, "1"` [-> `JPCModelConstant.FUNC_CD_1 = "1"`] |
| 3 | SET | `EKK0011D020CBSMsg.SYSID, sysid` |
| 4 | SET | `EKK0011D020CBSMsg.MSKM_SBT_CD, "00026"` [-> `JKKSvcConst.MSKM_SBT_CD_00026 = "00026"`] |
| 5 | SET | `EKK0011D020CBSMsg.MSKM_UK_DTM, JPCBPCommon.getOpeDateTimeStamp(null)` |
| 6 | SET | `EKK0011D020CBSMsg.MSKM_YMD, opeDate` |
| 7 | SET | `EKK0011D020CBSMsg.CONSMBSN_MSKM_STAT_SKBT_CD, "04"` [-> `JKKStrConst.CD00760_04 = "04"`] |
| 8 | SET | `EKK0011D020CBSMsg.EKK0011D020CBSMSG1LIST, ekk0011d020Msg1List` |

**Block 3** — [EXEC] (L565)

> Sets the subscription form code on the child message template. Form code 01 indicates an Internet service application form.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ekk0011d020childTemplate.set(EKK0011D020CBSMsg1List.MSKM_FORM_CD, "01")` [-> `JKKStrConst.CD00591_01 = "01"`] |

**Block 4** — [CALL] (L568–L569)

> Executes the subscription content registration CBS. This is the Create (C) operation — inserts a new subscription registration record and returns the registration detail number.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callSC(handle, scCall, param, ekk0011d020In, fixedText, new EKK0011D020CBSMsg().getContents())` |

**Block 5** — [SET] (L571)

> Extracts the child message list from the CBS response for downstream processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0011d020MsgList = ekk0011d020Msg.getCAANMsgList(EKK0011D020CBSMsg.EKK0011D020CBSMSG1LIST)` |

**Block 6** — [SET / IF] (L573–L582)

> Conditionally processes the registration response. If the response contains message list entries, extracts the newly assigned registration detail number and the update timestamp. These values are then used in the subsequent follow-up business delegation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `updDtmBf = ""` |
| 2 | IF | `ekk0011d020MsgList != null && ekk0011d020MsgList.length > 0` |
| 3 | SET | `mskmDtlNo = ekk0011d020MsgList[0].getString(EKK0011D020CBSMsg1List.MSKM_DTL_NO)` |
| 4 | SET | `updDtmBf = ekk0011d020Msg.getString(EKK0011D020CBSMsg.UPD_DTM)` |

**Block 7** — [SET] (L585–L592)

> Builds the input mapping table for the detail consultation and follow-up business delegation CBS call. Uses the registration detail number and timestamp from the previous step to link the follow-up processing to the original registration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `EKK0021C060CBSMsg.TEMPLATEID, "EKK0021C060"` [-> `TEMPLATE_ID_EKK0021C060 = "EKK0021C060"`] |
| 2 | SET | `EKK0021C060CBSMsg.FUNC_CODE, "1"` [-> `JPCModelConstant.FUNC_CD_1 = "1"`] |
| 3 | SET | `EKK0021C060CBSMsg.MSKM_DTL_NO, mskmDtlNo` [from Block 6] |
| 4 | SET | `EKK0021C060CBSMsg.KZKWRK_REQYMD, JPCBPCommon.getOpeDate(null)` |
| 5 | SET | `EKK0021C060CBSMsg.UPD_DTM_BF, updDtmBf` [from Block 6] |
| 6 | SET | `EKK0021C060CBSMsg.IDO_DIV, "00052"` [-> `JKKSvcConst.IDO_DIV_IDPWD_SHKKA_SAIFURI = "00052"`] |

**Block 8** — [CALL] (L595–L596)

> Executes the detail consultation and follow-up business delegation CBS. This is the Read (R) operation — queries the registered detail and triggers downstream business processing for the ex-contractor ISP credential change.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callSC(handle, scCall, param, ekk0021c060In, fixedText, new EKK0021C060CBSMsg().getContents())` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mskmDtlNo` | Field | Subscription registration detail number — the unique identifier assigned to a newly registered subscription content record, returned by the CBS and used to link to follow-up processing |
| `mskmDtlNo` (field) | Instance Field | Subscription detail number buffer — instance-level variable storing the registration detail number across CBS calls within the same method execution |
| `updDtmBf` | Variable | Pre-update timestamp — the timestamp of the record at the time of registration, captured for audit trail and concurrency control in the follow-up business delegation |
| `opeDate` | Instance Field | Operation date — the business date set earlier in the calling flow, used as the registration date for the subscription content |
| `opeDateTimeStamp` | Value | Operation date and time stamp — the full date-time value (YYYYMMDDHHmmss) generated by `JPCBPCommon.getOpeDateTimeStamp()` for update timestamp fields |
| `TEMPLATE_ID_EKK0011D020` | Constant | Template ID "EKK0011D020" — identifies the subscription content registration message template |
| `TEMPLATE_ID_EKK0021C060` | Constant | Template ID "EKK0021C060" — identifies the detail consultation and follow-up business delegation message template |
| `FUNC_CD_1` | Constant | Function code "1" — indicates a registration/create operation in the CBS messaging framework |
| `MSKM_SBT_CD_00026` | Constant | Subscription subtype code "00026" — identifies the subscription subtype for ISP authentication ID/password change operations |
| `CD00760_04` | Constant | Status sub-type code "04" — consumption contract registration status sub-type code, indicating the registration status type for subscription content |
| `CD00591_01` | Constant | Subscription form code "01" — indicates the application form type for Internet service subscriptions |
| `IDO_DIV_IDPWD_SHKKA_SAIFURI` | Constant | Movement division code "00052" — identifies the movement type as ISP authentication ID/password initialization/reset/reissue for ex-contractors |
| `callSC` | Method | Service component invocation helper — private method that dispatches input mapping tables to the appropriate CBS service component via `ServiceComponentRequestInvoker` |
| `callNsidPwdChg` | Method | ISP authentication ID/password change — the ex-contractor variant of the authentication ID/password change workflow |
| CBS | Acronym | Common Business Service — the Fujitsu service component messaging layer used for database operations in the K-Opticom system |
| SC | Acronym | Service Component — the individual service methods invoked via the CBS messaging framework |
| CC | Acronym | Common Component — shared business logic class that is reused across multiple screens/workflows |
| CAANMsg | Class | Fujitsu message wrapper class — the generic message container used to construct and parse CBS request/response messages |
| EKKxxxx | Prefix | Fujitsu class naming convention prefix — EKK prefix indicates K-Optikom KBS (Kei-hatsu KBS) module classes |
| SYSID | Field | System identifier — distinguishes the originating system (e.g., retail channel vs. ex-contractor channel) for routing and audit purposes |
| 卸先事業者 | Business term | Ex-contractor / downstream contractor — the business partner category for which this ISP authentication ID/password change workflow operates |
| 申込内容承認登録 | Business term | Subscription content approval registration — the process of registering and approving subscription content details in the system |
| 申込明細照会・後続業務依頼 | Business term | Subscription detail consultation and follow-up business delegation — the process of querying registered subscription details and delegating downstream processing tasks |
| ISP認証IDパスワード変更 | Business term | ISP authentication ID/password change — the core business operation for managing ISP credentials for ex-contractors |
| 初期化・再振・再発行 | Business term | Initialization / re-vibration / reissue — the three sub-types of credential reset operations covered by movement division code 00052 |
