public String getCaseFileData(String containerId, String caseId, List<String> names, String marshallingType) { verifyContainerId(containerId, caseId); CaseFileInstance caseFileInstance = caseService.getCaseFileInstance(caseId); Map<String, Object> caseFileData = caseFileInstance.getData(); if (names != null && !names.isEmpty()) { logger.debug("Filtering case file data to return only items with following names {}", names); Map<String, Object> filtered = new HashMap<>(); for (String name : names) { if (caseFileData.containsKey(name)) { filtered.put(name, caseFileData.get(name)); } } caseFileData = filtered; } logger.debug("About to marshal case file data for case with id '{}' {}", caseId, caseFileData); return marshallerHelper.marshal(containerId, marshallingType, caseFileData, new ByCaseIdContainerLocator(caseId)); }
public String getCaseFileDataByName(String containerId, String caseId, String name, String marshallingType) { verifyContainerId(containerId, caseId); CaseFileInstance caseFileInstance = caseService.getCaseFileInstance(caseId); Object caseFileData = caseFileInstance.getData(name); logger.debug("About to marshal case file data (name = {}) for case with id '{}' {}", name, caseId, caseFileData); return marshallerHelper.marshal(containerId, marshallingType, caseFileData, new ByCaseIdContainerLocator(caseId)); }