The task is to replicate the Run activity from Action’s dropdown to be configured in a custom section so that when we click a button, it will open a window where we can enter activity XYZ’s parameters then run it. Just like when we run an activity straight from the rule itself but we need to do it from a custom section.
For the task, I need to use “WBRun” activity where it requires the activity XYZ’s pzInsKey. WBRun will find the activity and open the window so that we can enter the parameters and execute the activity. The problem is that currently the pzInsKey is hardcoded so the question is that is there a way to dynamically set the activity XYZ’s pzInsKey?
Any other ideas on how to replicate run activity from the action dropdown in a custom section are welcome
@alfin.putra
You can call WBRun from a wrapper activity and wrapper activity you can call at section.
In wrapper activity with activity name given you can browse(Obj-Browse on Rule-Obj-Activity) to get pzinskey(If multiple activity with same name then need to filter out which one you need).
@ManjunathaC Thanks for your answer. I created the wrapper activity as suggested and it works fine when the activity is executed by itself.
However, when I call the wrapper activity in the section using Click event and Open URL in Window, it threw an error. I also tried to use Click event and Run an Activity action but no window pop up. The wrapper activity seems to work as I can see pxresults in the clipboard but WBRun wasn’t running
@ManjunathaC it’s just throwing the pega failed window rather than pega success just like when a rule is executed successfully. When I used Click and Run an activity, nothing showing but obj-browse was executed as there are pxResult in the clipboard and I can see the activity .pzInsKey, it’s just that no window pop up to enter the activity parameter and eaxecute it.
Tried to pass “Standard” as the context thread but not working.
@alfin.putra
To replicate Run action, you need to refer, pzRuleFormToolbarRunMenu
Action Run , Harness pxRunRecord.
In your case on click of button need to launch harness and call pzRunRecordInitializeWrapper. Before that you need to have InsHandle param set with activity inskey.