# Deep Analysis Plan: Document Relationships

## 1. Objective
To uncover the structural and functional relationships between the different categories of documents (JP1, Screen, Interface, Business Logic) within the `CustomerDocument` folder.

## 2. Key Questions
- **Data Flow**: How does an "Order" propagate through the system to become "Construction Information"?
- **Triggers**: Which JP1 jobs execute which business logic or file transfers?
- **UI-Backend Link**: Do screen definitions reference specific data layouts or interfaces?
- **Identifiers**: What are the key keys (e.g., Order ID, Circuit ID) linking these entities?

## 3. Proposed Analysis Steps

### Step 1: Content Extraction (Automated)
Develop targeted Python scripts to extract structured data from the identified key files:
- **JP1 Files**: Extract Job Net names, execution commands, and schedules.
- **Screen Files**: Extract screen IDs, transition destinations, and data field names.
- **Interface Files**: Extract field names, data types, and interface IDs.

### Step 2: Cross-Reference Analysis
- **Search for IDs**: Look for Interface IDs (e.g., "IF-...") inside Screen and JP1 documents.
- **Search for Job Names**: Look for Job Net names inside Business Logic documents.
- **Common Field Matching**: Identify fields that appear across multiple categories (e.g., "Subscriber Name", "Construction Date").

### Step 3: Visual Mapping
- Create a **Mermaid Diagram** illustrating the inferred system architecture:
    - Nodes: Screens, Jobs, Interfaces, External Systems.
    - Edges: Data flow, Triggers, Transitions.

### Step 4: Deep Dive into Specific Flows
- **"Order" Lifecycle**: Trace the term "Order" (`オーダ`) across all files to map its lifecycle.
- **"Construction" Lifecycle**: Trace "Construction" (`工事`) to see how it links to Orders.

## 4. Deliverables
- `relationship_map.mermaid`: A visual graph of system components.
- `data_flow_report.md`: A textual description of the identified workflows.
- `cross_reference_matrix.csv`: A table showing which files reference each other.

## 5. Next Steps
1.  Approve this plan.
2.  Begin Step 1 (Content Extraction).
