use of org.cristalise.kernel.common.ObjectAlreadyExistsException in project kernel by cristal-ise.
the class BulkImport method importItemPath.
public ItemPath importItemPath(ItemPath item, Object locker) throws PersistencyException {
try {
ItemPath itemPath = (ItemPath) importCluster.get(item, PATH + "/Item");
Gateway.getLookupManager().add(itemPath);
return itemPath;
} catch (ObjectCannotBeUpdated | ObjectAlreadyExistsException | CannotManageException e) {
Logger.error(e);
throw new PersistencyException(e.getMessage());
}
}
use of org.cristalise.kernel.common.ObjectAlreadyExistsException in project kernel by cristal-ise.
the class ModuleActivity method create.
@Override
public Path create(AgentPath agentPath, boolean reset) throws ObjectNotFoundException, ObjectCannotBeUpdated, CannotManageException, ObjectAlreadyExistsException, InvalidDataException {
try {
domainPath = Bootstrap.verifyResource(ns, name, version, type.getTypeCode(), itemPath, getResourceLocation(), reset);
itemPath = domainPath.getItemPath();
} catch (Exception e) {
Logger.error(e);
throw new CannotManageException("Exception verifying module resource " + ns + "/" + name);
}
actDef = LocalObjectLoader.getActDef(name, version);
populateActivityDef();
CollectionArrayList colls;
try {
colls = actDef.makeDescCollections();
} catch (InvalidDataException e) {
Logger.error(e);
throw new CannotManageException("Could not create description collections for " + getName() + ".");
}
for (Collection<?> coll : colls.list) {
try {
Gateway.getStorage().put(itemPath, coll, null);
// create last collection
coll.setVersion(null);
Gateway.getStorage().put(itemPath, coll, null);
} catch (PersistencyException e) {
Logger.error(e);
throw new CannotManageException("Persistency exception storing description collections for " + getName() + ".");
}
}
return domainPath;
}
use of org.cristalise.kernel.common.ObjectAlreadyExistsException in project kernel by cristal-ise.
the class Script method makeDescCollections.
/**
*/
@Override
public CollectionArrayList makeDescCollections() throws InvalidDataException, ObjectNotFoundException {
CollectionArrayList retArr = new CollectionArrayList();
Dependency includeColl = new Dependency(INCLUDE);
for (Script script : mIncludes) {
try {
includeColl.addMember(script.getItemPath());
} catch (InvalidCollectionModification e) {
throw new InvalidDataException("Could not add " + script.getName() + " to description collection. " + e.getMessage());
} catch (ObjectAlreadyExistsException e) {
throw new InvalidDataException("Script " + script.getName() + " included more than once.");
}
//
}
retArr.put(includeColl);
return retArr;
}
Aggregations