use of org.jbpm.casemgmt.api.CaseDefinitionNotFoundException in project jbpm by kiegroup.
the class CaseServiceImpl method newCaseFileInstance.
/*
* new instances methods
*/
@Override
public CaseFileInstance newCaseFileInstance(String deploymentId, String caseDefinition, Map<String, Object> data) {
CaseDefinition def = caseRuntimeDataService.getCase(deploymentId, caseDefinition);
if (def == null) {
throw new CaseDefinitionNotFoundException("Case definition " + caseDefinition + " does not exist in deployment " + deploymentId);
}
CaseFileInstanceImpl caseFile = new CaseFileInstanceImpl(caseDefinition, data);
caseFile.setupRoles(def.getCaseRoles());
caseFile.setAccessRestrictions(def.getDataAccessRestrictions());
return caseFile;
}
use of org.jbpm.casemgmt.api.CaseDefinitionNotFoundException in project jbpm by kiegroup.
the class CaseServiceImpl method newCaseFileInstanceWithRestrictions.
@Override
public CaseFileInstance newCaseFileInstanceWithRestrictions(String deploymentId, String caseDefinition, Map<String, Object> data, Map<String, List<String>> accessRestrictions) {
CaseDefinition def = caseRuntimeDataService.getCase(deploymentId, caseDefinition);
if (def == null) {
throw new CaseDefinitionNotFoundException("Case definition " + caseDefinition + " does not exist in deployment " + deploymentId);
}
CaseFileInstanceImpl caseFile = new CaseFileInstanceImpl(caseDefinition, data);
caseFile.setupRoles(def.getCaseRoles());
Map<String, List<String>> combinedAccessRestrictions = def.getDataAccessRestrictions();
if (accessRestrictions != null) {
combinedAccessRestrictions.putAll(accessRestrictions);
}
caseFile.setAccessRestrictions(combinedAccessRestrictions);
return caseFile;
}
use of org.jbpm.casemgmt.api.CaseDefinitionNotFoundException in project jbpm by kiegroup.
the class CaseServiceImpl method newCaseFileInstanceWithRestrictions.
@Override
public CaseFileInstance newCaseFileInstanceWithRestrictions(String deploymentId, String caseDefinition, Map<String, Object> data, Map<String, OrganizationalEntity> rolesAssignment, Map<String, List<String>> accessRestrictions) {
CaseDefinition def = caseRuntimeDataService.getCase(deploymentId, caseDefinition);
if (def == null) {
throw new CaseDefinitionNotFoundException("Case definition " + caseDefinition + " does not exist in deployment " + deploymentId);
}
CaseFileInstanceImpl caseFile = new CaseFileInstanceImpl(caseDefinition, data);
caseFile.setupRoles(def.getCaseRoles());
Map<String, List<String>> combinedAccessRestrictions = def.getDataAccessRestrictions();
if (accessRestrictions != null) {
combinedAccessRestrictions.putAll(accessRestrictions);
}
caseFile.setAccessRestrictions(combinedAccessRestrictions);
rolesAssignment.entrySet().stream().forEach(entry -> caseFile.assign(entry.getKey(), entry.getValue()));
return caseFile;
}
use of org.jbpm.casemgmt.api.CaseDefinitionNotFoundException in project jbpm by kiegroup.
the class CaseServiceImpl method newCaseFileInstance.
@Override
public CaseFileInstance newCaseFileInstance(String deploymentId, String caseDefinition, Map<String, Object> data, Map<String, OrganizationalEntity> rolesAssignment) {
CaseDefinition def = caseRuntimeDataService.getCase(deploymentId, caseDefinition);
if (def == null) {
throw new CaseDefinitionNotFoundException("Case definition " + caseDefinition + " does not exist in deployment " + deploymentId);
}
CaseFileInstanceImpl caseFile = new CaseFileInstanceImpl(caseDefinition, data);
caseFile.setupRoles(def.getCaseRoles());
caseFile.setAccessRestrictions(def.getDataAccessRestrictions());
rolesAssignment.entrySet().stream().forEach(entry -> caseFile.assign(entry.getKey(), entry.getValue()));
return caseFile;
}
Aggregations