Skip to main content
10-Marble
June 23, 2022
Question

How to get Workflow task name from persistable object

  • June 23, 2022
  • 1 reply
  • 1612 views

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?

1 reply

Marco Tosin
21-Topaz I
21-Topaz I
June 23, 2022

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
HelesicPetr
22-Sapphire II
22-Sapphire II
June 23, 2022

@Marco_Tosin 

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

 

@Pushpak_Old 

 

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