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

workflow expression code - count number of affected objects

SOLVED
Moonstone

workflow expression code - count number of affected objects

Don't ask why but I'm in need of code that can be applied in a workflow expression robot that counts the number of affected objects on a promotion request (technically the "promotion targets.").  Need to branch the workflow if above a certain number.

Getting stuck trying to make it work - would appreciate any suggestions.

thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Re: workflow expression code - count number of affected objects

Hi Mike,

See if this one works.

     wt.fc.QueryResult result = wt.maturity.MaturityHelper.service.getPromotionTargets((wt.maturity.PromotionNotice)primaryBusinessObject));

             int numberOfTarget=result.size();

thanks.

View solution in original post

6 REPLIES 6

Re: workflow expression code - count number of affected objects

Mike,

It's been a while but I'm still doing some Windchill development work.

Assuming the Promotion Request is the workflow's PBO, this should get you what you want:

int numberOfTargets = wt.maturity.MaturityHelper.service.getPromotionTargets((wt.maturity.PromotionNotice)primaryBusinessObject).size();

David Graham

Re: workflow expression code - count number of affected objects

not work for me

exeption

Re: workflow expression code - count number of affected objects

‌What version of Windchill are you on?

Re: workflow expression code - count number of affected objects

10.2 M030 CSP 14

Re: workflow expression code - count number of affected objects

Hi Mike,

See if this one works.

     wt.fc.QueryResult result = wt.maturity.MaturityHelper.service.getPromotionTargets((wt.maturity.PromotionNotice)primaryBusinessObject));

             int numberOfTarget=result.size();

thanks.

View solution in original post

Re: workflow expression code - count number of affected objects

Thanks very much - working now.