---

# Business Logic — JKKSecurityPackOperateCC.addSupportOption() [145 LOC]

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

## 1. Role

### JKKSecurityPackOperateCC.addSupportOption()

This method performs **option service contract registration** (オプションリポートサポート登録処理 — Option Report Support Registration Processing) within a security pack (JP/セキュリティパック) service ordering workflow. Its primary business purpose is to add an optional add-on service (e.g., ISP, mail, or other ancillary telecom service) to an existing security pack subscription.

The method implements a **guard-and-dispatch design pattern**. First, it performs a pre-registration guard check: it queries all existing option service contracts associated with the same service line (via `callEKK0351B002`), and if any existing contract has an active or settled status (accepted, inquired, completed, in service provision, suspended, or stopped), the method short-circuits and returns early — preventing duplicate option registration. Only when no active option service exists does it proceed to the full registration flow.

The registration flow follows a **state-driven dispatch pattern**: after retrieving the service contract agreement (`callEKK0081A010`) and billing contract number (`callEKK0321B002`), it registers the option service with ISP (`editInMsgEKK0391D010`), then branches based on the service contract status (`svcKeiStat`):
- **Status 020 (Inquired)** — Performs contract review processing only.
- **Status 030 (Completed)** — Performs contract review completion processing.
- **Status 100 or lower (In Service Provision or earlier)** — Performs both contract review completion and contract start, with a sub-branch determining whether the start is immediate or next-month based on whether the application date matches or exceeds the start date.

The method also handles **service inheritance** (継承有無) — if the originating service was inherited from another (`hikitugiUm == "1"`), it locates the matching inheritance destination option service record to populate contextual data.

