Question
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
Capgemini
GB
Last activity: 16 Jan 2022 7:17 EST
Finish assignment not working when used with WHEN rule
Dears,
I have a button on section which is firing three events on click
1) Run Activity - Doing some stuff then setting a property SETFLAG to SUCCESS
2) Refresh Section
3) Finish Assignment - with a when condition using SETFLAG = SUCCESS
When I click the button first time only Activity & Refresh Sections runs in Tracer. Even WHEN condition is set to TRUE
Second time when I click the button, the event is taking all 3 actions (Run Activity, Refresh, Finish Assignment)
I went through different posts on PDN and also added to SETFLAG property to section but nothing works.
Any help would be appreciated.
Kind Regards,
Vishal
***Edited by Moderator Marissa to update Content Type from Discussion to Question***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Updated: 18 Jun 2020 15:28 EDT
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Pegasystems Inc.
FR
Hello,
Would it be just easiest to "Refresh Section" only. Using this option you can automatically call an activity. From this activity you could call finish assignment as well
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
Capgemini
GB
I tried it but finishassignment is not behaving the same way it was behaving earlier.
Kind Regards,
Vishal
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Pegasystems Inc.
US
I think what is happening here, is the evaluation of the when condition has already been made prior to you changing the flag. Please see if this helps: https://community.pega.com/video-library/support-guide-troubleshooting-when-rule-conditions-not-executing-expected
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
Capgemini
GB
I tried this one as well.
not working.
Cheers,
Vishal
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-06/517bdd3e-6211-45a3-96d8-d2754a03b0e4.jpg?h=da2f1792&itok=t8q2xEzg)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-06/517bdd3e-6211-45a3-96d8-d2754a03b0e4.jpg?h=da2f1792&itok=t8q2xEzg)
Pegasystems Inc.
IN
Hi Vishal,
Can you try add one more action set and place the finish assignment there.If it is not helping can you try adding a set wait step at the end of the activity.
Thanks,
Priyanka
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
Capgemini
GB
Hi Priyanka,
I tried keeping wait step at the end of activity and it doenst work on first click It always work on second click.
Regards,
Vishal
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689875000/257ae129-00fe-4795-ab24-b77dbd95ebb3.jpg?itok=b3bvDbq-)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689875000/257ae129-00fe-4795-ab24-b77dbd95ebb3.jpg?itok=b3bvDbq-)
Blue Rose Technologies
DE
Hi,
Not sure whether you have already tried this. We faced similar issue where the flag property used in when rule or expression is set in same button click. We got the issue solved when we did below steps.
1. Add a UI control (may be check box if it is boolean) for that flag property in the same section where you have the button.
2. Set the Control format to 'Hidden', on the Presentation tab of the Control, to hide the field.
3. Set the When condition to 'Other Property' and use the flag and expression.
Below link has more details on why we followed the approach I mentioned above.
Updated: 22 Jun 2020 6:36 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-08/30ce1ab4-2035-41c2-8cce-4890ac119d9b.jpg?h=3db27a1c&itok=JQTBxEcA)
Capgemini
GB
I tried this as well. Tried with Text/Integer/Boolean properties on section and WHEN rule as well as in OTHER PROPERTY expression.
nothing is working.
Pega Version is 7.1.3
Regards,
Vishal
Updated: 15 Jan 2022 6:36 EST
![](https://accounts.pega.com/sites/default/files/pega-user-image/263/REG-262580.png?source=PUMINIT)
![](https://accounts.pega.com/sites/default/files/pega-user-image/263/REG-262580.png?source=PUMINIT)
Infosys
IN
@VishalB8 : Did you get any Solution on this ?
I also have same issue in Pega 8.6.2
Updated: 15 Jan 2022 21:45 EST
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690000000/a5014a5e-6e4c-4d5e-8319-34a167ff884a.jpg?itok=bj2pXp9w)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690000000/a5014a5e-6e4c-4d5e-8319-34a167ff884a.jpg?itok=bj2pXp9w)
Rulesware
PE
@MaheshC1936The problem is in the WHEN condition in the third action "FinishAssignment". Think about it as a condition to render the action and not as a condition to execute the action.
The first time the UI is rendered, .Flag is FALSE, so the "Finish Assignment" action won't be executed.
When you click the button, the first activity will set .Flag to TRUE, so the next time the UI is rendered, .Flag is TRUE, and the "Finish Assignment" action will be executed (when clicking the button, this would be the second time we click that button).
So, my solution would be to Refresh the Harness on button Click and run an activity that Calls the first activity and then calls the FinishAssignment activity.
-
Sowmya Jeevana Lam
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infomatics Corp
US
@MaheshC1936 - Perform the below steps to make it work.
1. Create a Hidden Property in the section rule where the button is located.
2. Run your activity which set the hidden value to true/fase based on the condition.
3. Configure Refresh this section and select the "Disable Submit on Refresh"
4. Refer the Hidden Property in the When Condition of the Finish Assignment Action.
-
Serkan Satirtav Baalavignesh B S Revanth Vigneshwar