9. Path Service
Access it via client.path(). You can retrieve the hierarchical path (Site > Area > Line > Equipment) of an asset or tag in a single call.
9.1 Method List
| Method | Return Type | HTTP | Endpoint |
|---|---|---|---|
getByAsset(asset_id) | PathResponseV5 or null | GET | /api/v5/path/asset/{id} |
getByTag(tag_id) | PathResponseV5 or null | GET | /api/v5/path/tag/{id} |
9.2 PathResponseV5 DTO
| Field | Description |
|---|---|
site_id / site_name | Parent site |
area_id / area_name | Area |
line_id / line_name | Line |
equipment_id / equipment_name | Equipment |
Depending on the asset type, some fields may be
null(e.g., for an asset that has only an Area, bothline_*andequipment_*arenull).
9.3 Usage Examples
Full Path of Equipment
import plantpulse.api.v5.dto.response.PathResponseV5;
PathResponseV5 path = client.path().getByAsset("ASSET_DJ_M_0001");
if (path != null) {
System.out.printf("%s > %s > %s > %s%n",
path.getSite_name(),
path.getArea_name(),
path.getLine_name(),
path.getEquipment_name());
}
Example output:
대전 1공장 > 조립구역 > 1라인 > CNC #1
Asset Path of a Tag
PathResponseV5 tagPath = client.path().getByTag("TAG_EDGE_00303_90007");
if (tagPath != null) {
System.out.println("태그가 부착된 설비: " + tagPath.getEquipment_name());
System.out.println("라인: " + tagPath.getLine_name());
}
Utility for Building a Path String
static String formatPath(PathResponseV5 p) {
if (p == null) return "(경로 없음)";
StringBuilder sb = new StringBuilder();
if (p.getSite_name() != null) sb.append(p.getSite_name());
if (p.getArea_name() != null) sb.append(" > ").append(p.getArea_name());
if (p.getLine_name() != null) sb.append(" > ").append(p.getLine_name());
if (p.getEquipment_name() != null) sb.append(" > ").append(p.getEquipment_name());
return sb.toString();
}
9.4 Application Scenarios
Scenario — Displaying the Path of an Asset with an Alarm
import plantpulse.api.v5.dto.response.AlarmResponseV5;
for (AlarmResponseV5 a : client.alarm().list(20)) {
// AlarmResponseV5 에 tag_location 필드가 이미 있지만
// 더 구조화된 경로가 필요하면 Path 서비스로 재조회
if (a.getTag_id() != null) {
PathResponseV5 path = client.path().getByTag(a.getTag_id());
System.out.printf("[%s] %s @ %s%n",
a.getPriority(),
a.getDescription(),
formatPath(path));
}
}
Next Steps
- Asset Service — Directly manipulate the asset hierarchy
- Alarm Service — Track assets with alarms