Its role in the larger system is a **shared component method** called by other methods within `JKKSecurityPackOperateCC` (specifically `adChgMain()` and `main()`). It is the core business logic hub that orchestrates the multi-step registration of an option service, coordinating with multiple SC (Service Component) methods for data retrieval, message mapping, and contract lifecycle transitions.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["addSupportOption opSvcCd svcKeiNo pcrsCd pplanCd updDtmBf startYmd"])

    START --> LOG["printlnEjbLog Log start"]
    LOG --> INIT["Initialize retMsg retMsgList ekk0391a010"]
    INIT --> GETAPLY["Get aplyYmd from ccWorkMap OPE_DATE"]
    GETAPLY --> GETSKY["Initialize skj_ykgt to empty string"]
    GETSKY --> CALLLIST["callEKK0351B002 Get option service contract list"]
    CALLLIST --> SETFLG["Set addFlg true"]
    SETFLG --> COMPDATE["Compare aplyYmd vs startYmd to isSokujitsu"]
    COMPDATE --> FORLOOP["Loop for each ekk0351b002 in retMsgList"]

    FORLOOP --> CHECKOP{opSvcCd equals ekk0351b002.OP_SVC_CD}
    CHECKOP -- No --> FORNEXT["Next iteration"]
    CHECKOP -- Yes --> GETSTAT["Get dslOpSvcKeiStat from ekk0351b002"]

    GETSTAT --> CHECKSTAT{SVC_KEI_STAT check}

    CHECKSTAT --> S010["SVC_KEI_STAT_010 Accepted"]
    CHECKSTAT --> S020["SVC_KEI_STAT_020 Inquired"]
    CHECKSTAT --> S030["SVC_KEI_STAT_030 Completed"]
    CHECKSTAT --> S100["SVC_KEI_STAT_100 Providing"]
    CHECKSTAT --> S210["SVC_KEI_STAT_210 Suspended"]
    CHECKSTAT --> S220["SVC_KEI_STAT_220 Stopped"]

    S010 --> SETFALSE["Set addFlg false"]
    S020 --> SETFALSE
    S030 --> SETFALSE
    S100 --> SETFALSE
    S210 --> SETFALSE
    S220 --> SETFALSE

    SETFALSE --> FORNEXT

    FORNEXT --> CHECKADDFLG{addFlg equals false}
    CHECKADDFLG -- Yes --> EARLYRET["Return updDtmBf skip registration"]
    CHECKADDFLG -- No --> CALLEKK0081["callEKK0081A010 Get service contract agreement"]

    CALLEKK0081 --> CALLEKK0321["callEKK0321B002 Get billing contract number"]
    CALLEKK0321 --> GETHIKITUGI["Get hikitugiUm from ccWorkMap KEY_HIKITUGI_UM"]
    GETHIKITUGI --> CHECKHIKI{hikitugiUm equals 1}

    CHECKHIKI -- No --> CALLEDD010["editInMsgEKK0391D010 Register option service ISP"]
    CHECKHIKI -- Yes --> HIKNEXT["Loop find matching ekk0391a010 in hikiSakiOpSvcKeiList"]

    HIKNEXT --> HIKIFIND{e361 opSvcCd equals input opSvcCd}
    HIKIFIND -- No --> HIKINEXT2["Next iteration"]
    HIKIFIND -- Yes --> HIKISETE["Set ekk0391a010 from work"]
    HIKINEXT2 --> HIKIDONE

    HIKISETE --> HIKIDONE
    HIKIDONE --> CALLEDD010

    CALLEDD010 --> GETSVCSTAT["Get svcKeiStat from ekk0081a010"]
    GETSVCSTAT --> GETOPKNO["Get opSvcKeiNo from retMsg"]
    GETOPKNO --> GETUPDDTM["Get updDtmBf from retMsg"]

    GETUPDDTM --> CHECKSTAT2{svcKeiStat check}

    CHECKSTAT2 --> COND020{"svcKeiStat equals SVC_KEI_STAT_020"}
    COND020 --> EXEC030["editInMsgEKK0391C010 Contract review"]
    EXEC030 --> RET030["Get updDtmBf from retMsg"]

    RET030 --> COND030{"svcKeiStat equals SVC_KEI_STAT_030"}
    COND030 --> EXEC030B["editInMsgEKK0391C030 Contract review completion"]
    EXEC030B --> RET030B["Get updDtmBf from retMsg"]

    RET030B --> COND100{"svcKeiStat less than or equals SVC_KEI_STAT_100"}
    COND100 --> CHECKIMMED{isSokujitsu}
    CHECKIMMED -- Yes --> SETSKY01["Set skj_ykgt 01 immediate"]
    CHECKIMMED -- No --> SETSKY02["Set skj_ykgt 02 next month"]

    SETSKY01 --> EXEC030C["editInMsgEKK0391C030 Review completion"]
    SETSKY02 --> EXEC030C
    EXEC030C --> RET030C["Get updDtmBf from retMsg"]
    RET030C --> EXEC040["editInMsgEKK0391C040 Contract start"]
    EXEC040 --> RET040["Get updDtmBf from retMsg"]

    RET030 --> SETPRG["Set prgStat based on isSokujitsu"]
    RET030B --> SETPRG
    RET040 --> SETPRG

    SETPRG --> SETPRGSTAT{isSokujitsu}
    SETPRGSTAT -- Yes --> P5102["prgStat equals PRG_STAT_5102"]
    SETPRGSTAT -- No --> P5101["prgStat equals PRG_STAT_5101"]

    P5102 --> ADDPRG["addPrg Register progress info"]
    P5101 --> ADDPRG
    ADDPRG --> LOGEND["printlnEjbLog Log end"]
    LOGEND --> FINALRET["Return updDtmBf"]

    EARLYRET --> END(["End"])
    FINALRET --> END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `opSvcCd` | `String` | Option service code — identifies which specific optional add-on service (e.g., ISP, mail, ENUM) is being registered within the security pack. Used to match against existing option service contracts during the guard check and to identify the correct inheritance destination record. |
| 2 | `svcKeiNo` | `String` | Service line number — the primary service identifier for the security pack subscription. Serves as the key to query existing option service contracts (`callEKK0351B002`), retrieve the service contract agreement (`callEKK0081A010`), and obtain the billing contract number (`callEKK0321B002`). |
| 3 | `pcrsCd` | `String` | Plan code — the specific service plan/option plan assigned to the option service being registered. Passed to the ISP registration method to associate the correct pricing plan. |
| 4 | `pplanCd` | `String` | Product plan code — the broader product plan classification for the option service. Used in conjunction with `pcrsCd` to fully define the service plan context for the registration. |
| 5 | `updDtmBf` | `String` | Update date-time before — the current update timestamp, carried through the method and updated at each processing step. Returned as the final result representing the latest update timestamp after all registration operations. |
| 6 | `startYmd` | `String` | Start year-month-date — the planned service start date (YYYYMMDD format). Compared against the application date (`aplyYmd`) from `ccWorkMap[OPE_DATE]` to determine if processing should be immediate (即日用) or next-month (翌月用). Also serves as the start date in the ISP registration call. |

