String stateStr = null;
try {
statusObj = getRuntimeObject().getRelatedOne("CurrentStatusItem");
} catch (GenericEntityException e) {
throw new WfException(e.getMessage(), e);
}
if (statusObj != null)
stateStr = statusObj.getString("statusCode");
if (stateStr == null)
throw new WfException("Stored state is not a valid type.");
if (Debug.verboseOn()) Debug.logVerbose("Current state: " + stateStr, module);
return stateStr;
}