package jnpf.dmsService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; /** Orchestrates separate transactions; never holds a transaction across file RPC. */ @Service @RequiredArgsConstructor public class DmsApprovedDisableFlowService { private final DmsApprovedDisableService service; private final DmsApprovedFileRetryService retry; private final DmsDisableOccupancyService occupancy; public void onEvent(String tenantId, String flowId, String taskId, String operation, String eventType) { if (occupancy.onEvent(tenantId, flowId, taskId, operation, eventType)) accept(tenantId, flowId, taskId, operation); } public void accept(String tenantId, String flowId, String taskId, String operation) { retry.process(service.enqueue(tenantId, flowId, taskId, operation)); } }