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 PTC Community Badges. Engage with PTC and see how many you can earn! X

Windchill Task error

rburk
10-Marble

Windchill Task error

we are using: Windchill Release: 11.0 M030-CPS16

seeing "admin" tasks for WTparts to: "remove PDF attachments from CAD drawing when in fact drawing does not have  a PDF attachment"

error: wt.part.WTPart cannot be cast to wt.epm.EPMDocument

rburk_0-1679606792797.png

rburk_1-1679606926029.png

what could be causing this to happen?

 

thanks,

Rich

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
21-Topaz II
(To:rburk)

Hi @rburk 

usually if the workflow is related directly to the object the Workflow is run by Life cycle template and a specific state.

In your case the point would be that WTPart uses same lifecycle template as a EPMDocument. Or the lifecycle template is copy of the EPMDocument Lifecycle.

 

PetrH

View solution in original post

5 REPLIES 5
Dobi
14-Alexandrite
(To:rburk)

Error in the conditional... is there some code in the expression robot just before where you are potentially causing that error? 

d_graham
17-Peridot
(To:rburk)

@Dobi 

Your PBO is a WTPart.  Your code is likely attempting to cast the PBO to an EPMDocument.

That's a no can do.  You can't cast something to something it is not.

 

Makes sense?

HelesicPetr
21-Topaz II
(To:rburk)

Hi @rburk 

From admin perspective, 

Your workflow is running on WTPart object instead of EPMDocument

 

That is the reason of the error. Code can not work with WTPart. 

 

Do not run the workflow on WTPart object.

 

PetrH

thanks PetrH

not sure where/how do I turn off the workflow on the WTPart object ?

 

Rich

HelesicPetr
21-Topaz II
(To:rburk)

Hi @rburk 

usually if the workflow is related directly to the object the Workflow is run by Life cycle template and a specific state.

In your case the point would be that WTPart uses same lifecycle template as a EPMDocument. Or the lifecycle template is copy of the EPMDocument Lifecycle.

 

PetrH

Top Tags