04-14-2009 12:02 PM
public static NodeRef getAssociatedSimulationNodeRef(NodeRef sourceNodeRef, NodeService nodeService) throws SimulationFileNotFoundException {
// Get the specific association
List<AssociationRef> simulationAssociationRefList = nodeService.getTargetAssocs(sourceNodeRef, IFwsModel.PROP_RELATED_SIMULATION);
// Check that the association exist
if (simulationAssociationRefList.isEmpty() ) {
// No association found
throw new SimulationFileNotFoundException();
}
// Get the associated reference
NodeRef simulationNodeRef = simulationAssociationRefList.get(0).getTargetRef();
// Check that the associated file already exist
if (! nodeService.exists(simulationNodeRef)) {
// The node doesn't exist anymore
throw new SimulationFileNotFoundException();
}
return simulationNodeRef;
}
05-19-2009 10:31 PM
05-20-2009 11:09 PM
05-26-2009 03:02 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.