cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Maturity History for an Object

MichaelIbosh
1-Newbie

Maturity History for an Object

Good Friday everyone,
I have the need to examine the Maturity History of an object (EPMDocument, WTPart, WTDocument) in a workflow process to check for any released states before acting on that object. Does anyone know how to get the Maturity History of an object like what is displayed on the details page of an object (see below). I'm working with the 9.1 M050 release. Any code samples on how to get this information would be much appreciated.
[cid:image001.png@01CB66ED.9D5C8640]
Mike
3 REPLIES 3

I believe some code was just posted to the list last week from Swamy.

Below is what I ended up modifying to get the previous state that ended
with "WORK" to find the last working state.


public static String getChangeablePriorState(WTObject obj) {
//wto is the object of interest.
ArrayList<string> stateList = new ArrayList<string>();
String priorState = ";
try{
QueryResult lifecycleResult =
LifeCycleHelper.service.getHistory((wt.lifecycle.LifeCycleManaged)obj);
while( lifecycleResult.hasMoreElements()){
LifeCycleHistory lifecyclehistory = (LifeCycleHistory)
lifecycleResult.nextElement();
if (lifecyclehistory.getAction().equals("Set_State")){
stateList.add(lifecyclehistory.getState().toString());
}
}
} catch (WTException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

if (stateList.size()>0) {
Iterator<string> itr = stateList.iterator();
while (itr.hasNext()) {
String tempState = itr.next();
if (tempState.endsWith("WORK")) {
priorState = tempState;
break;
}
}
} else {
priorState=null;
}
return priorState;

}


> Good Friday everyone,
> I have the need to examine the Maturity History of an object (EPMDocument,
> WTPart, WTDocument) in a workflow process to check for any released states
> before acting on that object. Does anyone know how to get the Maturity
> History of an object like what is displayed on the details page of an
> object (see below). I'm working with the 9.1 M050 release. Any code
> samples on how to get this information would be much appreciated.
> [cid:image001.png@01CB66ED.9D5C8640]
> Mike
>

Steve,

I also am using the lifecycle history to get the last working state in a workflow. The problem is that the LC history ends at the objects current revision. As shown in the Maturity History, I need to see from the current revision all the way back to the first revision the states of the revisions and versions.

Mike

[cid:image001.png@01CB66F2.81B36E90]


It's similar logic, but separate table keying off what happens in maturity.

You want to do a queryspec using class objecthistory which links revision controlled objects to lifecyclehistory

That should be able to get you all of the lifecycle history for each version of the object.


Sent from my Verizon Wireless BlackBerry
Top Tags