**External state / instance fields read:**

| Field | Source | Business Description |
|-------|--------|---------------------|
| `ccWorkMap.get(OPE_DATE)` [-> `OPE_DATE`] | Local map access | Application date (運用日) — the operational date from the work context map, used to determine immediate vs. next-month processing. |
| `ccWorkMap.get(KEY_HIKITUGI_UM)` [-> `KEY_HIKITUGI_UM`] | Local map access | Inheritance presence flag (継承有無) — when `"1"`, indicates the service was inherited from another, triggering inheritance-specific processing. [-> KEY_HIKITUGI_UM="hikitugi_um" (JKKSecurityPackOperateCC.java)] |
| `ccWorkMap.get("hikiSakiOpSvcKeiList")` | Local map access | Inheritance destination option service line list — list of option service records for inherited services, iterated to find the matching option service code. |
| `ccWorkMap.get("mskm_dtl_no_add")` | Local map access | Detail number for progress registration — used when registering the progress info via `addPrg`. |
| `isSokujitsu` | Instance field | Immediate processing flag (即日用フラグ) — set by comparing `aplyYmd` vs `startYmd`; determines timing-related behavior throughout the method. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `mapper.callEKK0351B002` | EKK0351B002SC | KK_T_OPSVKEI_ISP / Option service contract table | Reads the list of option service contracts for the given service line (`svcKeiNo`) to check for existing active options. Returns `CAANMsg[]` for guard-check against `opSvcCd`. |
| R | `callEKK0081A010` | EKK0081A010SC | KK_T_SVC_KEI / Service contract table | Retrieves the service contract agreement data for the service line, including the service contract status (`SVC_KEI_STAT`) used to drive the dispatch logic. |
| R | `callEKK0321B002` | EKK0321B002SC | KK_T_SEIKY_KEI / Billing contract table | Retrieves the billing contract number (請求契約番号) associated with the service line, needed for progress registration. |
| C | `mapper.editInMsgEKK0391D010` | EKK0391D010SC | KK_T_OPSVKEI_ISP / Option service ISP contract table | Registers (creates) the option service with ISP — creates a new option service contract record with plan code, product plan, update date-time, service line, billing contract number, and start date. Returns the generated option service line number (`opSvcKeiNo`). |
| U | `mapper.editInMsgEKK0391C010` | EKK0391C010SC | KK_T_OPSVKEI / Option service contract table | Performs contract review processing (オプションサービス契約照会処理) for status 020 — updates the option service contract to reflect the inquiry/review state. |
| U | `mapper.editInMsgEKK0391C030` | EKK0391C030SC | KK_T_OPSVKEI / Option service contract table | Performs contract review completion processing (オプションサービス契約<ISP>照会結合) — transitions the option service contract to completed review state. Called in both the 030 branch and the 100 branch. |
| U | `mapper.editInMsgEKK0391C040` | EKK0391C040SC | KK_T_OPSVKEI / Option service contract table | Performs contract start processing (オプションサービス契約開始処理) — activates the option service contract with the start timing flag (`skj_ykgt`: 01=immediate, 02=next month). Only executed in the 100+ status branch. |
| C | `addPrg` | N/A | KK_T_PRG / Progress table | Registers the progress information for the option service addition, linking the service line, billing contract, option service line, and progress status (5101=next month or 5102=immediate). |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JKKSecurityPackOperateCC.adChgMain()` | `adChgMain()` -> `addSupportOption(opSvcCd, svcKeiNo, pcrsCd, pplanCd, updDtmBf, startYmd)` | `callEKK0351B002 [R] OptionServiceContract`, `callEKK0081A010 [R] ServiceContract`, `callEKK0321B002 [R] BillingContract`, `editInMsgEKK0391D010 [C] OptionServiceISP`, `editInMsgEKK0391C010 [U] OptionServiceContract`, `editInMsgEKK0391C030 [U] OptionServiceContract`, `editInMsgEKK0391C040 [U] OptionServiceContract`, `addPrg [C] ProgressInfo` |
| 2 | Method: `JKKSecurityPackOperateCC.main()` | `main()` -> `addSupportOption(opSvcCd, svcKeiNo, pcrsCd, pplanCd, updDtmBf, startYmd)` | `callEKK0351B002 [R] OptionServiceContract`, `callEKK0081A010 [R] ServiceContract`, `callEKK0321B002 [R] BillingContract`, `editInMsgEKK0391D010 [C] OptionServiceISP`, `editInMsgEKK0391C010 [U] OptionServiceContract`, `editInMsgEKK0391C030 [U] OptionServiceContract`, `editInMsgEKK0391C040 [U] OptionServiceContract`, `addPrg [C] ProgressInfo` |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize variables (L2214-L2220)

> Initializes local variables and retrieves the application date from the work context map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `retMsg = null` |
| 2 | SET | `retMsgList = null` |
| 3 | SET | `ekk0391a010 = null` |
| 4 | SET | `aplyYmd = ccWorkMap.get(OPE_DATE)` [-> `OPE_DATE`] // Application date (運用日) |
| 5 | SET | `skj_ykgt = ""` // Start timing flag, initialized to empty string |
| 6 | EXEC | `printlnEjbLog("JKKSecurityPackOperateCC.addSupportOption start")` |

**Block 2** — [CALL] Query existing option service contracts (L2222-L2223)

> Retrieves all option service contracts associated with the service line to check for duplicates.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `retMsgList = mapper.callEKK0351B002(JPCModelConstant.FUNC_CD_1, svcKeiNo)` [-> `JPCModelConstant.FUNC_CD_1`] // Option service contract list query |
| 2 | SET | `addFlg = true` // Registration allowed flag, default true |

**Block 3** — [SET] Determine immediate processing flag (L2226-L2227)

> Compares the application date against the start date to set the immediate processing flag.

| # | Type | Code |
|---|------|------|
| 1 | SET | `isSokujitsu = (aplyYmd.compareTo(startYmd) >= 0)` // True if application date >= start date (即日用フラグ) |

**Block 4** — [FOR LOOP] Check existing option service contract status (L2229-L2252)

> Iterates through the returned option service contract list to check if the target option service already exists with an active status. If found with an active status, sets `addFlg = false` to skip registration.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (CAANMsg ekk0351b002 : retMsgList)` |
| 2 | IF | `opSvcCd.equals(ekk0351b002.getString(EKK0351B002CBSMsg1List.OP_SVC_CD))` // Option service matches |

