---
title: Business Logic - MsgEditer.createParameter()
description: Detailed design document for MsgEditer.createParameter() method
---

# Business Logic - MsgEditer.createParameter() [37 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.MsgEditer` |
| Layer | CC/Common Component (Package: `com.fujitsu.futurity.bp.custom.common`) |
| Module | `common` |
| File | `JKKWribSvcKeiOperateCC.java` (contains the `MsgEditer` helper class) |

---

## 1. Role

### MsgEditer.createParameter()

This method serves as a **message parameter factory** for service interface calls within the Fujitsu Futurity telecommunications service contract system. Its primary responsibility is to construct a fully initialized `CAANMsg` (CAAN Message) object that carries the request parameters required to invoke a back-end service component (SC) or business logic layer method.

The method operates using a **builder + template-based dispatch pattern**: it accepts a schema class (which defines the structure/contract of the target service call), extracts an 11-character template ID from the schema class name (used to route the message to the correct service handler), and populates the message with standardized operational metadata extracted from the request context (operator ID, operation date, and operation date-time).

As a shared utility, `createParameter()` is a foundational building block called by **74+ downstream methods** across multiple controller classes (`JKKWribSvcKeiOperateCC`, `JKKMineoSetPlanWribCC`). Every method that needs to invoke a service interface must first obtain a properly initialized parameter message by calling `createParameter()`. This centralizes the operational metadata injection logic, ensuring consistent traceability headers across all service invocations.

The method has a single linear code path with one try-catch block for robustness -- no conditional branching on business data values. The schema class determines *what* service is being called, while the `funcCd` (function code) determines *which business operation* within that service is being requested.

---

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["createParameter(context, schema, funcCd)"])
    STEP1["Extract schema.getName() -> schemaName"]
    STEP2["Extract schema.getSimpleName() -> simpleName"]
    STEP3["Create CAANMsg parameter with schemaName"]
    STEP4["initiailzeCAANMsg(parameter) - nullify all schema keys"]
    STEP5["Extract templateID from simpleName.substring(0, 11)"]
    STEP6["Set TEMPLATE_ID_KEY = templateID"]
    STEP7["Set FUNC_CODE_KEY = funcCd"]
    STEP8["Try block - extract operational metadata from context"]
    STEP9["Get OPERATOR_ID from context.getControlMapData(OPERATOR_ID)"]
    STEP10["Set OPERATOR_ID_KEY = operatorId"]
    STEP11["Get OPE_DATE from context.getControlMapData(OPE_DATE)"]
    STEP12["Set OPERATE_DATE_KEY = operateDate"]
    STEP13["Get OPE_TIME from context.getControlMapData(OPE_TIME)"]
    STEP14["Set OPERATE_DATETIME_KEY = operateDateTime"]
    STEP15["RequestParameterException thrown"]
    STEP16["Wrap in RuntimeException and rethrow"]
    STEP17["Return fully-initialized CAANMsg parameter"]

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> STEP6 --> STEP7 --> STEP8 --> STEP9 --> STEP10 --> STEP11 --> STEP12 --> STEP13 --> STEP14 --> STEP17
    STEP15 --> STEP16 --> STEP17
