public static String getLifeCycleSHistory(LifeCycleManaged lifeCycleManaged, String searchState) throws Exception {
QueryResult lifecycleResult = LifeCycleHelper.service.getHistory(lifeCycleManaged);
while(lifecycleResult.hasMoreElements()) {
LifeCycleHistory lifecyclehistory = (LifeCycleHistory)lifecycleResult.nextElement();
String lifecycleState = lifecyclehistory.getState().toString();
if(lifecycleState.equals(searchState) && lifecyclehistory.getAction().equals("Enter_Phase")){
return lifecyclehistory.getPersistInfo().getCreateStamp().toString();
}
}
return "";
}
转载于:https://my.oschina.net/zengbo/blog/115461