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

How to get Workflow task name from persistable object

PB_10020575
6-Contributor

How to get Workflow task name from persistable object

Hi,

I have Change Activity object and I wanted to get the latest task name (e.g. Correct, Complete) 
So, How I can do it like wise?

2 REPLIES 2

Try reading these two articles and see if they can help you

 

https://www.ptc.com/en/support/article/CS63595

https://www.ptc.com/it/support/article/CS106301

 

Marco

@Marco_Tosin 

it helps to understand all change objects relation ships good start.

 

@PB_10020575 

 

if you need to get Workflow task you need to use following API

snip:

WTChangeActivity2 changeActivity = (WTChangeActivity2) qr.nextElement();
QueryResult qrWorkItems = WorkflowHelper.service.getWorkItems(changeActivity); // you can use different types of object as a input. ChangeRequest changeNotice, WTPart what object can have workflow.

WorkItem workItem = (WorkItem) qrWorkItems.nextElement();

WfActivity wfactivity = (WfActivity) workItem.getSource().getObject();
String activityName = wfactivity.getName();

 

Hope that can help

 

Also check another thread object-identifier-for-workflow-object-in-Windchill

 

PetrH  

Announcements