```

**Processing Flow Summary:**

1. **Schema Inspection** -- Extracts the full class name and simple name from the provided schema class. The full name is used as the schema type identifier for the `CAANMsg` constructor.
2. **Message Initialization** -- Creates a new `CAANMsg` instance and initializes all keys defined by the schema to null values (clean slate).
3. **Template ID Assignment** -- Extracts the first 11 characters of the schema's simple name as a template ID. This acts as a message routing key for the service layer.
4. **Function Code Assignment** -- Sets the function code (`funcCd`) parameter into the message, identifying the specific business operation being requested.
5. **Operational Metadata Injection** -- Retrieves the operator ID, operation date, and operation date-time from the request context's control map, and sets them into the message.
6. **Return** -- Returns the fully prepared `CAANMsg` for use in a downstream service interface call.

---

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `context` | `IRequestParameterReadWrite` | The request execution context that carries operational metadata for the current business transaction. It holds the operator ID (who is performing the action), the operation date (business date of the transaction), and the operation date-time (exact timestamp). This context is shared across all processing steps of a single screen or batch invocation, ensuring consistent audit trail data. |
| 2 | `schema` | `Class<? extends CAANSchemaInfo>` | The schema class defining the structure and contract of the service interface message being built. It determines the parameter keys that will exist in the resulting `CAANMsg`, and the first 11 characters of its simple name serve as a template routing ID for the service layer. Each service call (registration, cancellation, inquiry, etc.) has its own dedicated schema class. |
| 3 | `funcCd` | `String` | The function code identifying the specific business operation to be executed by the target service. For example, values like `"01"` (service contract registration), `"02"` (dissolution/cancellation), `"03"` (change/modification) determine which business logic path the service layer will follow. This code is embedded into the message and passed to the SC/CBS layer. |

**External State / Instance Fields Read:** None. This method is `static` and relies solely on its parameters.

---

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `MsgEditer.initiailzeCAANMsg` | - | - | Internal utility call that initializes all schema-defined keys in the `CAANMsg` to null values, preparing a clean message for parameter population. |
| R | `IRequestParameterReadWrite.getControlMapData` | - | - | Reads operational metadata (operator ID, operation date, operation date-time) from the request context's control map. This is a read from an in-memory request-scoped data store, not a database query. |

**Notes:**
- This method does **not** directly access any database tables or external SC/CBS endpoints. It constructs a message object that will be passed to downstream service calls (which are defined by the `schema` parameter and invoked by the caller).
- The actual CRUD operations are performed by the **callers** of this method, which pass the returned `CAANMsg` to their respective service components.

---

## 5. Dependency Trace

### Direct Callers of createParameter()

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKWribSvcKeiOperateCC.createWribSvcKeiTouroku` | `createWribSvcKeiTouroku` -> `createParameter` | Service call for service contract registration |
| 2 | CBS: `JKKWribSvcKeiOperateCC.createDchskmst` | `createDchskmst` -> `createParameter` | Service call for deduction item master registration |
| 3 | CBS: `JKKWribSvcKeiOperateCC.createDchskmstTgKei` | `createDchskmstTgKei` -> `createParameter` | Service call for target deduction service |
| 4 | CBS: `JKKWribSvcKeiOperateCC.cancelWribSvcKei` | `cancelWribSvcKei` -> `createParameter` | Service call for service contract cancellation |
| 5 | CBS: `JKKWribSvcKeiOperateCC.dissolutionWribSvcKei` | `dissolutionWribSvcKei` -> `createParameter` | Service call for service contract dissolution |
| 6 | CBS: `JKKWribSvcKeiOperateCC.dissolutionFixWribSvcKei` | `dissolutionFixWribSvcKei` -> `createParameter` | Service call for fixing service contract dissolution |
| 7 | CBS: `JKKWribSvcKeiOperateCC.recoverWribInf` | `recoverWribInf` -> `createParameter` | Service call for recovering service information |
| 8 | CBS: `JKKWribSvcKeiOperateCC.recoverWribTrgtInf` | `recoverWribTrgtInf` -> `createParameter` | Service call for recovering target service information |
| 9 | CBS: `JKKWribSvcKeiOperateCC.createMskmWithNaiyoShoninAdd` | `createMskmWithNaiyoShoninAdd` -> `createParameter` | Service call for contract master with content approval addition |
| 10 | CBS: `JKKWribSvcKeiOperateCC.createKakins` | `createKakins` -> `createParameter` | Service call for data registration |
| 11 | CBS: `JKKWribSvcKeiOperateCC.createPrg` | `createPrg` -> `createParameter` | Service call for PRG (program/service plan) handling |
| 12 | CBS: `JKKWribSvcKeiOperateCC.checkTablet` | `checkTablet` -> `createParameter` | Service call for tablet device check |
| 13 | CBS: `JKKWribSvcKeiOperateCC.getEKK0241B002` | `getEKK0241B002` -> `createParameter` | SC: EKK0241B002 -- Service inquiry |
| 14 | CBS: `JKKWribSvcKeiOperateCC.getEKK0451B002` | `getEKK0451B002` -> `createParameter` | SC: EKK0451B002 -- Service inquiry |
| 15 | CBS: `JKKWribSvcKeiOperateCC.getEKK1401B010` | `getEKK1401B010` -> `createParameter` | SC: EKK1401B010 -- Service inquiry |

**Additional callers** (from `JKKMineoSetPlanWribCC`): `getWorkParamKnri()`, `getWribSvc()` -- These also use `createParameter()` to build messages for mineo (mobile virtual network operator) plan service calls.

**Downstream impact:** This method is a leaf in the dependency chain -- it produces a message object but does not invoke any SC/CBS directly. The actual database operations occur in the **callers** after they receive the `CAANMsg` and pass it to their service layer methods.

---

## 6. Per-Branch Detail Blocks

### Block 1 -- Processing (L16506)

> Extract schema metadata and initialize the message object.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `schemaName = schema.getName()` | [-> FULL CLASS NAME] Extracts the fully qualified class name of the schema for use as the message schema type identifier |
| 2 | SET | `simpleName = schema.getSimpleName()` | [-> SHORT CLASS NAME] Extracts the simple (unqualified) class name; the first 11 characters become the template routing ID |
| 3 | CALL | `parameter = new CAANMsg(schemaName)` | Instantiates a new `CAANMsg` with the schema type, establishing the message contract |
| 4 | CALL | `initiailzeCAANMsg(parameter)` | Initializes all schema-defined keys to null, preparing a clean slate for parameter population |

### Block 2 -- Processing (L16516)

