Question
What are the situations that lead to passing pyworkpage as parameter?
Hi All,
There are many posts on how to pass page as parameter from one activity to other and also passing pyWorkPage as parameter from one activity to another. I am clear on how to pass pyWorkPage or page as parameter.
But, i am trying to understand what are the situations that lead to passing pyworkpage as parameter? When we are supposed to pass pyWorkPage as parameter ? may be you can take Sales Automation framework ( PCF, CPQ, SA) as an example to explain this point.
My intension is to avoid pyWorkPage hardcoding. So, i need info on when we call using pyWorkPage is hardcoding.
Hi again Ram,
Fantastic that you are actively looking to avoid hard-coding pyWorkPage. Please tell your friends! :)
Ideally you would never hard-code pyWorkPage, for there are a small number of occasions when the assumption that "pyWorkPage is always the current work item" does not hold true.
Depending on the rule you are looking to make the call from (such as a Post Processing Activity), Param.workPage may already hold the name of the current work page, so you could reference that in the "Page name" parameter of the rule you are calling.
In many of these situations though (like Post-Processing Activities), as well as in other occasions when the Primary page of your calling rule is the current work page, assign the result of @pxPrimaryPageGetReference(tools) to a local variable (Activity) or parameter page item (Data Transform). Passing this as your "Page name" parameter gets the intended page name into the called rule at runtime without hardcoding "pyWorkPage" at design-time.
I prefer the function call as it makes the calling rule more reusable. Rules with a dependency on Param.workPage can only be used from flow processing.