How to get Lifecycle History in Windchill

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 "";
}

你可能感兴趣的:(How to get Lifecycle History in Windchill)