> Set the template ID and function code -- the two primary routing identifiers for the service layer.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `templateID = simpleName.substring(0, 11)` | Extracts the first 11 characters of the schema class name as a template ID used by the service framework to route the message to the correct handler |
| 2 | EXEC | `parameter.set(JCMConstants.TEMPLATE_ID_KEY, templateID)` | Sets the template ID into the message under the standard template ID key |
| 3 | EXEC | `parameter.set(JCMConstants.FUNC_CODE_KEY, funcCd)` | Sets the function code (business operation code) into the message, identifying which specific operation the service should perform |

### Block 3 -- TRY-CATCH (L16519)

> Inject operational metadata (operator ID, operation date, date-time) from the request context for audit trail and traceability.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `operatorId = context.getControlMapData(SCControlMapKeys.OPERATOR_ID)` | Retrieves the operator ID of the user performing the transaction from the request context control map |
| 2 | EXEC | `parameter.set(JCMConstants.OPERATOR_ID_KEY, operatorId)` | Sets the operator ID into the message for audit trail -- identifies who initiated the service call |
| 3 | EXEC | `operateDate = context.getControlMapData(SCControlMapKeys.OPE_DATE)` | Retrieves the business operation date from the request context control map |
| 4 | EXEC | `parameter.set(JCMConstants.OPERATE_DATE_KEY, operateDate)` | Sets the operation date into the message for timestamping the transaction |
| 5 | EXEC | `operateDateTime = context.getControlMapData(SCControlMapKeys.OPE_TIME)` | Retrieves the exact date-time of the operation from the request context control map |
| 6 | EXEC | `parameter.set(JCMConstants.OPERATE_DATETIME_KEY, operateDateTime)` | Sets the operation date-time into the message for precise transaction logging |

### Block 3.1 -- CATCH (L16537)

> Exception handling for context data retrieval failures.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `e = RequestParameterException` | Catches exception if the context control map data cannot be retrieved (e.g., missing operator ID, date, or time) |
| 2 | EXEC | `throw new RuntimeException(e)` | Wraps the checked `RequestParameterException` in an unchecked `RuntimeException` and rethrows, since this is a critical configuration error that should halt processing |

### Block 4 -- RETURN (L16541)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return parameter` | Returns the fully initialized `CAANMsg` containing template ID, function code, and operational metadata for use by the caller in a service interface invocation |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|-----------------|
| `CAANMsg` | Class | CAAN Message -- the framework's standard message/request object used for inter-component communication. Carries parameters, metadata, and schema information between business components and service layers. |
| `CAANSchemaInfo` | Interface | Schema information interface defining the structure and keys of a CAANMessage. Each service call has its own schema class extending this interface. |
| `IRequestParameterReadWrite` | Interface | Request parameter read-write interface providing access to the request context's control map, which holds operational metadata (operator ID, operation date, etc.) shared across all processing steps. |
| `SCControlMapKeys` | Class | Constants class defining keys for the request context control map, including `OPERATOR_ID`, `OPE_DATE`, and `OPE_TIME`. |
| `JCMConstants` | Class | Java Constants Manager constants class defining message key names such as `TEMPLATE_ID_KEY`, `FUNC_CODE_KEY`, `OPERATOR_ID_KEY`, `OPERATE_DATE_KEY`, `OPERATE_DATETIME_KEY`. |
| `templateID` | Field | 11-character template identifier extracted from the schema class name. Used by the service framework to route the message to the correct service handler based on the schema type. |
| `funcCd` | Field | Function Code -- a short string identifying the specific business operation (e.g., registration, cancellation, change, inquiry) within the service interface. Determines the business logic path taken by the target SC. |
| `operatorId` | Field | The ID of the user (or system operator) who initiated the transaction. Used for audit trail and access control. |
| `operateDate` | Field | The business operation date -- the date on which the service transaction is being executed, used for date-based business logic and audit trail. |
| `operateDateTime` | Field | The exact date-time timestamp of the operation, providing precise transaction logging. |
| SC | Abbreviation | Service Component -- the layer of business logic components (identified by codes like EKK0241B002SC) that handle specific telecom service operations. |
| Service Contract | Business term | A service contract (WribSvcKei / 契約サービス計) -- a record of a customer's subscription to a telecommunications service (internet, phone, TV, etc.) with Fujitsu. The system manages registration, changes, and cancellations of these contracts. |
| WribSvcKei | Field | 書込サービス計 -- Service Contract Record / Write Service Contract. A core entity in the system representing a customer's active or past service subscription. |
| Dchskmst | Field | 控マスタ -- Deduction Item Master. A master record for billing deductions associated with service contracts. |
| KktnSvcKeiNo | Field | 契約サービスNo -- Contract Service Number. The unique identifier for a service contract line item. |
| Mineo | Business term | Mineo (ミネオ) -- A mobile virtual network operator (MVNO) service in Japan. `JKKMineoSetPlanWribCC` handles mineo-specific plan registration and service operations. |
| initiailzeCAANMsg | Method | Internal utility method (note: typo in name preserved from source) that sets all schema-defined keys in a `CAANMsg` to null, creating a clean message template. |
| RequestParameterException | Exception | Framework exception thrown when requested data is not available in the request context's control map. |
