if (primary != null)
{
if (flow.getMetaclass() == null || !flow.getMetaclass().isUpcast(primary.getMetaclass()))
{
throw new WorkflowException("err.workflow.invalidClass",
new Object[]{flow.getName(), primary.getMetaclass().getName()});
}
if (primary.getMetaclass().getPersistenceMapping() == null)
{