Skip to main content
13-Aquamarine
March 23, 2023
Solved

Windchill Task error

  • March 23, 2023
  • 3 replies
  • 1660 views

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

 

 

 

 

Best answer by HelesicPetr

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

3 replies

17-Peridot
March 23, 2023

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

18-Opal
March 24, 2023

@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
22-Sapphire II
22-Sapphire II
March 24, 2023

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

PetrH
rburk13-AquamarineAuthor
13-Aquamarine
March 24, 2023

thanks PetrH

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

 

Rich

HelesicPetr
22-Sapphire II
22-Sapphire II
March 27, 2023

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

PetrH