**Block 4.1** — [IF] Match found — get contract status (L2232-L2233)

> When the option service code matches, retrieves the current service contract status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dslOpSvcKeiStat = ekk0351b002.getString(EKK0351B002CBSMsg1List.OP_SVC_KEI_STAT)` // Current contract status |

**Block 4.2** — [IF] Check against active statuses (L2240-L2249)

> If the contract status is any recognized active/completed status, registration is blocked. [-> `SVC_KEI_STAT_010`], [-> `SVC_KEI_STAT_020`], [-> `SVC_KEI_STAT_030`], [-> `SVC_KEI_STAT_100`], [-> `SVC_KEI_STAT_210`], [-> `SVC_KEI_STAT_220`]

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_KEI_STAT_010.equals(dslOpSvcKeiStat)` [-> `SVC_KEI_STAT_010="010"`] // Accepted (受付済) |
| 2 | SET | `addFlg = false` |
| 3 | IF | `SVC_KEI_STAT_020.equals(dslOpSvcKeiStat)` [-> `SVC_KEI_STAT_020="020"`] // Inquired (照会済) |
| 4 | SET | `addFlg = false` |
| 5 | IF | `SVC_KEI_STAT_030.equals(dslOpSvcKeiStat)` [-> `SVC_KEI_STAT_030="030"`] // Completed (結済) |
| 6 | SET | `addFlg = false` |
| 7 | IF | `SVC_KEI_STAT_100.equals(dslOpSvcKeiStat)` [-> `SVC_KEI_STAT_100="100"`] // In Service Provision (サービス提供中) |
| 8 | SET | `addFlg = false` |
| 9 | IF | `SVC_KEI_STAT_210.equals(dslOpSvcKeiStat)` [-> `SVC_KEI_STAT_210="210"`] // Suspended/Interrupted (休止・中断中) |
| 10 | SET | `addFlg = false` |
| 11 | IF | `SVC_KEI_STAT_220.equals(dslOpSvcKeiStat)` [-> `SVC_KEI_STAT_220="220"`] // Stopped (停止中) |
| 12 | SET | `addFlg = false` |

