Discussion

Invoke an activity in When rule

Can I invoke an activity before executing a when rule?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

July 7, 2011 - 8:10am

You can invoke a Locate Activity from the 'Pages and Classes' Tab of a When Rule.
This activity can be used to locate/create at runtime a page that the When rule refers.

July 8, 2011 - 10:03am

Finally got it.

I created a function that returns a boolean value. This function invokes the activity. Activity sets a boolean clipboard value and this value is returned by function.

This function is then called in the when condition.

October 6, 2015 - 3:33am

Hi Rathore,

 

I have a similar requirement to call an activity from when rule and in turn this activity should set some values in the clipboard.

Based on this boolean value, i then need to equate with the property in the when condition.

 

Can you please advise how to achieve this. Thanks.

October 6, 2015 - 4:34am

Hi,

 

Thanks i got this.

Specified the locate page and locate activity in the pages and classes of the when rule..Then in the locate activity i have set some property value and this comes up in the clipboard when the when rule is executed.

Based on this locatepage.property value am equating it in the when rule and it works!!

November 4, 2015 - 11:58am

Hi Rajeshna,

Can you please provide screen shots how you did this.

I am not able to understand what is locate activity and how did you call it activity in  pages and classes.

Regards,

Satya

November 5, 2015 - 1:39am

Hello Satya,

 

We are using pega 6.1 sp2.May i know which version of pega you are using?

In 6.1 sp2, open the when rule and go to pages& classes tab.there you will be able to see the locate page and locate activity.

 locate page - specify any pagename {ex: CustomerDetails}

locate condition - harcode the value as 'true'  ( depending on your requirement- this can be calculated via an expression as well either to true or false - if true then the activity wil be called)

locate activity - write an activity to call your logic and at the finalstep , you have to set some flag in the locatepage { Ex: CustomerDetails.Currency="USD" }

Then got to the advanced tab of the when rule and specify this condition and refer the locatepage name conditons along with the other ones { Ex: CustomerDetails.Currency="USD" and AccountDetails.AccNumber="123"}

 

when your flow or utility calls this when rule, it will first check whether the locatepage is specified in pages and classes. if yes, then it will evaluate the locate expression, if locate expression evaluates to true, then it will call the locate activity and your business logic defined in the activity.

Then it will execute the advanced tab of when rule finally to validate your conditions.

 

Let me know if this is clear ,if not you can contact me over the email , i can provide this in detail

Thanks,

Rajesh N (rajesh-na@hcl.com)

 

 

 

November 5, 2015 - 3:25am

Thanks Rajesh,

I am using 7.1.8. I dont see locate page and locate activity in this version.

November 5, 2015 - 3:36am

Aah ok , i am not very sure how it works in pega 7.

we have a function named callActivity(), you can open this from the expression editor..This might help you.

 

Thanks,

Rajesh N.

Pega
December 20, 2015 - 7:19am

also please refer ootb function pxExecuteAnActivity