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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Problem Report - Set Resolution Date

sdrzewiczewski
10-Marble

Problem Report - Set Resolution Date

We have a need to manually set the Resolution Date on some legacy problem reports. I don't see a way of doing it through the user interface. Has anybody done something like this either through an info*engine task, java code, or database manipulation?


Only looking to update <100 objects so want to find a simple solution.

2 REPLIES 2

This is a command line program I had to do this for an EC:

The bolded line can be swapped for a Problem Report version:

WorkflowProcessHelper.setPRResolutionDate(WTChangeIssue pr)



That code uses the current system Timestamp. If you need to back date
it, you need to call setResolutionDate(Timestamp t) on the PR and save
it (PersistenceHelper.manager.save(pr)).



package customization.cmdJobs;

import wt.auth.*;

import wt.httpgw.GatewayAuthenticator;

import java.io.*;

import java.util.*;

import wt.fc.*;

import wt.method.*;

import wt.query.QuerySpec;

import wt.util.*;

import wt.query.SearchCondition;

import java.util.*;

import com.ptc.windchill.cadx.common.util.ObjectDependencyUtility;

import java.util.*;

import wt.part.*;

import wt.change2.*;

import customization.dcc.*;

import customization.dcc.beans.*;

import java.net.URL;

import wt.workflow.*;

import wt.workflow.engine.*;

import wt.workflow.work.*;

import wt.inf.container.*;



/**

*

* @author Antonio.Villanueva

*/

public class FixEC{

//private static GoodrichECService helper=GoodrichECHelper.service;



/** Creates a new instance of MovePartstoDocsJob */

public FixEC() {



}



public static void main (String[] args) throws Exception

{

System.out.println("Connected to PDMLink!");

QuerySpec queryspec;

boolean done=false;

String ecNumber;

String choice;

try {

System.out.println("Enter EC number that released BOMs. Hit
just return to query by part number");

BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));

System.out.print("EC Number (#####-PID): ");

choice = br.readLine();

ecNumber=choice;

queryspec = new QuerySpec(WTChangeOrder2.class);

queryspec.appendWhere(new
SearchCondition(WTChangeOrder2.class,WTChangeOrder2.NUMBER,SearchConditi
on.EQUAL,choice.toUpperCase()));

QueryResult
result=PersistenceHelper.manager.find(queryspec);

if (result.size()==1)

{

WTChangeOrder2 ec=(WTChangeOrder2)result.nextElement();


com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setEC
NResolutionDate(ec);

}

else

System.out.println("EC not found by that number");

}

catch (IOException ioe) {

System.out.println("Error with input");

System.exit(1);

}

}



}


Thanks to everybody that replied so quickly!


I have a very ugly solution, that I may choose to make more elegant using an info*engine task. Right now i've got the Problem Report number hardcoded as well as the resolutionDate value. I know i can pass those in as inputs through querystrings, and will probably add that next.


To run this you would go to the URL


http://<server name=">/Windchill/servlet/IE/tasks/<path to=" file=">/updateResolutionDate.xml


Steve D.

Announcements


Top Tags