**Block 5** — [IF] Early return guard (L2255-L2257)

> If `addFlg` is false (existing option service found), returns the unchanged `updDtmBf` to skip the entire registration flow. Japanese comment: "オプションサービスが生きている場合、登録処理を行わない。" (When an option service exists, do not perform registration processing.)

| # | Type | Code |
|---|------|------|
| 1 | IF | `addFlg == false` |
| 2 | RETURN | `updDtmBf` // Skip registration — early return |

**Block 6** — [CALL] Fetch service contract and billing info (L2260-L2263)

> When registration proceeds, retrieves the service contract agreement data and the billing contract number.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `ekk0081a010 = callEKK0081A010(svcKeiNo)` // Service contract agreement query |
| 2 | CALL | `seikyKeiNo = callEKK0321B002(svcKeiNo)` // Billing contract number query |

**Block 7** — [SET] Check inheritance flag (L2266-L2267)

> Retrieves the inheritance presence flag from the work context map. [-> `KEY_HIKITUGI_UM`="hikitugi_um" (JKKSecurityPackOperateCC.java)]

| # | Type | Code |
|---|------|------|
| 1 | SET | `hikitugiUm = ccWorkMap.get(KEY_HIKITUGI_UM)` [-> `KEY_HIKITUGI_UM`] // Inheritance presence (継承有無) |

**Block 8** — [IF] Inheritance processing (L2270-L2281)

> When the service was inherited (`hikitugiUm == "1"`), searches the inheritance destination list to find the matching option service record. Japanese comment: "継承有無「有」の場合" (When inheritance is present).

| # | Type | Code |
|---|------|------|
| 1 | IF | `hikitugiUm.equals("1")` // Inheritance present |
| 2 | SET | `hikiSakiOpSvcKeiList = new ArrayList<CAANMsg>()` |
| 3 | SET | `ekk0391a010 = null` |
| 4 | SET | `hikiSakiOpSvcKeiList = (ArrayList<CAANMsg>)ccWorkMap.get("hikiSakiOpSvcKeiList")` |
| 5 | FOR | `for (CAANMsg ekk0361a010work : hikiSakiOpSvcKeiList)` |

**Block 8.1** — [IF] Find matching option service in inheritance list (L2274-L2276)

> Searches the inheritance destination list for a record matching the input `opSvcCd`.

| # | Type | Code |
|---|------|------|
| 1 | IF | `(String)ekk0361a010work.getString(EKK0351A010CBSMsg1List.OP_SVC_CD).equals(opSvcCd)` |
| 2 | SET | `ekk0391a010 = ekk0361a010work` // Set matching inheritance destination record |

**Block 9** — [CALL] Register option service with ISP (L2284-L2285)

> Core registration: creates the option service ISP contract record. Japanese comment: "オプションサービス＜ISP＞登録" (Option Service <ISP> Registration).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `retMsg = mapper.editInMsgEKK0391D010(FUNC_CD_1, ccWorkMap, opSvcCd, pcrsCd, pplanCd, updDtmBf, svcKeiNo, seikyKeiNo, startYmd, ekk0391a010)` [-> `JPCModelConstant.FUNC_CD_1`] |

**Block 10** — [SET] Extract results from registration (L2287-L2291)

> Extracts the service contract status, option service line number, and updated date-time from the registration result and service agreement.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiStat = ekk0081a010.getString(EKK0081A010CBSMsg1List.SVC_KEI_STAT)` // Service contract status |
| 2 | SET | `opSvcKeiNo = retMsg.getString(EKK0391D010CBSMsg.OP_SVC_KEI_NO)` // Option service line number |
| 3 | SET | `updDtmBf = retMsg.getString(EKK0391D010CBSMsg.UPD_DTM)` // Update date-time |

**Block 11** — [IF/ELSE-IF/ELSE-IF] Status-driven dispatch for contract lifecycle (L2294-L2334)

> Dispatches to different contract processing paths based on the retrieved service contract status. Japanese comments: "オプションサービス契約照会処理" (Contract review), "オプションサービス契約結合処理" (Contract completion), "オプションサービス契約開始処理" (Contract start).

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_KEI_STAT_020.compareTo(svcKeiStat) == 0` [-> `SVC_KEI_STAT_020="020"`] |

**Block 11.1** — [IF] Status 020 — Contract review (L2295-L2298)

