use of org.cristalise.kernel.persistency.outcome.Viewpoint in project kernel by cristal-ise.
the class ActDefCache method loadObject.
@Override
public ActivityDef loadObject(String name, int version, ItemProxy proxy) throws ObjectNotFoundException, InvalidDataException {
String viewName;
if (isComposite == null) {
String prop = proxy.getProperty(COMPLEXITY);
if ("Composite".equals(prop))
viewName = COMP_ACT_DESC_RESOURCE.getSchemaName();
else if ("Elementary".equals(prop))
viewName = ELEM_ACT_DESC_RESOURCE.getSchemaName();
else
throw new InvalidDataException("Missing Item property:" + COMPLEXITY);
} else {
viewName = isComposite ? COMP_ACT_DESC_RESOURCE.getSchemaName() : ELEM_ACT_DESC_RESOURCE.getSchemaName();
}
try {
Viewpoint actView = (Viewpoint) proxy.getObject(ClusterType.VIEWPOINT + "/" + viewName + "/" + version);
String marshalledAct = actView.getOutcome().getData();
return buildObject(name, version, proxy.getPath(), marshalledAct);
} catch (PersistencyException ex) {
Logger.error(ex);
throw new ObjectNotFoundException("Problem loading Activity " + name + " v" + version + ": " + ex.getMessage());
}
}
Aggregations