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.

Java NullpointerException when getting the representation

BernardWielfaer
6-Contributor

Java NullpointerException when getting the representation

Hi,

I get an error (java.lang.NullPointerException) when executing the following lines at :

Representation rep = RepresentationHelper.Service.getDefaultRepresentation(CurrEPM)

This is the code :

Snap3.png

When I request info from the EPMDocument (CurrEPM) like this :

TracePath = TracePath + "\n" + "+2.2 " + "Number: " + CurrEPM.getNumber() + " Name: " + CurrEPM.getName() + " Status: " + CurrEPM.getLifeCycleState.toString() + " Version: " + CurrEPM.getVersionIdentifier().getValue() + " Iteration: " + CurrEPM.getIterationIdentifier().getValue();

I get :

+2.2 Number: M000056923.DRW Name: FOLDER PLATE Status: DESIGN Version: B Iteration: 1

1 ACCEPTED SOLUTION

Accepted Solutions

Found it, there was no representation...

Should really give no exeption just a null result.

View solution in original post

3 REPLIES 3

Has the RepresentationHelper object been initialized?

Found it, there was no representation...

Should really give no exeption just a null result.

KD
4-Participant
4-Participant
(To:BernardWielfaer)

Hi Bernard,

You can try the following method.

VisualizationHelper vzh = VisualizationHelper.newVisualizationHelper();

Representation rep = vzh.getRepresentation((Persistable) epmDoc);

Thanks and Regards,

Kaushik

Top Tags