> Status 020 (Inquired): Performs contract review processing only.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `retMsg = mapper.editInMsgEKK0391C010(FUNC_CD_1, ccWorkMap, opSvcKeiNo, updDtmBf)` [-> `JPCModelConstant.FUNC_CD_1`] // Contract review processing |
| 2 | SET | `updDtmBf = retMsg.getString(EKK0391C010CBSMsg.UPD_DTM)` |

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `SVC_KEI_STAT_030.compareTo(svcKeiStat) == 0` [-> `SVC_KEI_STAT_030="030"`] |

**Block 11.2** — [ELSE-IF] Status 030 — Contract review completion (L2302-L2306)

> Status 030 (Completed): Performs contract review completion processing (review + binding). Japanese comment: "オプションサービス契約＜ISP＞照会結合" (Option Service <ISP> Review Completion).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `retMsg = mapper.editInMsgEKK0391C030(FUNC_CD_1, ccWorkMap, opSvcKeiNo, updDtmBf)` [-> `JPCModelConstant.FUNC_CD_1`] |
| 2 | SET | `updDtmBf = retMsg.getString(EKK0391C030CBSMsg.UPD_DTM)` |

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `SVC_KEI_STAT_100.compareTo(svcKeiStat) <= 0` [-> `SVC_KEI_STAT_100="100"`] |

**Block 11.3** — [ELSE-IF] Status 100 or earlier — Contract review completion + start (L2310-L2328)

> Status 100 (In Service Provision) or earlier: Performs both contract review completion AND contract start. The start timing depends on immediate vs. next-month. Japanese comment: "オプションサービス契約開始処理" (Contract Start Processing).

| # | Type | Code |
|---|------|------|
| 1 | IF | `isSokujitsu` // Immediate processing? |
| 2 | SET | `skj_ykgt = "01"` [-> Immediate (即日)] |
| 3 | ELSE | `skj_ykgt = "02"` [-> Next month (翌月)] |
| 4 | CALL | `retMsg = mapper.editInMsgEKK0391C030(FUNC_CD_1, ccWorkMap, opSvcKeiNo, updDtmBf)` // Review completion |
| 5 | SET | `updDtmBf = retMsg.getString(EKK0391C030CBSMsg.UPD_DTM)` |
| 6 | CALL | `retMsg = mapper.editInMsgEKK0391C040(FUNC_CD_1, ccWorkMap, opSvcKeiNo, updDtmBf, skj_ykgt)` // Contract start with timing flag |
| 7 | SET | `updDtmBf = retMsg.getString(EKK0391C040CBSMsg.UPD_DTM)` |

**Block 12** — [SET] Set progress status (L2331-L2339)

> Determines the progress status code based on whether processing is immediate or next-month. Japanese comment: " 진행 스테이투스" (Progress Status).

| # | Type | Code |
|---|------|------|
| 1 | IF | `isSokujitsu` // Immediate processing |
| 2 | SET | `prgStat = PRG_STAT_5102` [-> `PRG_STAT_5102="5102"`] // Immediate progress status |
| 3 | ELSE | `prgStat = PRG_STAT_5101` [-> `PRG_STAT_5101="5101"`] // Next-month progress status |

**Block 13** — [CALL] Register progress information (L2342)

> Registers the progress record for the option service addition, linking all relevant service identifiers and the determined progress status. Japanese comment: "進度登録用のリストを設定" (Set list for progress registration).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `addPrg(KEY_ADD_INFO_LIST, ccWorkMap.get("mskm_dtl_no_add"), seikyKeiNo, opSvcKeiNo, svcKeiNo, "", "", opSvcCd, prgStat)` [-> `KEY_ADD_INFO_LIST="addInfoList"` (JKKSecurityPackOperateCC.java)] |

**Block 14** — [SET] Log and return (L2344-L2347)

