# Data Flow & Relationship Report

## 1. Definitions & Concepts

### What is JP1?
**JP1 (Job Management Partner 1)** is a leading integrated systems management software suite developed by **Hitachi**. It is widely used in Japan for enterprise IT operations.
- **Context here**: Specifically **JP1/AJS (Automatic Job Management System)**, which is used for batch job scheduling and automation. It manages the execution order of background processes (jobs) based on time or events.

### What is EDI?
**EDI (Electronic Data Interchange)** is the computer-to-computer exchange of business documents in a standard electronic format between business partners.
- **Context here**: The system uses EDI to exchange "Order" and "Construction Result" data with "Other Operators" (external telecom carriers). The presence of SOAP Faults suggests this EDI might be implemented over a **SOAP/Web Services** layer, or it might be a hybrid system.

### Document Numbering Scheme (e.g., `01.01.02.02.07`)
The numbers like `01.01.02.02.07` are **WBS (Work Breakdown Structure)** or **Configuration Management IDs**. They likely correspond to the system's functional hierarchy:
- `01`: System / Phase (e.g., Phase 1)
- `01`: Sub-system (e.g., Common or Construction)
- `02`: Module (e.g., Screen Design)
- `02`: Sub-module
- `07`: Specific Asset ID (e.g., Screen #7)

---

## 2. JP1 Job Structure
The system uses JP1 for batch job scheduling. The following key jobs were identified from the definition files.

### Sample Job Definition
From `1.2 JP1шинхоЪщаЕчЫо.xlsx`:
- **Job Name**: `DB抽出［光SO］_1` (DB Extraction [Optical SO] 1)
- **Full Path**: `/00_業務SCHE（光オーダ系）/111_情報配信連携［送信］/XMLファイル作成1/DB抽出［光SO］_1`
- **Command**: `/home/auto/${DC}/batch/common/cmd/EDI_main_start.sh 1`
- **Description**: Extracts Optical SO (Service Order) construction info from DB for each branch.

### Key Job Categories
- **Order Processing**:
    - `/batch/common/cmd/JHConstBORegistOrder` (JH Construction BO Register Order)
        - *Function*: Likely ingests orders into the Back Office system.
        - *Source File*: `CustomerDocument/уВ╖уВЩуГзуГХуВЩф╕Ашжз/1.2 JP1шинхоЪщаЕчЫо.xlsx`
    - `/batch/common/cmd/JHConstBOResult` (JH Construction BO Result)
        - *Function*: Likely processes construction results.
        - *Source File*: `CustomerDocument/уВ╖уВЩуГзуГХуВЩф╕Ашжз/1.2 JP1шинхоЪщаЕчЫо.xlsx`

- **EDI / Interface**:
    - `/batch/common/cmd/EDI_StartMsg` / `EDI_EndMsg`
        - *Function*: Controls the start/end of EDI batch windows.
    - `/batch/common/cmd/JHEDIInfo_Start` / `JHEDIInfo_End`
        - *Function*: Manages EDI information exchange.

- **Status Monitoring**:
    - `/batch/common/cmd/JHACStatusFileCheck`
        - *Function*: Checks for the presence of status files.

## 3. Screen Definitions
Screen definitions are provided as Excel-based "Screen Transition Diagrams". The filenames serve as the primary identifiers.

### Sample Screen Definition
From `01.01.02.02.07_чФ╗щЭвщБ╖чз╗хЫ│_х╖еф║ЛцГЕха▒ц╡БщАЪ-я╝вя╝пчК╢ц│БхЗ║хКЫщГихИЖ.xls`:
- **Title**: `１.２.２.７　画面遷移図_工事情報流通-ＢＯ状況出力部分` (Screen Transition Diagram - Construction Info Distribution - BO Status Output Part)
- **Description**: Shows the screen flow for outputting BO status.

### Key Screen Modules
- **Construction Information**:
    - **ID**: `01.01.02.02.07`
        - **Name**: BO Status Output (`ＢＯ状況出力部分`)
        - **File**: `CustomerDocument/чФ╗щЭвшиншиИч╖и/01_хЕ▒щАЪ/02_чФ╗щЭвщБ╖чз╗хЫ│/01.01.02.02.07_чФ╗щЭвщБ╖чз╗хЫ│_х╖еф║ЛцГЕха▒ц╡БщАЪ-я╝вя╝пчК╢ц│БхЗ║хКЫщГихИЖ.xls`
        - **Role**: Likely displays the output of the `JHConstBOResult` job.
    
    - **ID**: `01.01.02.02.04`
        - **Name**: SO Progress Info (`ＳＯ工事進捗情報部分`)
        - **File**: `CustomerDocument/чФ╗щЭвшиншиИч╖и/01_хЕ▒щАЪ/02_чФ╗щЭвщБ╖чз╗хЫ│/01.01.02.02.04_чФ╗щЭвщБ╖чз╗хЫ│_х╖еф║ЛцГЕха▒ц╡БщАЪ-я╝│я╝пх╖еф║ЛщА▓цНЧцГЕха▒щГихИЖ.xls`
        - **Role**: Tracks the status of Service Orders.

    - **ID**: `01.01.02.02.02`
        - **Name**: External SO Direct Request Judgment (`所外ＳＯ工事直請判定部分`)
        - **File**: `CustomerDocument/чФ╗щЭвшиншиИч╖и/01_хЕ▒щАЪ/02_чФ╗щЭвщБ╖чз╗хЫ│/01.01.02.02.02_чФ╗щЭвщБ╖чз╗хЫ│_х╖еф║ЛцГЕха▒ц╡БщАЪ-цЙАхдЦя╝│я╝пх╖еф║ЛчЫ┤шлЛхИдхоЪщГихИЖ.xls`
        - **Role**: Logic for routing orders to external contractors.

- **Order Management**:
    - **ID**: `01.01.02.10`
        - **Name**: Order Completion Info Output (`オーダ完了情報出力部分`)
        - **File**: `CustomerDocument/чФ╗щЭвшиншиИч╖и/01_хЕ▒щАЪ/02_чФ╗щЭвщБ╖чз╗хЫ│/01.01.02.10_чФ╗щЭвщБ╖чз╗хЫ│_уВкуГ╝уВ┐уВЩхоМф║ЖцГЕха▒хЗ║хКЫщГихИЖ.xls`

## 4. Interface Definitions
The system uses a **SOAP-based Interface** for external communication.

### Sample Interface Definition
From `01.03.03-06_SOAP FaultуВдуГ│уВ┐уГХуВзуГ╝уВ╣щЫ╗цЦЗ.xlsx`:
- **Type**: SOAP Fault Interface Telegram
- **Parameters**:
    - `faultcode`: String (Fixed: `soapenv:Server`)
    - `faultstring`: String (Format: `sysifException:XXXXXXXX`)
    - `faultactor`: String (Fixed: `HHC`)
    - `detail`: String (Empty tag)
- **XML Structure**: `<?xml version="1.0" encoding="utf-8"?>`

- **Protocol**: SOAP (Simple Object Access Protocol).
- **Key Parameters Identified**: `faultcode`, `faultstring`, `sysifException`, `HHC`.
- **Source File**: `CustomerDocument/IFф╗ХцзШцЫ╕(уВвуГ│уГПуВЩуГ│уГИуВЩуГл)/ч╡▒хРИHHC/01.03.03-06_SOAP FaultуВдуГ│уВ┐уГХуВзуГ╝уВ╣щЫ╗цЦЗ.xlsx`

---

## 5. Inferred Relationships & Data Flow
Based on the terminology and structure, we can infer the following high-level data flow:

### Visual Architecture
```mermaid
graph TD
    subgraph External["External Systems (Other Operators)"]
        EDI[EDI / SOAP Interface]
    end

    subgraph JP1["JP1 Job Scheduler"]
        J_EDI_Start["EDI_main_start.sh<br/>(Start EDI Batch)"]
        J_DB_Ext["DB抽出［光SO］<br/>(Extract Optical SO)"]
        J_RegOrder["JHConstBORegistOrder<br/>(Register Order)"]
        J_Result["JHConstBOResult<br/>(Process Result)"]
    end

    subgraph Screens["Screen Modules (UI)"]
        S_BO_Out["01.01.02.02.07<br/>BO Status Output"]
        S_SO_Prog["01.01.02.02.04<br/>SO Progress Info"]
        S_Ext_Judg["01.01.02.02.02<br/>External SO Judgment"]
    end

    %% Data Flows
    EDI -->|SOAP/XML Data| J_EDI_Start
    J_EDI_Start --> J_DB_Ext
    J_DB_Ext -->|Extracted Data| J_RegOrder
    J_RegOrder -->|Update DB| S_SO_Prog
    
    S_Ext_Judg -->|Judgment Logic| J_RegOrder
    
    S_BO_Out -->|View Status| J_Result
    J_Result -->|Result Data| EDI
```

## 6. Cross-Reference Analysis
An automated scan of the documents revealed the following linkage patterns:

### Key Findings
1.  **"Optical SO" (`光SO`) is the Central Entity**:
    - This term appears in **6 different files**, bridging the gap between:
        - **JP1 Jobs** (`1.1 JP1...`, `1.2 JP1...`)
        - **Interface Specs** (`01.03.03-02...`)
        - **Business Specs** (`01.01.01...`)
    - This confirms that "Optical Service Order" is the primary data object flowing through the system.

2.  **Job Self-References**:
    - The JP1 definition file (`1.2 JP1...`) internally references its own job names (`JHConstBORegistOrder`, `EDI_main_start`), confirming that the job names extracted are indeed the canonical identifiers used within the system configuration.

3.  **Document-to-Document Links**:
    - The file `Appendix - Construction Delay Check Logic` (`...01.02.01.03.05...`) explicitly references the ID `01.01.01`, which corresponds to the **Distribution Item Specification** (`01.01.01_...`).
    - **Pattern**: `Appendix` files -> reference -> `Specification` files.

### Reference Matrix
| Source Document | Referenced Key | Type | Context |
|---|---|---|---|
| **Distribution Item Spec** (`01.01.01...`) | `光SO` (Optical SO) | Domain Term | Links to Job/Interface |
| **External Interface Spec** (`01.03.03-02...`) | `光SO` (Optical SO) | Domain Term | Defines data format for this entity |
| **Construction Delay Logic** (`Appendix...`) | `01.01.01` | Document ID | References the Item Spec |


1.  **Order Ingestion (EDI -> Job)**:
    - External Operators send data via **EDI**.
    - Jobs `EDI_main_start.sh` and `DB抽出［光SO］` (DB Extraction) initialize the reception and extract data.
    - Job `JHConstBORegistOrder` registers these orders into the internal database.

2.  **Construction Execution & Monitoring (Job -> Screen)**:
    - The system tracks construction progress.
    - Screen `01.01.02.02.04` (SO Progress Info) allows users to view this status.
    - Screen `01.01.02.02.02` (External SO Judgment) helps decide if work is outsourced.

3.  **Result Reporting (Screen -> Job -> EDI)**:
    - Upon completion, results are processed by `JHConstBOResult`.
    - Screen `01.01.02.10` (Order Completion Info) displays the final state.
    - Data is formatted into **SOAP** messages (or EDI files) to notify the external operator, handling errors via the defined `SOAP Fault` structures.