Skip to main content
12-Amethyst
June 30, 2022
Solved

is there any api to get WTChangeActivity2 from Workitem?

  • June 30, 2022
  • 2 replies
  • 2592 views

Im trying to get all the change activities assigned to workitems.

@BjoernRueegg , @HelesicPetr 

Best answer by HelesicPetr

Hi @manoj_dokku2 

If you need to get object which is related to WorkItem usually it is primaryBusinessObject 

 

workitem.getPrimaryBusinessObject().getObject()

It can be any type in a system so you need to check a type and cast to the correct type.

 

WTChangeActivity2 WTCA22 = (WTChangeActivity2)workitem.getPrimaryBusinessObject().getObject()

PetrH

2 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
June 30, 2022

Hi @manoj_dokku2 

 

Clarify your needs.

The WorkItem can have only one Change Activity.

Work item is a task for a user. One task can not be assigned to more ChangeActivities as WTChangeActivity2

 

PetrH

12-Amethyst
June 30, 2022

Hi Peter,

 

For example, if i have a workitem from the queryspec "QuerySpec querySpec = new QuerySpec(WorkItem.class);" with some conditions, i will be ending up with many workitems.

 

Is there a way to get a changenotice assigned to it?

 

Or for each and every workitem, can i get an associated change notice?

 

Thank and Regards,

Manoj.

HelesicPetr
22-Sapphire II
22-Sapphire II
July 1, 2022

I just add one point.

You really need to use a For or a While loop to get what you need.

PetrH

HelesicPetr
22-Sapphire II
22-Sapphire II
June 30, 2022

Hi @manoj_dokku2 

If you need to get object which is related to WorkItem usually it is primaryBusinessObject 

 

workitem.getPrimaryBusinessObject().getObject()

It can be any type in a system so you need to check a type and cast to the correct type.

 

WTChangeActivity2 WTCA22 = (WTChangeActivity2)workitem.getPrimaryBusinessObject().getObject()

PetrH