> Logs completion and returns the final update date-time.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `printlnEjbLog("JKKSecurityPackOperateCC.addSupportOption end")` |
| 2 | RETURN | `updDtmBf` // Latest update date-time |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `opSvcCd` | Field | Option service code — identifies the specific optional add-on service type being registered (e.g., ISP, mail service) |
| `svcKeiNo` | Field | Service line number — the unique identifier for a service line within a security pack subscription |
| `pcrsCd` | Field | Plan code — the specific pricing/service plan assigned to the option service |
| `pplanCd` | Field | Product plan code — the broader product classification for the option service plan |
| `updDtmBf` | Field | Update date-time before — the current update timestamp carried through processing; updated at each step |
| `startYmd` | Field | Start year-month-date — the planned service activation date in YYYYMMDD format |
| `aplyYmd` | Field | Application year-month-date — the operational date from the work context map (運用日) |
| `skj_ykgt` | Field | Start timing flag (開始時機) — "01" for immediate start (即日), "02" for next-month start (翌月) |
| `isSokujitsu` | Field | Immediate processing flag (即日用フラグ) — set true when application date >= start date |
| `hikitugiUm` | Field | Inheritance presence (継承有無) — "1" means the service was inherited from another source |
| `addFlg` | Field | Registration allowed flag — false when an active option service already exists, blocking registration |
| `prgStat` | Field | Progress status code — "5101" for next-month progress, "5102" for immediate progress |
| `SVC_KEI_STAT_010` | Constant | Service line status 010: Accepted (受付済) — initial accepted state |
| `SVC_KEI_STAT_020` | Constant | Service line status 020: Inquired (照会済) — contract inquiry completed |
| `SVC_KEI_STAT_030` | Constant | Service line status 030: Completed (結済) — contract finalized |
| `SVC_KEI_STAT_100` | Constant | Service line status 100: In Service Provision (サービス提供中) — actively providing service |
| `SVC_KEI_STAT_210` | Constant | Service line status 210: Suspended/Interrupted (休止・中断中) — temporarily suspended |
| `SVC_KEI_STAT_220` | Constant | Service line status 220: Stopped (停止中) — fully stopped |
| `PRG_STAT_5101` | Constant | Progress status 5101: Next-month processing (翌月処理) |
| `PRG_STAT_5102` | Constant | Progress status 5102: Immediate processing (即日処理) |
| `KEY_HIKITUGI_UM` | Constant | Work map key for inheritance flag — maps to the inheritance presence value |
| `OPE_DATE` | Constant | Work map key for application date (運用日) — the operational date context |
| `KEY_ADD_INFO_LIST` | Constant | Work map key for progress registration info list |
| EKK0351B002 | SC | Option service contract list acquisition — queries existing option service contracts by service line |
| EKK0081A010 | SC | Service contract agreement acquisition — retrieves service contract data including status |
| EKK0321B002 | SC | Billing contract number acquisition — retrieves the billing contract associated with a service line |
| EKK0391D010 | SC | Option service ISP registration — creates a new option service contract with ISP |
| EKK0391C010 | SC | Option service contract review — updates contract to review/inquiry state |
| EKK0391C030 | SC | Option service contract review completion — finalizes the review binding for ISP |
| EKK0391C040 | SC | Option service contract start — activates the contract with specified start timing |
| EKK0351A010CBSMsg1List | CBS Message | Message list class for EKK0351A010 — provides access to option service contract fields |
| EKK0351B002CBSMsg1List | CBS Message | Message list class for EKK0351B002 — provides access to option service contract query result fields |
| EKK0081A010CBSMsg1List | CBS Message | Message list class for EKK0081A010 — provides access to service contract agreement fields |
| EKK0391D010CBSMsg | CBS Message | Message class for EKK0391D010 — provides access to option service registration result fields |
| EKK0391C010CBSMsg | CBS Message | Message class for EKK0391C010 — provides access to contract review result fields |
| EKK0391C030CBSMsg | CBS Message | Message class for EKK0391C030 — provides access to contract completion result fields |
| EKK0391C040CBSMsg | CBS Message | Message class for EKK0391C040 — provides access to contract start result fields |
| CAANMsg | Type | FALCON framework message object — used for inter-component data transfer |
| FUNC_CD_1 | Constant | Function code 1 — standard function code constant for processing mode |
| JP | Abbreviation | Japan — referring to Japan telecom services context |
| ISP | Business term | Internet Service Provider — the internet connectivity add-on service |
| CC | Abbreviation | Common Component — a shared processing class in the FALCON framework architecture |
| SC | Abbreviation | Service Component — a layer in the FALCON architecture that encapsulates business logic and SC code routing |
| CBS | Abbreviation | CBS (Contract Business System) — the underlying telecom billing/ordering system accessed via message interfaces |
| JPCModelConstant | Class | FALCON framework constant class providing standard model constants like function codes |

---
