class AuditDataService {

    public void writeStackDataToRequestDb(AuditInventory auditInventory, AAIObjectAuditList auditList)
            throws JsonProcessingException {
        List<RequestProcessingData> requestProcessingDataList =
                requestsDbClient.getRequestProcessingDataByGroupingIdAndNameAndTag(auditInventory.getVfModuleId(),
                        auditInventory.getHeatStackName(), AUDIT_STACK_DATA);
        if (requestProcessingDataList.isEmpty()) {
            GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
            String auditListString = objectMapper.getMapper().writeValueAsString(auditList);;

            RequestProcessingData requestProcessingData = new RequestProcessingData();
            requestProcessingData.setSoRequestId(auditInventory.getMsoRequestId());
            requestProcessingData.setGroupingId(auditInventory.getVfModuleId());
            requestProcessingData.setName(auditInventory.getHeatStackName());
            requestProcessingData.setTag(AUDIT_STACK_DATA);
            requestProcessingData.setValue(auditListString);

            requestsDbClient.saveRequestProcessingData(requestProcessingData);
        }
    }

}