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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Displaying promoted-on date from maturity history only if the change notice in Resolved state in QML

JA_11399780
4-Participant

Displaying promoted-on date from maturity history only if the change notice in Resolved state in QML

I just wanted to display the promoted-on date for CN which is in Resolved state in QML. But at the same time, I am displaying change notice which is in other states also in the report. For those, which is in other state, I don't want to display the promoted-on date. Can anyone help?

ACCEPTED SOLUTION

Accepted Solutions

I understand that you want to build a Query Builder report, which will display the WTChangeOrder2 ResolutionDate -- but only when the lifecycle state of the WTChangeOrder2 is RESOLVED.  One way is to follow the procedure for adding a Java method for use in QueryBuilder -

1) Documentation at https://support.ptc.com/help/wnc/r12.1.1.0/en/?#page/Windchill_Help_Center/customization/WCCG_BUSLogicCust_ReportGeneration_JavaMethods.html

2) Example file which takes a CN, and displays Resolution Date if lifecycle state is RESOLVED  -- otherwise it displays nothing -- at bottom - create java file and compile

3) Add this line to Windchill/conf/queryBuilderMethods.xml

 

<method class="ext.tsd.QueryBuilderHelper" name="getResolutionDateIfStateResolved" static="true"/>

 

4) Load application data (instructions in documentation above)

5) Select in Query Builder by passing CN

ericstarkman_0-1728093114017.png

 

 

 

package ext.tsd;
import java.sql.Timestamp;
import wt.change2.WTChangeOrder2;
import wt.lifecycle.State;

public class QueryBuilderHelper {
	public static Timestamp getResolutionDateIfStateResolved(WTChangeOrder2 wtChangeOrder2) {
		if(wtChangeOrder2 != null && wtChangeOrder2.getLifeCycleState().equals(State.toState("RESOLVED"))) {
			return wtChangeOrder2.getResolutionDate();
		}
		return null;
	}
}

 

View solution in original post

6 REPLIES 6

Hi, thanks for your kind response. It didn't work as the promotion request will not involve in change notice state change process, I think. Here the state change is happening either by doing set state or following the approval process. 

I understand that you want to build a Query Builder report, which will display the WTChangeOrder2 ResolutionDate -- but only when the lifecycle state of the WTChangeOrder2 is RESOLVED.  One way is to follow the procedure for adding a Java method for use in QueryBuilder -

1) Documentation at https://support.ptc.com/help/wnc/r12.1.1.0/en/?#page/Windchill_Help_Center/customization/WCCG_BUSLogicCust_ReportGeneration_JavaMethods.html

2) Example file which takes a CN, and displays Resolution Date if lifecycle state is RESOLVED  -- otherwise it displays nothing -- at bottom - create java file and compile

3) Add this line to Windchill/conf/queryBuilderMethods.xml

 

<method class="ext.tsd.QueryBuilderHelper" name="getResolutionDateIfStateResolved" static="true"/>

 

4) Load application data (instructions in documentation above)

5) Select in Query Builder by passing CN

ericstarkman_0-1728093114017.png

 

 

 

package ext.tsd;
import java.sql.Timestamp;
import wt.change2.WTChangeOrder2;
import wt.lifecycle.State;

public class QueryBuilderHelper {
	public static Timestamp getResolutionDateIfStateResolved(WTChangeOrder2 wtChangeOrder2) {
		if(wtChangeOrder2 != null && wtChangeOrder2.getLifeCycleState().equals(State.toState("RESOLVED"))) {
			return wtChangeOrder2.getResolutionDate();
		}
		return null;
	}
}

 

Thank you! it helps🙂

 
To achieve the conditional display of the "promoted-on" date in QML based on the state of the change notice (CN), you can use an if statement within your QML code. Here’s a basic example to guide you:

I hope this will help. if you have want to be more clear I have put my question here in this Youtube groups. 

 
Announcements


Top Tags