use of org.kie.server.services.casemgmt.locator.ByCaseIdContainerLocator in project droolsjbpm-integration by kiegroup.
the class CaseManagementServiceBase method addDynamicSubprocess.
public void addDynamicSubprocess(String containerId, String caseId, String stageId, String processId, String payload, String marshallingType) {
verifyContainerId(containerId, caseId);
logger.debug("About to unmarshal process data from payload: '{}'", payload);
Map<String, Object> subProcessParameters = marshallerHelper.unmarshal(containerId, payload, marshallingType, Map.class, new ByCaseIdContainerLocator(caseId));
logger.debug("SubProcess data '{}'", subProcessParameters);
if (stageId != null && !stageId.isEmpty()) {
logger.debug("Adding dynamic subprocess to stage {} within case {}", stageId, caseId);
caseService.addDynamicSubprocessToStage(caseId, stageId, processId, subProcessParameters);
} else {
logger.debug("Adding dynamic subprocess to case {}", caseId);
caseService.addDynamicSubprocess(caseId, processId, subProcessParameters);
}
}
use of org.kie.server.services.casemgmt.locator.ByCaseIdContainerLocator in project droolsjbpm-integration by kiegroup.
the class CaseManagementServiceBase method addCommentToCase.
public String addCommentToCase(String containerId, String caseId, String author, List<String> restrictions, String comment, String marshallingType) {
verifyContainerId(containerId, caseId);
author = getUser(author);
String actualComment = marshallerHelper.unmarshal(containerId, comment, marshallingType, String.class, new ByCaseIdContainerLocator(caseId));
logger.debug("Adding comment to case {} by {} with text '{}' with restrictions {}", caseId, author, actualComment, restrictions);
String commentId = caseService.addCaseComment(caseId, author, actualComment, restrictions.toArray(new String[restrictions.size()]));
return marshallerHelper.marshal(containerId, marshallingType, commentId);
}
use of org.kie.server.services.casemgmt.locator.ByCaseIdContainerLocator in project droolsjbpm-integration by kiegroup.
the class CaseManagementServiceBase method updateCommentInCase.
public void updateCommentInCase(String containerId, String caseId, String commentId, String author, List<String> restrictions, String comment, String marshallingType) {
verifyContainerId(containerId, caseId);
author = getUser(author);
String actualComment = marshallerHelper.unmarshal(containerId, comment, marshallingType, String.class, new ByCaseIdContainerLocator(caseId));
logger.debug("Updating comment {} in case {} by {} with text '{}' with restrictions {}", commentId, caseId, author, actualComment, restrictions);
caseService.updateCaseComment(caseId, commentId, author, actualComment, restrictions.toArray(new String[restrictions.size()]));
}
use of org.kie.server.services.casemgmt.locator.ByCaseIdContainerLocator in project droolsjbpm-integration by kiegroup.
the class CaseManagementServiceBase method getCaseFileData.
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));
}
use of org.kie.server.services.casemgmt.locator.ByCaseIdContainerLocator in project droolsjbpm-integration by kiegroup.
the class CaseManagementServiceBase method putCaseFileData.
public void putCaseFileData(String containerId, String caseId, List<String> restrictions, String payload, String marshallingType) {
verifyContainerId(containerId, caseId);
logger.debug("About to unmarshal case file data from payload: '{}'", payload);
Map<String, Object> caseFileData = marshallerHelper.unmarshal(containerId, payload, marshallingType, Map.class, new ByCaseIdContainerLocator(caseId));
logger.debug("Unmarshalled case file data {} for case with id '{}' with restrictions", caseFileData, caseId, restrictions);
caseService.addDataToCaseFile(caseId, caseFileData, restrictions.toArray(new String[restrictions.size()]));
}
Aggregations